|
@@ -47,16 +47,16 @@
|
|
|
<el-form ref="addAdviceForm" :model="addAdviceForm" :rules="addAdviceRules" label-width="80px">
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="医嘱类型" prop="type">
|
|
|
- <el-select v-model="addAdviceForm.type" placeholder="医嘱类型" clearable>
|
|
|
+ <el-form-item :label="this.$t('adviceManage.adviceType')" prop="type">
|
|
|
+ <el-select v-model="addAdviceForm.type" :placeholder="this.$t('adviceManage.adviceType')" clearable>
|
|
|
<el-option v-for="(item, index) in Object.keys(adviceTypeEnum)" :key="index" :label="adviceTypeEnum[item]" :value="item" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="状态" prop="status">
|
|
|
- <el-radio v-model="addAdviceForm.status" :label="0">失效</el-radio>
|
|
|
- <el-radio v-model="addAdviceForm.status" :label="1">生效</el-radio>
|
|
|
+ <el-form-item :label="this.$t('adviceManage.adviceStatus')" prop="status">
|
|
|
+ <el-radio v-model="addAdviceForm.status" :label="0">{{ this.$t('adviceManage.loseEfficacy') }}</el-radio>
|
|
|
+ <el-radio v-model="addAdviceForm.status" :label="1">{{ this.$t('adviceManage.takeEffect') }}</el-radio>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -64,7 +64,7 @@
|
|
|
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="开始时间" prop="start_time">
|
|
|
+ <el-form-item :label="this.$t('action.startTime')" prop="start_time">
|
|
|
<el-date-picker
|
|
|
v-model="addAdviceForm.start_time"
|
|
|
type="date"
|
|
@@ -77,7 +77,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="结束时间" prop="end_time">
|
|
|
+ <el-form-item :label="this.$t('action.endTime')" prop="end_time">
|
|
|
<el-date-picker
|
|
|
v-model="addAdviceForm.end_time"
|
|
|
type="date"
|
|
@@ -93,7 +93,7 @@
|
|
|
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="内容" prop="content">
|
|
|
+ <el-form-item :label="this.$t('action.content')" prop="content">
|
|
|
<el-input
|
|
|
v-model="addAdviceForm.content"
|
|
|
type="textarea"
|
|
@@ -109,14 +109,14 @@
|
|
|
<el-row>
|
|
|
<el-form-item
|
|
|
v-for="(detail, index) in detailForm"
|
|
|
- label="参数"
|
|
|
+ :label="$t('action.param')"
|
|
|
:key="detail.key"
|
|
|
:rules="{
|
|
|
- required: false, message: '参数不能为空', trigger: 'blur'
|
|
|
+ required: false, trigger: 'blur'
|
|
|
}"
|
|
|
>
|
|
|
<el-col :span="8">
|
|
|
- <el-input v-model="detailForm[index].name" placeholder="请输入参数名"></el-input>
|
|
|
+ <el-input v-model="detailForm[index].name" :placeholder="$t('action.inputParamName')"></el-input>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="1">
|
|
@@ -124,13 +124,14 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="8">
|
|
|
- <el-input v-model="detailForm[index].value" placeholder="请输入参数值"></el-input>
|
|
|
+ <el-input v-model="detailForm[index].value" :placeholder="$t('action.inputParamValue')"></el-input>
|
|
|
</el-col>
|
|
|
- <el-button style="margin-left: 20px" @click.prevent="removeDetail(detailForm[index])">删除</el-button>
|
|
|
+ <el-button style="margin-left: 20px" @click.prevent="removeDetail(detailForm[index])" type="danger" plain>
|
|
|
+ {{ $t('action.delete') }}</el-button>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
- <el-button @click="addDetail">新增参数</el-button>
|
|
|
+ <el-button @click="addDetail" type="primary" plain>{{ this.$t('action.addParam') }}</el-button>
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
@@ -233,15 +234,15 @@ export default {
|
|
|
resizable: false,
|
|
|
valueGetter: this.hashValueGetter
|
|
|
},
|
|
|
- {headerName: "医嘱类型", field: 'type', sortable: true, filter: 'agTextColumnFilter',
|
|
|
+ {headerName: this.$t('adviceManage.adviceType'), field: 'type', sortable: true, filter: 'agTextColumnFilter',
|
|
|
valueGetter: this.adviceTypeGetter,
|
|
|
width: 120,
|
|
|
},
|
|
|
- {headerName: "状态", field: 'status', sortable: true, filter: 'agNumberColumnFilter',
|
|
|
+ {headerName: this.$t('adviceManage.adviceStatus'), field: 'status', sortable: true, filter: 'agNumberColumnFilter',
|
|
|
valueGetter: this.adviceStatusGetter,
|
|
|
width: 100,},
|
|
|
{
|
|
|
- headerName: "开始时间",
|
|
|
+ headerName: this.$t('action.startTime'),
|
|
|
field: 'start_time',
|
|
|
sortable: true,
|
|
|
filter: 'agDateColumnFilter',
|
|
@@ -254,7 +255,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- headerName: "结束时间",
|
|
|
+ headerName: this.$t('action.endTime'),
|
|
|
field: 'end_time',
|
|
|
sortable: true,
|
|
|
filter: 'agDateColumnFilter',
|
|
@@ -266,8 +267,8 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- {headerName: "内容", field: 'content', sortable: true, filter: 'agTextColumnFilter'},
|
|
|
- {headerName: "规格", field: 'detail', sortable: true, filter: 'agTextColumnFilter'},
|
|
|
+ {headerName: this.$t('action.content'), field: 'content', sortable: true, filter: 'agTextColumnFilter'},
|
|
|
+ {headerName: this.$t('action.param'), field: 'detail', sortable: true, filter: 'agTextColumnFilter'},
|
|
|
{
|
|
|
headerName: this.$t('action.edit'), field: 'id',
|
|
|
cellRendererFramework: 'ButtonCellRender',
|
|
@@ -473,7 +474,7 @@ export default {
|
|
|
},
|
|
|
/** 添加医嘱事件 **/
|
|
|
handleAdd() {
|
|
|
- this.adviceEditTitle = '新增医嘱'
|
|
|
+ this.adviceEditTitle = this.$t('adviceManage.adviceAdd')
|
|
|
this.dialogAddVisible = true
|
|
|
this.addAdviceForm = {
|
|
|
status: 1,
|
|
@@ -495,7 +496,7 @@ export default {
|
|
|
this.$set(this.addAdviceForm, 'end_time', this.addAdviceForm.end_time * 1000)
|
|
|
}
|
|
|
if (this.addAdviceForm.detail) {
|
|
|
- this.detailForm = this.addAdviceForm.detail
|
|
|
+ this.detailForm = JSON.parse(this.addAdviceForm.detail)
|
|
|
} else {
|
|
|
this.detailForm = [
|
|
|
{
|
|
@@ -514,12 +515,15 @@ export default {
|
|
|
// 判断是否存在参数,如果存在参数,就将值赋给this.addAdviceForm.detail
|
|
|
const detail = []
|
|
|
this.detailForm.forEach(v => {
|
|
|
+ console.log(v)
|
|
|
if (v.name && v.name !== "") {
|
|
|
detail.push(v)
|
|
|
}
|
|
|
})
|
|
|
if (detail.length > 0) {
|
|
|
- this.addAdviceForm.detail = detail
|
|
|
+ this.addAdviceForm.detail = JSON.stringify(detail)
|
|
|
+ } else {
|
|
|
+ this.addAdviceForm.detail = ''
|
|
|
}
|
|
|
if (this.addAdviceForm.start_time) {
|
|
|
this.$set(this.addAdviceForm, 'start_time', this.addAdviceForm.start_time / 1000) // 将毫秒数转换成秒
|