Browse Source

rerange

master
pengjun 2 years ago
parent
commit
67918dc773
  1. 66
      src/components/itemSet/ReferenceRange.vue

66
src/components/itemSet/ReferenceRange.vue

@ -34,9 +34,9 @@
</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-row>
<el-row>
<el-col :span="8">
<el-form-item label="性别" prop="forSexId">
<el-select v-model="form.forSexId" placeholder="请选择">
@ -71,15 +71,16 @@
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="onsbmint"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</span>
</el-dialog>
</div>
</template>
<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 { examinationgender } from "@/request/systemapi";
// import
@ -145,7 +146,9 @@ export default {
this.getlist(this.itemId, this.ReferenceRangeTypeFlag);
this.addtoedit()
},
computed: {
...mapState(['itemSet'])
},
methods: {
getlist(itemId, ReferenceRangeTypeFlag) {
//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
},
//
addtoedit() {
addtoedit() {
//
examinationgender().then((res) => {
this.forSexId = res.data;
@ -182,38 +185,61 @@ export default {
},
//
edit() {
this.dialogVisible = true;
edit() {
if (!this.id) {
alert("请先选中要编辑的记录")
return
}
this.dialogVisible = true;
},
del() {
this.$message.success("删除操作");
//this.$message.success("");
if (!this.id) {
alert("请先选中要删除的记录")
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() {
this.$refs.form.validate((v) => {
this.$refs['form'].validate((v) => {
if (v) {
if (this.title == 1) {
if (!this.id) {
postapi("/api/app/reference-range", this.form).then((res) => {
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.getlist()
this.dialogVisible = false
this.getlist(this.itemId, this.ReferenceRangeTypeFlag);
})
}
}
});
},
},
//

Loading…
Cancel
Save