|
|
@ -34,9 +34,9 @@ |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- 新增或者编辑弹框 --> |
|
|
<!-- 新增或者编辑弹框 --> |
|
|
<el-dialog :title="id ? '编辑':'新增'" :visible.sync="dialogVisible" width="70%"> |
|
|
|
|
|
|
|
|
<el-dialog :title="id ? '编辑' : '新增'" :visible.sync="dialogVisible" width="70%" :append-to-body="true"> |
|
|
<el-form ref="form" :model="form" label-width="100px" :rules="rules"> |
|
|
<el-form ref="form" :model="form" label-width="100px" :rules="rules"> |
|
|
<el-row> |
|
|
|
|
|
|
|
|
<el-row> |
|
|
<el-col :span="8"> |
|
|
<el-col :span="8"> |
|
|
<el-form-item label="性别" prop="forSexId"> |
|
|
<el-form-item label="性别" prop="forSexId"> |
|
|
<el-select v-model="form.forSexId" placeholder="请选择"> |
|
|
<el-select v-model="form.forSexId" placeholder="请选择"> |
|
|
@ -71,15 +71,16 @@ |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<span slot="footer" class="dialog-footer"> |
|
|
<span slot="footer" class="dialog-footer"> |
|
|
<el-button @click="dialogVisible = false">取 消</el-button> |
|
|
|
|
|
<el-button type="primary" @click="onsbmint">确 定</el-button> |
|
|
<el-button type="primary" @click="onsbmint">确 定</el-button> |
|
|
|
|
|
<el-button @click="dialogVisible = false">关 闭</el-button> |
|
|
</span> |
|
|
</span> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { getapi, postapi, putapi } from "@/api/api"; |
|
|
|
|
|
|
|
|
import { mapState } from "vuex"; |
|
|
|
|
|
import { getapi, postapi, putapi,deletapi } from "@/api/api"; |
|
|
import { referencerangelist, getporjectlists } from "@/request/commonapi"; |
|
|
import { referencerangelist, getporjectlists } from "@/request/commonapi"; |
|
|
import { examinationgender } from "@/request/systemapi"; |
|
|
import { examinationgender } from "@/request/systemapi"; |
|
|
// import |
|
|
// import |
|
|
@ -145,7 +146,9 @@ export default { |
|
|
this.getlist(this.itemId, this.ReferenceRangeTypeFlag); |
|
|
this.getlist(this.itemId, this.ReferenceRangeTypeFlag); |
|
|
this.addtoedit() |
|
|
this.addtoedit() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
computed: { |
|
|
|
|
|
...mapState(['itemSet']) |
|
|
|
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
getlist(itemId, ReferenceRangeTypeFlag) { |
|
|
getlist(itemId, ReferenceRangeTypeFlag) { |
|
|
//http://81.70.217.145:9529/api/app/reference-range/in-type/3a0bcedc-328c-9322-e75d-343c3ce557fb?ReferenceRangeTypeFlag=1 |
|
|
//http://81.70.217.145:9529/api/app/reference-range/in-type/3a0bcedc-328c-9322-e75d-343c3ce557fb?ReferenceRangeTypeFlag=1 |
|
|
@ -159,11 +162,11 @@ export default { |
|
|
this.form = row |
|
|
this.form = row |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 新增或者编辑需要的类别 |
|
|
// 新增或者编辑需要的类别 |
|
|
addtoedit() { |
|
|
|
|
|
|
|
|
addtoedit() { |
|
|
//性别 |
|
|
//性别 |
|
|
examinationgender().then((res) => { |
|
|
examinationgender().then((res) => { |
|
|
this.forSexId = res.data; |
|
|
this.forSexId = res.data; |
|
|
@ -182,38 +185,61 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//编辑弹框 |
|
|
//编辑弹框 |
|
|
edit() { |
|
|
|
|
|
this.dialogVisible = true; |
|
|
|
|
|
|
|
|
edit() { |
|
|
|
|
|
if (!this.id) { |
|
|
|
|
|
alert("请先选中要编辑的记录") |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.dialogVisible = true; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
del() { |
|
|
del() { |
|
|
this.$message.success("删除操作"); |
|
|
|
|
|
|
|
|
//this.$message.success("删除操作"); |
|
|
if (!this.id) { |
|
|
if (!this.id) { |
|
|
alert("请先选中要删除的记录") |
|
|
alert("请先选中要删除的记录") |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
deletapi(`/api/app/reference-range/${this.id}`, this.form).then(res => { |
|
|
|
|
|
this.$message.success('删除成功') |
|
|
|
|
|
this.getlist(this.itemId, this.ReferenceRangeTypeFlag) |
|
|
|
|
|
this.id = '' |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
type: 'info', |
|
|
|
|
|
message: '已取消删除' |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//确定新增或者编辑 |
|
|
//确定新增或者编辑 |
|
|
onsbmint() { |
|
|
onsbmint() { |
|
|
this.$refs.form.validate((v) => { |
|
|
|
|
|
|
|
|
this.$refs['form'].validate((v) => { |
|
|
if (v) { |
|
|
if (v) { |
|
|
if (this.title == 1) { |
|
|
|
|
|
|
|
|
if (!this.id) { |
|
|
postapi("/api/app/reference-range", this.form).then((res) => { |
|
|
postapi("/api/app/reference-range", this.form).then((res) => { |
|
|
this.$message.success("新增成功"); |
|
|
this.$message.success("新增成功"); |
|
|
this.getlist(); |
|
|
|
|
|
this.dialogVisible = false; |
|
|
|
|
|
|
|
|
this.getlist(this.itemId, this.ReferenceRangeTypeFlag); |
|
|
|
|
|
console.log('res',res) |
|
|
|
|
|
this.id = res.data.id; |
|
|
}); |
|
|
}); |
|
|
} else if (this.title == 2) { |
|
|
|
|
|
putapi(`/api/app/reference-range/${this.form.id}`, this.form).then(res => { |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
putapi(`/api/app/reference-range/${this.id}`, this.form).then(res => { |
|
|
this.$message.success('修改成功') |
|
|
this.$message.success('修改成功') |
|
|
this.getlist() |
|
|
|
|
|
this.dialogVisible = false |
|
|
|
|
|
|
|
|
this.getlist(this.itemId, this.ReferenceRangeTypeFlag); |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//监听事件 |
|
|
//监听事件 |
|
|
|