|
@@ -40,6 +40,7 @@
|
|
|
<th rowspan="2" class="required"><span>*</span>名称</th>
|
|
|
<th rowspan="2" class="required"><span>*</span>价格(元)</th>
|
|
|
<th rowspan="2" class="required"><span>*</span>兑换盲豆数量</th>
|
|
|
+ <th rowspan="2" class="required"><span>*</span>回收折扣</th>
|
|
|
<th rowspan="2">盲豆划线价</th>
|
|
|
<th rowspan="2">采购价格(元)</th>
|
|
|
<th rowspan="2">SKU编码</th>
|
|
@@ -76,6 +77,12 @@
|
|
|
</el-form-item>
|
|
|
</td>
|
|
|
<!-- 1111111111111111111111-->
|
|
|
+ <td>
|
|
|
+ <el-form-item :prop="`skuList.${index}.discountRate`" :rules="discountRateRules">
|
|
|
+ <!-- <p>{{ (sku.valueY * 10).toFixed(0) }}</p>-->
|
|
|
+ <el-input v-model="sku.discountRate" />
|
|
|
+ </el-form-item>
|
|
|
+ </td>
|
|
|
<td class="pd">
|
|
|
<el-form-item :prop="`skuList.${index}.originPrice`">
|
|
|
<el-input v-model="sku.originPrice" />
|
|
@@ -140,6 +147,10 @@ export default {
|
|
|
exchangeRules: [
|
|
|
{ required: true,message:'请输入盲豆数量', trigger: 'blur' },
|
|
|
{ pattern: /^([1-9]\d*)$/, message: "请输入正确的盲豆数量", trigger: ["blur", "change"] }
|
|
|
+ ],
|
|
|
+ discountRateRules: [
|
|
|
+ { required: true,message:'请输入回收折扣', trigger: 'blur' },
|
|
|
+ { pattern: /^([1-9]\d*(\.\d{1,2})?|([0](\.([0][1-9]|[1-9]\d{0,1}))))$/, message: "请输入正确的折扣,最多两位小数", trigger: ["blur", "change"] }
|
|
|
]
|
|
|
}
|
|
|
},
|
|
@@ -177,6 +188,7 @@ export default {
|
|
|
this.$set(item, 'valueY', accDiv(item.value, 100))
|
|
|
this.$set(item, 'exchange', accDiv(item.exchangePrice,1))
|
|
|
this.$set(item, 'originPrice', accDiv(item.originPrice,1))
|
|
|
+ this.$set(item, 'discountRate', accDiv(item.discountRate,1))
|
|
|
this.$set(item, 'costY', item.cost == null ? '' : accDiv(item.cost, 100) )
|
|
|
this.$set(item, 'picUrlArr', item.picUrl.split(',').map(item => { return { fileName: item }}))
|
|
|
this.$set(item, 'status', !!item.quantity)
|
|
@@ -274,6 +286,7 @@ export default {
|
|
|
costY: '',
|
|
|
skuCode:'',
|
|
|
originPrice: 0,
|
|
|
+ discountRate: '',
|
|
|
quantity: 0,
|
|
|
status: true,
|
|
|
properties
|
|
@@ -309,10 +322,11 @@ export default {
|
|
|
this.$refs.sku.validate((valid, items) => {
|
|
|
if (valid) {
|
|
|
this.skuList.forEach(item => {
|
|
|
- const { valueY,exchange, costY, originPrice } = item
|
|
|
+ const { valueY,exchange, costY, originPrice, discountRate } = item
|
|
|
item.value = accMul(valueY, 100)
|
|
|
item.exchangePrice = accMul(exchange, 1)
|
|
|
item.originPrice = accMul(originPrice, 1)
|
|
|
+ item.discountRate = accMul(discountRate, 1)
|
|
|
item.cost = costY == '' ? '' : accMul(costY, 100)
|
|
|
item.picUrl = item.picUrlArr.map(item => { return item.fileName }).toString()
|
|
|
})
|