|
|
@ -38,7 +38,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item class="trightb_item"> |
|
|
|
<!-- <span slot="label">{{formobj.price}}</span> --> |
|
|
|
<!-- <span slot="label">{{formobj.price}}</span> --> |
|
|
|
<!-- <el-input v-model="formobj.boundaryPrice" placeholder="" class="addinputw" |
|
|
|
style="width:100%" clearable |
|
|
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /> --> |
|
|
@ -64,11 +64,11 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item class="trightb_item"> |
|
|
|
<!-- <span slot="label">{{formobj.price}}</span> --> |
|
|
|
<!-- <span slot="label">{{formobj.price}}</span> --> |
|
|
|
<el-input v-model="formobj.preferentialPrice" placeholder="" class="addinputw" |
|
|
|
style="width:100%" clearable |
|
|
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /> |
|
|
|
|
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -142,9 +142,11 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="商品名称" prop="name" align="center" /> |
|
|
|
<el-table-column label="商品数量" prop="goodsNumber" align="center" /> |
|
|
|
<el-table-column label="商品价格" prop="price" align="center" /> |
|
|
|
<el-table-column label="商品单位" prop="unitName" align="center" /> |
|
|
|
<el-table-column label="份数" prop="goodsNumber" align="center" /> |
|
|
|
<el-table-column label="价格(元/斤)" prop="price" align="center" /> |
|
|
|
<el-table-column label="商品单位" prop="specificationUnit" align="center" /> |
|
|
|
<el-table-column label="规格(斤份)" prop="weight" align="center" /> |
|
|
|
<el-table-column label="小计" prop="subtotal" align="center" /> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
</el-collapse-item> |
|
|
@ -175,17 +177,31 @@ |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td>单价</td> |
|
|
|
<td>价格(元/斤)</td> |
|
|
|
<td> |
|
|
|
<!-- <span style="width:100%">{{GiftBagGood.price}}</span> --> |
|
|
|
<el-input v-model="GiftBagGood.price" style="width:100%" |
|
|
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" ></el-input> |
|
|
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')"></el-input> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td>商品单位</td> |
|
|
|
<td> |
|
|
|
<span style="width:100%">{{GiftBagGood.unitName}}</span> |
|
|
|
<span style="width:100%">{{GiftBagGood.specificationUnit}}</span> |
|
|
|
<!-- <el-input v-model="GiftBagGood.unitName" style="width:100%"></el-input> --> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td>规格(斤份)</td> <!-- // 一份多少斤 --> |
|
|
|
<td> |
|
|
|
<span style="width:100%">{{GiftBagGood.weight}}</span> |
|
|
|
<!-- <el-input v-model="GiftBagGood.unitName" style="width:100%"></el-input> --> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td>小计</td> <!-- // 份数*份单价 --> |
|
|
|
<td> |
|
|
|
<span style="width:100%">{{GiftBagGood.subtotal}}</span> |
|
|
|
<!-- <el-input v-model="GiftBagGood.unitName" style="width:100%"></el-input> --> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
@ -233,6 +249,9 @@ |
|
|
|
name: "", |
|
|
|
unitName: "", |
|
|
|
price: "", |
|
|
|
specificationUnit: "", |
|
|
|
weight: "", |
|
|
|
subtotal: "0.00" |
|
|
|
|
|
|
|
}, |
|
|
|
goods: [], |
|
|
@ -254,6 +273,8 @@ |
|
|
|
const index = this.formobj.goods.findIndex((item) => item.goodsSid === sid) |
|
|
|
console.log("index》》》》", index) |
|
|
|
this.formobj.goods.splice(index, 1) |
|
|
|
|
|
|
|
this.countPrice() |
|
|
|
}) |
|
|
|
}, |
|
|
|
save() { |
|
|
@ -289,11 +310,14 @@ |
|
|
|
name: "", |
|
|
|
unitName: "", |
|
|
|
price: "", |
|
|
|
specificationUnit: "", |
|
|
|
weight: "", |
|
|
|
subtotal: "0.00" |
|
|
|
|
|
|
|
} |
|
|
|
this.editDialog = false |
|
|
|
this.countPrice() |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
@ -305,39 +329,46 @@ |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
countPrice(){ |
|
|
|
|
|
|
|
|
|
|
|
countPrice() { |
|
|
|
|
|
|
|
let num = 0 |
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < this.formobj.goods.length; i++) { |
|
|
|
var item = this.formobj.goods[i] |
|
|
|
|
|
|
|
num+=item.goodsNumber*item.price |
|
|
|
|
|
|
|
|
|
|
|
num += Number(item.subtotal) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
console.log("num",num); |
|
|
|
|
|
|
|
this.formobj.price = num.toFixed(2) |
|
|
|
this.formobj.preferentialPrice = num.toFixed(2) |
|
|
|
|
|
|
|
|
|
|
|
console.log("num", num); |
|
|
|
|
|
|
|
this.formobj.price = Number(num).toFixed(2) |
|
|
|
this.formobj.preferentialPrice = Number(num).toFixed(2) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleCancle(){ |
|
|
|
|
|
|
|
handleCancle() { |
|
|
|
this.GiftBagGood = { |
|
|
|
goodsSid: "", |
|
|
|
goodsNumber: "", |
|
|
|
name: "", |
|
|
|
unitName: "", |
|
|
|
price: "", |
|
|
|
|
|
|
|
specificationUnit: "", |
|
|
|
weight: "", |
|
|
|
subtotal: "0.00" |
|
|
|
|
|
|
|
} |
|
|
|
this.editDialog = false |
|
|
|
}, |
|
|
|
input(val) { |
|
|
|
console.log("input》》》》", val) |
|
|
|
this.GiftBagGood.goodsNumber = val |
|
|
|
|
|
|
|
this.GiftBagGood.subtotal = this.GiftBagGood.goodsNumber * this.GiftBagGood.price * this.GiftBagGood.weight |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
add() { |
|
|
|
this.editDialog = true |
|
|
@ -358,6 +389,8 @@ |
|
|
|
this.GiftBagGood.name = choose[0].name |
|
|
|
this.GiftBagGood.unitName = choose[0].unitName |
|
|
|
this.GiftBagGood.price = choose[0].price |
|
|
|
this.GiftBagGood.specificationUnit = choose[0].specificationUnit |
|
|
|
this.GiftBagGood.weight = choose[0].weight |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|