修改问题

修改问题
This commit is contained in:
shawnzhang 2021-01-13 17:24:40 +08:00
parent 28e106ccd0
commit ee0a512f9c
5 changed files with 48 additions and 20 deletions

View file

@ -787,7 +787,7 @@ export default {
console.log(this.list2)
let carTypeId = ''
for (const i in this.list2) {
console.log('this.list2[i]', this.list2[i])
// console.log('this.list2[i]', this.list2[i])
if (this.list2[i].productCode.slice(0, 2) === '01') {
carTypeId = this.list2[i].productType
}
@ -1148,7 +1148,12 @@ export default {
}
})
console.log('needval', needval)
this.rate = needval.rate
if (!needval) {
this.rate = 0
} else {
this.rate = needval.rate
}
if (this.personalForm.firstMoney != null && this.personalForm.firstMoney !== '' && this.personalForm.firstMoney !== undefined) {
if (this.price != null && this.price !== '' && this.price !== undefined) {
if (this.rate != null && this.rate !== '' && this.rate !== undefined && this.rate !== 0) {
@ -1167,14 +1172,14 @@ export default {
this.personalForm.totalMoney = (Math.floor((each / 100)) * 100 + 100) * this.personalForm.installmentCount
}
} else if (this.rate === 0) {
this.personalForm.totalMoney = ((Number(this.productForm.price) - Number(this.personalForm.firstMoney)) * (1 + Number(this.rate))).toFixed(6)
this.personalForm.totalMoney = ((Number(this.price) - Number(this.personalForm.firstMoney)) * (1 + Number(this.rate))).toFixed(6)
const each = Math.ceil(this.personalForm.totalMoney / this.personalForm.installmentCount)
}
}
}
let carTypeId = ''
for (const i in this.list2) {
console.log('this.list2[i]', this.list2[i])
// console.log('this.list2[i]', this.list2[i])
if (this.list2[i].productCode.slice(0, 2) === '01') {
carTypeId = this.list2[i].productType
}
@ -1205,10 +1210,15 @@ export default {
}
})
console.log('needval', needval)
this.rate = needval.rate
if (!needval) {
this.rate = 0
} else {
this.rate = needval.rate
}
console.log('this.rate', this.rate)
this.rate = needval.rate
console.log('折扣2', this.rate)
// this.rate = needval.rate
// console.log('2', this.rate)
console.log('this.price', this.price)
if (this.personalForm.firstMoney != null && this.personalForm.firstMoney !== '' && this.personalForm.firstMoney !== undefined) {
if (this.price != null && this.price !== '' && this.price !== undefined) {
if (needval.rate != null && needval.rate !== '' && needval.rate !== undefined && needval.rate !== 0) {
@ -1222,14 +1232,14 @@ export default {
this.personalForm.totalMoney = (Math.floor((each / 100)) * 100 + 100) * this.personalForm.installmentCount
}
} else if (needval.rate === 0) {
this.personalForm.totalMoney = ((Number(this.productForm.price) - Number(this.personalForm.firstMoney)) * (1 + Number(this.rate))).toFixed(6)
this.personalForm.totalMoney = ((Number(this.price) - Number(this.personalForm.firstMoney)) * (1 + Number(this.rate))).toFixed(6)
const each = Math.ceil(this.personalForm.totalMoney / this.personalForm.installmentCount)
}
}
}
let carTypeId = ''
for (const i in this.list2) {
console.log('this.list2[i]', this.list2[i])
// console.log('this.list2[i]', this.list2[i])
if (this.list2[i].productCode.slice(0, 2) === '01') {
carTypeId = this.list2[i].productType
}
@ -1536,7 +1546,12 @@ export default {
row.taxprice = (row.salePrice * (1 + row.taxRate / 100)).toFixed(6)
//
countlist(this.personalForm.saleRepositoryId, this.$store.getters.regionIds, row.productCode).then(res => {
row.existStock = res.data.data.content.list[0].existStock
// console.log('res', res)
if (res.data.ret === 200 && res.data.data.content.list.length !== 0) {
row.existStock = res.data.data.content.list[0].existStock
} else {
row.existStock = 0
}
})
return row.taxprice
},

View file

@ -748,7 +748,7 @@ export default {
this.personalForm.totalMoney = (Math.floor((each / 100)) * 100 + 100) * this.personalForm.installmentCount
}
} else if (this.rate === 0) {
this.personalForm.totalMoney = ((Number(this.productForm.price) - Number(this.personalForm.firstMoney)) * (1 + Number(this.rate))).toFixed(6)
this.personalForm.totalMoney = ((Number(this.price) - Number(this.personalForm.firstMoney)) * (1 + Number(this.rate))).toFixed(6)
const each = Math.ceil(this.personalForm.totalMoney / this.personalForm.installmentCount)
}
}

