Commit f0416997 authored by 盖献康's avatar 盖献康

检查管理-检查项目(查询和删除)

parent 69aa3746
import request from '@/utils/request' import request from '@/utils/request'
// 查询治疗/检查项目管理列表 // 查询治疗/检查项目管理列表
export function listManage(query) { export function listItem(query) {
return request({ return request({
url: '/business/item/list', url: '/business/item/list',
method: 'get', method: 'get',
...@@ -10,7 +10,7 @@ export function listManage(query) { ...@@ -10,7 +10,7 @@ export function listManage(query) {
} }
// 查询治疗/检查项目管理详细 // 查询治疗/检查项目管理详细
export function getManage(id) { export function getItem(id) {
return request({ return request({
url: '/business/item/' + id, url: '/business/item/' + id,
method: 'get' method: 'get'
...@@ -18,7 +18,7 @@ export function getManage(id) { ...@@ -18,7 +18,7 @@ export function getManage(id) {
} }
// 新增治疗/检查项目管理 // 新增治疗/检查项目管理
export function addManage(data) { export function addItem(data) {
return request({ return request({
url: '/business/item', url: '/business/item',
method: 'post', method: 'post',
...@@ -27,7 +27,7 @@ export function addManage(data) { ...@@ -27,7 +27,7 @@ export function addManage(data) {
} }
// 修改治疗/检查项目管理 // 修改治疗/检查项目管理
export function updateManage(data) { export function updateItem(data) {
return request({ return request({
url: '/business/item', url: '/business/item',
method: 'put', method: 'put',
...@@ -36,7 +36,7 @@ export function updateManage(data) { ...@@ -36,7 +36,7 @@ export function updateManage(data) {
} }
// 删除治疗/检查项目管理 // 删除治疗/检查项目管理
export function delManage(id) { export function delItem(id) {
return request({ return request({
url: '/business/item/' + id, url: '/business/item/' + id,
method: 'delete' method: 'delete'
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
placeholder="请选择检查类型" placeholder="请选择检查类型"
> >
<el-option <el-option
v-for="items in statusOptions" v-for="items in dict.type.exam_type"
:key="items.value" :key="items.value"
:label="items.label" :label="items.label"
:value="items.value" :value="items.value"
...@@ -96,16 +96,16 @@ ...@@ -96,16 +96,16 @@
label="支持保险支付:" label="支持保险支付:"
:prop="'settingList.'+index+'.supportInsure'" :prop="'settingList.'+index+'.supportInsure'"
:rules="[ :rules="[
{ required: true, message: '请选择是否支保险支付', trigger: 'change' } { required: true, message: '请选择是否支保险支付', trigger: 'change' }
]" ]"
> >
<el-select <el-select
v-model="item.supportInsure" v-model="item.supportInsure"
style="width: 100%" style="width: 100%"
placeholder="请选择是否支保险支付" placeholder="请选择是否支保险支付"
> >
<el-option <el-option
v-for="items in statusOptions" v-for="items in insuranceOptions"
:key="items.value" :key="items.value"
:label="items.label" :label="items.label"
:value="items.value" :value="items.value"
...@@ -187,8 +187,11 @@ ...@@ -187,8 +187,11 @@
<script> <script>
import { listItem, updateItem } from '@/api/business/item'
export default { export default {
name: 'CheckItem', name: 'CheckItem',
dicts: ['exam_type'],
data() { data() {
return { return {
// 表单内容 // 表单内容
...@@ -200,7 +203,7 @@ export default { ...@@ -200,7 +203,7 @@ export default {
price: '', price: '',
supportInsure: '', supportInsure: '',
sort: '', sort: '',
status: '0', status: '1',
content: '' content: ''
} }
] ]
...@@ -209,14 +212,40 @@ export default { ...@@ -209,14 +212,40 @@ export default {
rules: {}, rules: {},
// 检查类型 // 检查类型
statusOptions: [ statusOptions: [
{ value: '0', label: '已启用' }, { value: '1', label: '已启用' },
{ value: '1', label: '已禁用' } { value: '0', label: '已禁用' }
],
// 支持保险
insuranceOptions: [
{ value: '1', label: '是' },
{ value: '0', label: '否' }
] ]
} }
}, },
created() {
this.getList()
},
methods: { methods: {
/** 获取数据 */ /** 获取数据 */
getList() { getList() {
listItem().then(response => {
if (response.code === 200) {
console.log('aaa', response)
if (response.rows.length > 0) {
this.form.settingList = response.rows
} else {
this.form.settingList = [{
name: '',
type: '',
price: '',
supportInsure: '',
sort: '',
status: '1',
content: ''
}]
}
}
})
}, },
/** 将阿拉伯数字转成汉字(如:1变成一)*/ /** 将阿拉伯数字转成汉字(如:1变成一)*/
convertToChineseNumeral(num) { convertToChineseNumeral(num) {
...@@ -264,11 +293,14 @@ export default { ...@@ -264,11 +293,14 @@ export default {
cancelButtonClass: 'resetBtn', cancelButtonClass: 'resetBtn',
confirmButtonClass: 'queryBtn' confirmButtonClass: 'queryBtn'
}).then(function() { }).then(function() {
return 1 console.log('item.id', item.id)
return updateItem({ id: item.id, delFlag: '2' })
}).then(() => { }).then(() => {
this.getList() this.getList()
this.$refs['form'].resetFields()
this.$modal.msgSuccess('删除成功') this.$modal.msgSuccess('删除成功')
}).catch(() => {}) }).catch(() => {
})
} else { } else {
this.$confirm('是否确认删除该项目', '提示', { this.$confirm('是否确认删除该项目', '提示', {
type: 'warning', type: 'warning',
...@@ -290,7 +322,7 @@ export default { ...@@ -290,7 +322,7 @@ export default {
price: '', price: '',
supportInsure: '', supportInsure: '',
sort: '', sort: '',
status: '0', status: '1',
content: '' content: ''
}) })
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment