修改
This commit is contained in:
parent
dc66a16ff3
commit
f443744104
@ -356,12 +356,14 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="项目指标最小值" prop="minValue">
|
||||
<el-input
|
||||
:change="checkPrice()"
|
||||
v-model="form.minValue"
|
||||
placeholder="请输入项目指标最小值"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目指标最大值" prop="maxValue">
|
||||
<el-input
|
||||
:change="checkPricemax()"
|
||||
v-model="form.maxValue"
|
||||
placeholder="请输入项目指标最大值"
|
||||
/>
|
||||
@ -585,6 +587,41 @@ export default {
|
||||
this.info();
|
||||
},
|
||||
methods: {
|
||||
checkPricemax() {
|
||||
let checkPlan = "" + this.form.maxValue;
|
||||
checkPlan = checkPlan
|
||||
.replace(/[^\d.]/g, "") // 清除“数字”和“.”以外的字符
|
||||
.replace(/\.{2,}/g, ".") // 只保留第一个. 清除多余的
|
||||
.replace(/^\./g, "") // 保证第一个为数字而不是.
|
||||
.replace(".", "$#$")
|
||||
.replace(/\./g, "")
|
||||
.replace("$#$", ".");
|
||||
if (checkPlan.indexOf(".") < 0 && checkPlan !== "") {
|
||||
// 以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
|
||||
checkPlan = parseFloat(checkPlan) + "";
|
||||
} else if (checkPlan.indexOf(".") >= 0) {
|
||||
checkPlan = checkPlan.replace(/^()*(\d+)\.(\d\d).*$/, "$1$2.$3"); // 只能输入两个小数
|
||||
}
|
||||
this.form.maxValue = checkPlan;
|
||||
},
|
||||
/**只能输入数字且有小数点最多保留两位*/
|
||||
checkPrice() {
|
||||
let checkPlan = "" + this.form.minValue;
|
||||
checkPlan = checkPlan
|
||||
.replace(/[^\d.]/g, "") // 清除“数字”和“.”以外的字符
|
||||
.replace(/\.{2,}/g, ".") // 只保留第一个. 清除多余的
|
||||
.replace(/^\./g, "") // 保证第一个为数字而不是.
|
||||
.replace(".", "$#$")
|
||||
.replace(/\./g, "")
|
||||
.replace("$#$", ".");
|
||||
if (checkPlan.indexOf(".") < 0 && checkPlan !== "") {
|
||||
// 以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
|
||||
checkPlan = parseFloat(checkPlan) + "";
|
||||
} else if (checkPlan.indexOf(".") >= 0) {
|
||||
checkPlan = checkPlan.replace(/^()*(\d+)\.(\d\d).*$/, "$1$2.$3"); // 只能输入两个小数
|
||||
}
|
||||
this.form.minValue = checkPlan;
|
||||
},
|
||||
info() {
|
||||
var dictType = "project_judge_mode";
|
||||
getAgencytype(dictType).then((res) => {
|
||||
|
||||
@ -373,10 +373,10 @@
|
||||
<el-input v-model="form.measureResult" placeholder="请输入检测结果,数字或文字描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目指标最大值" prop="maxValue">
|
||||
<el-input v-model="form.maxValue" oninput="value=value.replace(/[^\d.]/g,'')" placeholder="请输入项目指标最大值" />
|
||||
<el-input v-model="form.maxValue" :change="checkPricemax()" placeholder="请输入项目指标最大值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目指标最小值" prop="minValue">
|
||||
<el-input v-model="form.minValue" oninput="value=value.replace(/[^\d.]/g,'')" placeholder="请输入项目指标最小值" />
|
||||
<el-input v-model="form.minValue" :change="checkPrice()" placeholder="请输入项目指标最小值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目指标默认值" prop="defaultValue">
|
||||
<el-input v-model="form.defaultValue" placeholder="请输入项目指标默认值" />
|
||||
@ -430,13 +430,19 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listProjectresult, getProjectresult, delProjectresult, addProjectresult, updateProjectresult } from "@/api/manage/projectresult";
|
||||
import {
|
||||
listProjectresult,
|
||||
getProjectresult,
|
||||
delProjectresult,
|
||||
addProjectresult,
|
||||
updateProjectresult,
|
||||
} from "@/api/manage/projectresult";
|
||||
|
||||
export default {
|
||||
name: "Projectresult",
|
||||
data() {
|
||||
return {
|
||||
option:[
|
||||
option: [
|
||||
// ,合格:,不合格:NOT_QUALIFIED
|
||||
{
|
||||
value: "QUALIFIED",
|
||||
@ -509,19 +515,54 @@ export default {
|
||||
// 表单校验
|
||||
rules: {
|
||||
patientId: [
|
||||
{ required: true, message: "患者id不能为空", trigger: "blur" }
|
||||
{ required: true, message: "患者id不能为空", trigger: "blur" },
|
||||
],
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/**只能输入数字且有小数点最多保留两位*/
|
||||
checkPrice() {
|
||||
let checkPlan = "" + this.form.minValue;
|
||||
checkPlan = checkPlan
|
||||
.replace(/[^\d.]/g, "") // 清除“数字”和“.”以外的字符
|
||||
.replace(/\.{2,}/g, ".") // 只保留第一个. 清除多余的
|
||||
.replace(/^\./g, "") // 保证第一个为数字而不是.
|
||||
.replace(".", "$#$")
|
||||
.replace(/\./g, "")
|
||||
.replace("$#$", ".");
|
||||
if (checkPlan.indexOf(".") < 0 && checkPlan !== "") {
|
||||
// 以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
|
||||
checkPlan = parseFloat(checkPlan) + "";
|
||||
} else if (checkPlan.indexOf(".") >= 0) {
|
||||
checkPlan = checkPlan.replace(/^()*(\d+)\.(\d\d).*$/, "$1$2.$3"); // 只能输入两个小数
|
||||
}
|
||||
this.form.minValue = checkPlan;
|
||||
},
|
||||
checkPricemax() {
|
||||
let checkPlan = "" + this.form.maxValue;
|
||||
checkPlan = checkPlan
|
||||
.replace(/[^\d.]/g, "") // 清除“数字”和“.”以外的字符
|
||||
.replace(/\.{2,}/g, ".") // 只保留第一个. 清除多余的
|
||||
.replace(/^\./g, "") // 保证第一个为数字而不是.
|
||||
.replace(".", "$#$")
|
||||
.replace(/\./g, "")
|
||||
.replace("$#$", ".");
|
||||
if (checkPlan.indexOf(".") < 0 && checkPlan !== "") {
|
||||
// 以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
|
||||
checkPlan = parseFloat(checkPlan) + "";
|
||||
} else if (checkPlan.indexOf(".") >= 0) {
|
||||
checkPlan = checkPlan.replace(/^()*(\d+)\.(\d\d).*$/, "$1$2.$3"); // 只能输入两个小数
|
||||
}
|
||||
this.form.maxValue = checkPlan;
|
||||
},
|
||||
/** 查询检测项目结果列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listProjectresult(this.queryParams).then(response => {
|
||||
listProjectresult(this.queryParams).then((response) => {
|
||||
this.projectresultList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
@ -563,7 +604,7 @@ export default {
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
updateTime: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -579,9 +620,9 @@ export default {
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
@ -592,8 +633,8 @@ export default {
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getProjectresult(id).then(response => {
|
||||
const id = row.id || this.ids;
|
||||
getProjectresult(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改检测项目结果";
|
||||
@ -601,16 +642,16 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateProjectresult(this.form).then(response => {
|
||||
updateProjectresult(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addProjectresult(this.form).then(response => {
|
||||
addProjectresult(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
@ -622,19 +663,27 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除检测项目结果编号为"' + ids + '"的数据项?').then(function() {
|
||||
this.$modal
|
||||
.confirm('是否确认删除检测项目结果编号为"' + ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delProjectresult(ids);
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('manage/projectresult/export', {
|
||||
...this.queryParams
|
||||
}, `projectresult_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
this.download(
|
||||
"manage/projectresult/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`projectresult_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user