View file

@ -114,7 +114,7 @@ export default {
default: null
},
packagerepository: {
type: String,
type: [String, Number],
default: null
}
},

View file

@ -1411,6 +1411,12 @@ export default {
this.flexAdvanceMoney = 0
}
// const arr = ['1', '3', '4', '5', '6']
// const test = arr.some(item => {
// this.personalForm.sourceType === item
// })
if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '3' || this.personalForm.sourceType === '4' || this.personalForm.sourceType === '5' || this.personalForm.sourceType === '6') {
console.log('this.personalForm.personalForm', this.personalForm.personalForm)
let needmoney = (Number(this.heji3) - Number(this.heji4) - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney) - Number(this.personalForm.couponSupportOld) - Number(this.personalForm.couponMoney)) + Number(this.personalForm.otherMoney)

View file

@ -157,7 +157,7 @@
<my-detail :control.sync="control" @product="productdetail"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">{{ $t('Hmodule.delete') }}</el-button>
<!-- <el-button type="primary" @click="checkStock()">{{ $t('updates.kckz') }}</el-button>-->
<el-button :loading="downloadLoading" size="small" class="filter-item2" type="primary" @click="handleExport">{{ $t('update4.xiazaimoban') }}</el-button>
<el-button :loading="downloadLoading" size="small" class="filter-item2" type="primary" @click="handleExport">{{ $t('public.export') }}</el-button>
</div>
<div class="container">
@ -170,14 +170,15 @@
:show-summary="jundgeprice()"
stripe
border
height="600px"
size="small"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-editable-column type="selection" min-width="55" align="center"/>
<el-editable-column :label="$t('Hmodule.xh')" min-width="55" align="center" type="index"/>
<el-editable-column :label="$t('Hmodule.wpbh')" prop="productCode" align="center" min-width="150px"/>
<el-editable-column :label="$t('Hmodule.wpmc')" prop="productName" align="center" min-width="150px"/>
<el-editable-column :label="$t('Hmodule.gg')" prop="productType" align="center" min-width="150px"/>
<el-editable-column type="selection" min-width="55" fixed align="center"/>
<el-editable-column :label="$t('Hmodule.xh')" min-width="55" fixed align="center" type="index"/>
<el-editable-column :label="$t('Hmodule.wpbh')" prop="productCode" fixed align="center" min-width="150px"/>
<el-editable-column :label="$t('Hmodule.wpmc')" prop="productName" fixed align="center" min-width="150px"/>
<el-editable-column :label="$t('Hmodule.gg')" prop="productType" fixed align="center" min-width="150px"/>
<el-editable-column :label="$t('updates.ys')" prop="color" align="center" min-width="150px"/>
<el-editable-column :label="$t('Hmodule.dw')" prop="unit" align="center" min-width="150px"/>
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0, precision: 6}, type: 'visible'}" :label="$t('updates.shuli')" prop="quantity" align="center" min-width="200px">
@ -556,12 +557,18 @@ export default {
_that = this
},
methods: {
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => {
return v[j]
}))
},
handleExport() {
const list = this.$refs.editable.getRecords()
console.log('list', list)
this.downloadLoading = true
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['序号', '物料编码', '产品名称', '物品分类', '型号id', '规格型号', '单位id', '颜色', '成本价', '备注']
const filterVal = ['id', 'code', 'productName', 'category', 'typeId', 'productType', 'purMeasu', 'color', 'costPrice', 'remarks']
const tHeader = ['物料编码', '产品名称', '规格型号', '颜色', '数量', '单价', '含税价', '税率', '金额', '含税金额', '税额', '折扣', '折扣额', '源单编号', '订单单号']
const filterVal = ['productCode', 'productName', 'productType', 'color', 'quantity', 'price', 'includeTaxPrice', 'taxRate', 'money', 'includeTaxMoney', 'tax', 'discountRate', 'discountMoney', 'sourceNumber', 'orderNumber']
const data = this.formatJson(filterVal, list)
excel.export_json_to_excel({
header: tHeader,