|
@@ -208,7 +208,7 @@
|
|
|
@close="openProductsModal=false"
|
|
|
@ok="handleProductsAdd" />
|
|
|
<!-- 导入产品 -->
|
|
|
- <importGuideModal :goodFlag="chooseVal=='a'?'1':'0'" :discountType="form.discountType" :openModal="openGuideModal" @close="closeGuideModel" @ok="hanldeOk" />
|
|
|
+ <importGuideModal :goodFlag="chooseVal=='a'?'1':'0'" :rulesType="form.discountType" :openModal="openGuideModal" @close="closeGuideModel" @ok="hanldeOk" />
|
|
|
</a-modal>
|
|
|
</template>
|
|
|
|
|
@@ -533,11 +533,9 @@ export default {
|
|
|
const num = 3
|
|
|
for (var i = 0; i < num; i++) {
|
|
|
if (item['productTypeName' + (i + 1)]) {
|
|
|
- // item.title += item['productTypeName' + (i + 1)] + (item['productTypeName' + (i + 1)] ? '/' : '')
|
|
|
typeObj['productTypeSn' + (i + 1)] = item['productTypeSn' + (i + 1)] ? item['productTypeSn' + (i + 1)] : ''
|
|
|
}
|
|
|
}
|
|
|
- // item.title = item.title.slice(0, item.title.length - 1)
|
|
|
if (item.productTypeName3) {
|
|
|
item.title = item.productTypeName2 + '/' + item.productTypeName3
|
|
|
} else if (!item.productTypeName3 && item.productTypeName2) {
|
|
@@ -579,14 +577,39 @@ export default {
|
|
|
arr.forEach(item => {
|
|
|
item = { ...item, ...item.product }
|
|
|
item.code = item.productCode
|
|
|
- if (item.provincePrice) {
|
|
|
- item.provinceDiscountRate = Math.floor(((item.provinceDiscountPriceText / item.provincePrice) * 100).toFixed(2))
|
|
|
- }
|
|
|
- if (item.cityPrice) {
|
|
|
- item.cityDiscountRate = Math.floor(((item.cityDiscountPriceText / item.cityPrice) * 100).toFixed(2))
|
|
|
- }
|
|
|
- if (item.specialPrice) {
|
|
|
- item.specialDiscountRate = Math.floor(((item.specialDiscountPriceText / item.specialPrice) * 100).toFixed(2))
|
|
|
+ if (this.form.discountType == '0') {
|
|
|
+ if (item.provincePrice) {
|
|
|
+ item.provinceDiscountRate = Math.floor(((item.provinceDiscountPriceText / item.provincePrice) * 100).toFixed(2))
|
|
|
+ }
|
|
|
+ if (item.cityPrice) {
|
|
|
+ item.cityDiscountRate = Math.floor(((item.cityDiscountPriceText / item.cityPrice) * 100).toFixed(2))
|
|
|
+ }
|
|
|
+ if (item.specialPrice) {
|
|
|
+ item.specialDiscountRate = Math.floor(((item.specialDiscountPriceText / item.specialPrice) * 100).toFixed(2))
|
|
|
+ }
|
|
|
+ } else if (this.form.discountType == '1') {
|
|
|
+ if (item.provincePrice) {
|
|
|
+ item.provinceDiscountRate = this.form.provinceValue
|
|
|
+ item.provinceDiscountPriceText = (item.provincePrice * this.form.provinceValue / 100).toFixed(2)
|
|
|
+ }
|
|
|
+ if (item.cityPrice) {
|
|
|
+ item.cityDiscountRate = this.form.cityValue
|
|
|
+ item.cityDiscountPriceText = (item.cityPrice * this.form.cityValue / 100).toFixed(2)
|
|
|
+ }
|
|
|
+ if (item.specialPrice) {
|
|
|
+ item.specialDiscountRate = this.form.specialValue
|
|
|
+ item.specialDiscountPriceText = (item.specialPrice * this.form.specialValue / 100).toFixed(2)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (item.provincePrice) {
|
|
|
+ item.provinceSubtract = item.provincePrice - this.form.provinceValue
|
|
|
+ }
|
|
|
+ if (item.cityPrice) {
|
|
|
+ item.citySubtract = item.cityPrice - this.form.cityValue
|
|
|
+ }
|
|
|
+ if (item.specialPrice) {
|
|
|
+ item.specialSubtract = item.specialPrice - this.form.specialValue
|
|
|
+ }
|
|
|
}
|
|
|
const flag = dataList.includes(item.productSn)
|
|
|
if (!flag) {
|