|
@@ -141,12 +141,12 @@
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="月成本" prop="monthCost" v-if="insertForm.salaryType == 0">
|
|
|
- <el-input v-model.number="insertForm.monthCost" @input="oninput" placeholder="请输入月成本,单位:元" clearable></el-input>
|
|
|
+ <el-input v-model="insertForm.monthCost" id="mc" @input="oninput" placeholder="请输入月成本,单位:元" clearable @keyup.native="restrictNumber('mc')"></el-input>
|
|
|
<span style="color:orange;font-size:12px;">按照每个月工作{{timeType.monthDays}}天,每天{{timeType.allday}}小时预估时薪</span>
|
|
|
<el-link :underline="false" style="color:blue;font-size:12px;margin-left:7px;" href="#/timetype">修改工作时长</el-link>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="时薪" prop="cost">
|
|
|
- <el-input v-model.number="insertForm.cost" :disabled="insertForm.salaryType == 0" style="width:120px;"
|
|
|
+ <el-input v-model="insertForm.cost" :disabled="insertForm.salaryType == 0" id="cc" style="width:120px;" @keyup.native="restrictNumber('cc')"
|
|
|
placeholder="请输入成本 单位:元/小时" clearable></el-input>
|
|
|
<span style="margin-left:25px;">生效日期</span>
|
|
|
<el-date-picker v-model="insertForm.costApplyDate" value-format="yyyy-MM-dd"></el-date-picker>
|
|
@@ -190,12 +190,12 @@
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="月成本" prop="monthCost" v-if="insertForm.salaryType == 0">
|
|
|
- <el-input v-model.number="insertForm.monthCost" @input="oninput" placeholder="请输入月成本,单位:元" clearable></el-input>
|
|
|
+ <el-input v-model="insertForm.monthCost" id="monthCost" @input="oninput" @keyup.native="restrictNumber('monthCost')" placeholder="请输入月成本,单位:元" clearable></el-input>
|
|
|
<span style="color:orange;font-size:12px;">按照每个月工作{{timeType.monthDays}}天,每天{{timeType.allday}}小时预估时薪</span>
|
|
|
<el-link :underline="false" style="color:blue;font-size:12px;margin-left:7px;" href="#/timetype">修改工作时长</el-link>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="时薪" prop="cost">
|
|
|
- <el-input v-model.number="insertForm.cost" :disabled="insertForm.salaryType == 0" style="width:120px;"
|
|
|
+ <el-input v-model="insertForm.cost" id="cost" :disabled="insertForm.salaryType == 0" @keyup.native="restrictNumber('cost')" style="width:120px;"
|
|
|
placeholder="请输入成本 单位:元/小时" clearable></el-input>
|
|
|
<span style="margin-left:25px;">生效日期</span>
|
|
|
<el-date-picker v-model="insertForm.costApplyDate" value-format="yyyy-MM-dd"></el-date-picker>
|
|
@@ -368,6 +368,16 @@
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ restrictNumber(targetId) {
|
|
|
+ let inpu = document.getElementById(targetId);
|
|
|
+ inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
|
|
|
+ inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
|
|
|
+ inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
|
|
|
+ inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
|
|
|
+ if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
|
|
|
+ inpu.value = parseFloat(inpu.value);
|
|
|
+ }
|
|
|
+ },
|
|
|
showConfirmDialog() {
|
|
|
if (this.toUserId == null || this.toUserId == '') {
|
|
|
this.$message({
|