|
|
@ -82,24 +82,24 @@ |
|
|
|
<span>{{ scope.row.configName }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="内部编码" header-align="center" width="200"> |
|
|
|
<el-table-column label="内部编码" align="center" width="200"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.insideCode" :readonly="isRead" placeholder="" class="addinputw" clearable/> |
|
|
|
<span>{{ scope.row.insideCode }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="排产数量" header-align="center" width="130"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.quantity" @keyup.native="UpNumber" @keydown.native="UpNumber" placeholder="" class="addinputw" clearable/> |
|
|
|
<el-input v-model="scope.row.quantity" @keyup.native="scope.row.quantity = oninput(scope.row.quantity,2)" placeholder="" class="addinputw" clearable/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="applyForDeposit" label="申请订金" header-align="center" width="150"> |
|
|
|
<template slot-scope="scope" prop="applyForDeposit"> |
|
|
|
<el-input v-model="scope.row.applyForDeposit" @keyup.native="UpNumber" @keydown.native="UpNumber" placeholder="" class="addinputw" clearable/> |
|
|
|
<el-input v-model="scope.row.applyForDeposit" @keyup.native="scope.row.applyForDeposit = oninput(scope.row.applyForDeposit,2)" placeholder="" class="addinputw" clearable/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="厂家合同价" header-align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.contractPrice" @keyup.native="UpNumber" @keydown.native="UpNumber" placeholder="" class="addinputw" clearable/> |
|
|
|
<el-input v-model="scope.row.contractPrice" @keyup.native="scope.row.contractPrice = oninput(scope.row.contractPrice,2)" placeholder="" class="addinputw" clearable/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="销售指导价" header-align="center" width="150"> |
|
|
@ -223,16 +223,20 @@ export default { |
|
|
|
} |
|
|
|
this.formobj.applicationDate = year + '-' + month + '-' + day |
|
|
|
}, |
|
|
|
UpNumber(e) { |
|
|
|
e.target.value = e.target.value.replace(/[^\d]/g, '') // 清除“数字”和“.”"-"以外的字符 |
|
|
|
// e.target.value = e.target.value.replace(/^00/, '0.') // 开头不能有两个0 |
|
|
|
// e.target.value = e.target.value.replace(/\.{2,}/g, '.') // 只保留第一个. 清除多余的 |
|
|
|
// e.target.value = e.target.value.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/\-{2,}/g, '-') // 只保留第一个- |
|
|
|
// e.target.value = e.target.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3') // 只能输入两个小数 |
|
|
|
// if (e.target.value.indexOf('.') < 0 && e.target.value !== '' && e.target.value !== '-') { |
|
|
|
// // 以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额 |
|
|
|
// e.target.value = parseFloat(e.target.value) |
|
|
|
// } |
|
|
|
oninput(val, limit = 0) { |
|
|
|
val = val.replace(/[^\d]/g, '') // 保留数字 |
|
|
|
val = val.replace(/^00/, '0'); // 开头不能有两个0 |
|
|
|
/^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() { |
|
|
@ -274,7 +278,7 @@ export default { |
|
|
|
// 车型常用配置列表--新增确定返回的数据 |
|
|
|
backData(value) { |
|
|
|
this.viewState = 1 |
|
|
|
console.log('确认返回的车辆数据',value) |
|
|
|
console.log('确认返回的车辆数据', value) |
|
|
|
if (value.length > 0) { |
|
|
|
value.forEach((e) => { |
|
|
|
this.formobj.busVehicleApplyDetailList.push({ |
|
|
|