Browse Source

完善车型调价申请

zhanglei
yunuo970428 8 months ago
parent
commit
249ffc4f8e
  1. 73
      anrui-scm/anrui-scm-ui/src/views/kucunguanli/tiaojiaguanli/priceAdd.vue
  2. 49
      anrui-scm/anrui-scm-ui/src/views/workFlow/tiaojiaguanliFlow/tiaojiaguanli/tiaojiaEdit.vue

73
anrui-scm/anrui-scm-ui/src/views/kucunguanli/tiaojiaguanli/priceAdd.vue

@ -116,12 +116,12 @@
<el-table-column label="调整后销售指导价(元)" header-align="center">
<el-table-column label="全款价" align="left" header-align="center" width="140">
<template slot-scope="scope">
<el-input v-model="scope.row.tzhGuidedPrice" placeholder="" @keyup.native="UpNumber" @keydown.native="UpNumber" class="addinputw" clearable/>
<el-input v-model="scope.row.tzhGuidedPrice" placeholder="" @keyup.native="scope.row.tzhGuidedPrice = getNumber(scope.row.tzhGuidedPrice, 0)" class="addinputw" clearable/>
</template>
</el-table-column>
<el-table-column label="贷款价" align="left" header-align="center" width="140">
<template slot-scope="scope">
<el-input v-model="scope.row.tzhManufactorSettlementPrice" placeholder="" @keyup.native="UpNumber" @keydown.native="UpNumber" class="addinputw" clearable/>
<el-input v-model="scope.row.tzhManufactorSettlementPrice" placeholder="" @keyup.native="scope.row.tzhManufactorSettlementPrice = getNumber(scope.row.tzhManufactorSettlementPrice, 0)" class="addinputw" clearable/>
</template>
</el-table-column>
</el-table-column>
@ -150,7 +150,7 @@ import req from '@/api/kucunguanli/price'
import configuration from './chexingbyconfiguration'
export default {
name: 'priceAdd',
name: 'PriceAdd',
components: {
configuration
},
@ -191,27 +191,23 @@ export default {
}
},
methods: {
//
newDate() {
var date = new Date()
var year = date.getFullYear() //
var month = date.getMonth() + 1 //
var day = date.getDate() //
if (month < 10) {
month = '0' + month
}
if (day < 10) {
day = '0' + day
}
this.formobj.createTime = year + '-' + month + '-' + day
},
UpNumber(e) {
e.target.value = e.target.value.replace(/[^\d]/g, '') // ."-"
e.target.value = e.target.value.replace(/^00/, '0') // 0
if (e.target.value.indexOf('.') < 0 && e.target.value !== '' && e.target.value !== '-') {
// 0102
e.target.value = parseFloat(e.target.value)
getNumber(val, limit) {
val = val.replace(/[^0-9.]/g, '') //
val = val.replace(/^00/, '0.') // 0
val = val.replace(/^\./g, '0.') // 0.
val = val.replace(/\.{2,}/g, '.') //
val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); //
/^0\d+/.test(val) ? val = val.slice(1) : '' // 0
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$'
const reg = new RegExp(str)
if (limit === 0) {
//
val = val.replace(reg, '$1')
} else {
//
val = val.replace(reg, '$1.$2')
}
return val
},
//
addCommodity() {
@ -223,7 +219,6 @@ export default {
this.formobj.baseModelModpriceModels.splice(index, 1)
},
showAdd(createOrgSid) {
this.newDate()
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
@ -235,6 +230,13 @@ export default {
this.formobj.orgPath = window.sessionStorage.getItem('defaultOrgPath')
this.formobj.deptName = window.sessionStorage.getItem('defaultOrgPathName').substring(window.sessionStorage.getItem('defaultOrgPathName').lastIndexOf('/') + 1)
this.formobj.deptSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1)
var nowDate = new Date()
var date = {
year: nowDate.getFullYear(),
month: nowDate.getMonth() + 1,
day: nowDate.getDate()
}
this.formobj.createTime = date.year + '-' + (date.month >= 10 ? date.month : '0' + date.month) + '-' + (date.day >= 10 ? date.day : '0' + date.day)
this.viewTitle = '【新增】车型调价申请'
},
showEdit(row) {
@ -345,11 +347,7 @@ export default {
if (valid) {
this.submitdisabled = true
req.saveOrUpdate(this.formobj).then((resp) => {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.$message({ showClose: true, type: 'success', message: resp.msg })
this.handleReturn('true')
}).catch(() => {
this.submitdisabled = false
@ -360,16 +358,23 @@ export default {
})
},
submitVehicleApply() {
if (this.formobj.baseModelModpriceModels.length > 0) {
for (var i = 0; i < this.formobj.baseModelModpriceModels.length; i++) {
if (this.formobj.baseModelModpriceModels[i].tzhGuidedPrice === '' || this.formobj.baseModelModpriceModels[i].tzhManufactorSettlementPrice === '') {
this.$message({ showClose: true, type: 'error', message: '车型列表中调整后销售指导价的全款价及贷款价均不能为空' })
return
}
}
} else {
this.$message({ showClose: true, type: 'error', message: '车型列表不能为空' })
return
}
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.submitdisabled = true
req.submitVehicleApply(this.formobj).then((res) => {
if (res.success) {
this.$message({
showClose: true,
type: 'success',
message: '提交成功'
})
this.$message({ showClose: true, type: 'success', message: resp.msg })
this.handleReturn('true')
}
}).catch(() => {

49
anrui-scm/anrui-scm-ui/src/views/workFlow/tiaojiaguanliFlow/tiaojiaguanli/tiaojiaEdit.vue

@ -115,12 +115,12 @@
<el-table-column label="调整后销售指导价(元)" header-align="center">
<el-table-column label="全款价" align="left" header-align="center" width="140">
<template slot-scope="scope">
<el-input v-model="scope.row.tzhGuidedPrice" placeholder="" @keyup.native="UpNumber" @keydown.native="UpNumber" class="addinputw" clearable/>
<el-input v-model="scope.row.tzhGuidedPrice" placeholder="" @keyup.native="scope.row.tzhGuidedPrice = getNumber(scope.row.tzhGuidedPrice, 0)" class="addinputw" clearable/>
</template>
</el-table-column>
<el-table-column label="贷款价" align="left" header-align="center" width="140">
<template slot-scope="scope">
<el-input v-model="scope.row.tzhManufactorSettlementPrice" placeholder="" @keyup.native="UpNumber" @keydown.native="UpNumber" class="addinputw" clearable/>
<el-input v-model="scope.row.tzhManufactorSettlementPrice" placeholder="" @keyup.native="scope.row.tzhManufactorSettlementPrice = getNumber(scope.row.tzhManufactorSettlementPrice, 0)" class="addinputw" clearable/>
</template>
</el-table-column>
</el-table-column>
@ -207,13 +207,23 @@ export default {
}, '*')
},
methods: {
UpNumber(e) {
e.target.value = e.target.value.replace(/[^\d]/g, '') // ."-"
e.target.value = e.target.value.replace(/^00/, '0') // 0
if (e.target.value.indexOf('.') < 0 && e.target.value !== '' && e.target.value !== '-') {
// 0102
e.target.value = parseFloat(e.target.value)
getNumber(val, limit) {
val = val.replace(/[^0-9.]/g, '') //
val = val.replace(/^00/, '0.') // 0
val = val.replace(/^\./g, '0.') // 0.
val = val.replace(/\.{2,}/g, '.') //
val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); //
/^0\d+/.test(val) ? val = val.slice(1) : '' // 0
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$'
const reg = new RegExp(str)
if (limit === 0) {
//
val = val.replace(reg, '$1')
} else {
//
val = val.replace(reg, '$1.$2')
}
return val
},
//
addCommodity() {
@ -332,11 +342,7 @@ export default {
if (valid) {
this.submitdisabled = true
req.saveOrUpdate(this.formobj).then((resp) => {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.$message({ showClose: true, type: 'success', message: resp.msg })
// ()
window.parent.postMessage({
cmd: 'returnHeight',
@ -354,16 +360,23 @@ export default {
})
},
submitVehicleApply() {
if (this.formobj.baseModelModpriceModels.length > 0) {
for (var i = 0; i < this.formobj.baseModelModpriceModels.length; i++) {
if (this.formobj.baseModelModpriceModels[i].tzhGuidedPrice === '' || this.formobj.baseModelModpriceModels[i].tzhManufactorSettlementPrice === '') {
this.$message({ showClose: true, type: 'error', message: '车型列表中调整后销售指导价的全款价及贷款价均不能为空' })
return
}
}
} else {
this.$message({ showClose: true, type: 'error', message: '车型列表不能为空' })
return
}
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.submitdisabled = true
req.submitVehicleApply(this.formobj).then((res) => {
if (res.success) {
this.$message({
showClose: true,
type: 'success',
message: '提交成功'
})
this.$message({ showClose: true, type: 'success', message: resp.msg })
// ()
window.parent.postMessage({
cmd: 'returnHeight',

Loading…
Cancel
Save