优化
This commit is contained in:
@@ -13,8 +13,8 @@
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" v-show="crud.status.cu > 0" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" v-show="crud.status.cu > 0" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -47,7 +47,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="total_score">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model="form.remark" style="width: 210px;" />
|
||||
<el-input v-model="form.remark" style="width: 210px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
@@ -64,6 +64,7 @@
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
v-show="crud.status.cu > 0"
|
||||
:disabled="crud.status.view > 0"
|
||||
@click="choosePoint"
|
||||
>
|
||||
@@ -87,15 +88,7 @@
|
||||
<el-table-column prop="single_score" label="单项分值" align="center" />
|
||||
<el-table-column prop="workload" label="工作量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
size="mini"
|
||||
v-model="form.tableData[scope.$index].workload"
|
||||
:controls="false"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
:disabled="crud.status.view > 0"
|
||||
@change="change"
|
||||
/>
|
||||
<el-input v-model="form.tableData[scope.$index].workload" size="mini" class="edit-input" :disabled="crud.status.view > 0" @input="change($event,form.tableData[scope.$index],scope.$index)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="workload_audit" label="审核工作量" align="center" />
|
||||
@@ -232,9 +225,21 @@ export default {
|
||||
this.form.num = this.form.tableData.length
|
||||
},
|
||||
change(val, row, index) {
|
||||
// 对工作量进行校验
|
||||
const numReg = /^[0-9]*$/
|
||||
const numRe = new RegExp(numReg)
|
||||
if (!numRe.test(val)) {
|
||||
this.crud.notify('请输入不小于0的数字', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
row.workload = 0
|
||||
} else {
|
||||
if (row.workload_audit === '') {
|
||||
row.workload = 0
|
||||
}
|
||||
}
|
||||
row.workload_audit = val
|
||||
this.form.tableData.splice(index, 1, row)
|
||||
// 将每行的算出来的分值相加
|
||||
let all = 0
|
||||
row.workload_audit = val
|
||||
this.form.tableData.forEach((item) => {
|
||||
all = all + parseFloat(item.workload_audit) * parseFloat(item.single_score)
|
||||
})
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" v-show="crud.status.cu > 0" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" v-show="crud.status.cu > 0" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -47,7 +47,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="total_score">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model="form.remark" style="width: 210px;" />
|
||||
<el-input v-model="form.remark" style="width: 210px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
@@ -64,6 +64,7 @@
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="crud.status.view > 0"
|
||||
v-show="crud.status.cu > 0"
|
||||
@click="choosePoint"
|
||||
>
|
||||
选择项点
|
||||
|
||||
Reference in New Issue
Block a user