Browse Source

开发医嘱

vothin 2 years ago
parent
commit
93f3c77b16

+ 2 - 2
languages/es.js

@@ -242,11 +242,11 @@ module.exports = {
     addressInputMsg: 'Máximo 50 caracteres',
     homeAddress: 'Dirección de casa',
     inputHomeAddress: 'Ingrese la dirección de su casa',
-    disabledClerk: '¿Está seguro de que desea deshabilitar a este usuario?',
+    disableClerk: '¿Está seguro de que desea deshabilitar a este usuario?',
     disabled: '¡Deshabilitado!',
     disableCancel: 'Deshabilitado',
     deleteMember: '¿Está seguro de que desea eliminar esta información de usuario?',
-    cantDeleteAdmin: 'No se puede eliminar al responsable de la organización'
+    cannotDeleteAdmin: 'No se puede eliminar al responsable de la organización'
   },
   home: {
     todayTask: 'Tarea de hoy',

+ 1 - 1
languages/ru-RU.js

@@ -36,7 +36,7 @@ module.exports = {
     allDelete: 'Вы уверены, что хотите удалить?',
     allDeleteSuccess: 'Удаление успешно! ',
     cancelDelete: 'Удаление было отменено',
-    PleaseChoiceDelete: 'Пожалуйста, выберите данные для удаления',
+    pleaseChoiceDelete: 'Пожалуйста, выберите данные для удаления',
     noChoice: 'Не выбрано ни одной записи!',
     fromError: 'Форма заполнена неправильно, проверьте! ',
     notSpace: ', не может начинаться с пробела',

+ 4 - 0
languages/zh-CN.js

@@ -520,6 +520,9 @@ module.exports = {
     logTime: '测量时间',
     company: '单位'
   },
+  adviceManage: {
+    adviceEdit: '医嘱编辑',
+  },
   watch: {
     deviceKeywords: '请输入设备别名或设备标识码',
     dateKeywords: '选择日期进行搜索',
@@ -945,6 +948,7 @@ module.exports = {
     patientManage: '入住人员管理',
     customerManage: '用户管理',
     customerQrCode: '用户二维码',
+    customerAdvice: '医嘱',
     mobileDeviceManage: '移动设备',
     userLocationManage: '用户位置',
     sosDeviceSettingManage: '报警设备',

+ 46 - 0
src/api/ncs_advice.js

@@ -0,0 +1,46 @@
+import request from '@/utils/request'
+
+/**
+ * 医嘱相关接口
+ * @param params
+ * @returns {*|Promise|Promise<unknown>}
+ */
+export function getList(params) {
+  return request({
+    url: '/ncs/advice/page',
+    method: 'POST',
+    loading: true,
+    data: params,
+    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
+  })
+}
+
+/** 新增医嘱 */
+export function add(params) {
+  return request({
+    url: '/ncs/advice',
+    method: 'POST',
+    loading: true,
+    data: params
+  })
+}
+
+/** 删除医嘱 */
+export function remove(params) {
+  const ids = params.toString()
+  return request({
+    url: `/ncs/advice/${ids}`,
+    method: 'DELETE',
+    loading: true,
+    data: params
+  })
+}
+
+/** 更新医嘱 */
+export function update(id, params) {
+  return request({
+    url: `/ncs/advice/${id}`,
+    method: 'put',
+    data: params
+  })
+}

+ 7 - 0
src/router/index.js

@@ -176,6 +176,13 @@ export const partRoutes = [
         name: 'allMap',
         meta: { title: '用户分布', icon: 'area', noCache: true },
         hidden: true
+      },
+      {
+        path: '/advice/:id?',
+        component: () => import('@/views/ncs_advice/index'),
+        name: 'advice',
+        meta: { title: i18n.t('tab.customerAdvice'), icon: 'area', noCache: true },
+        hidden: true
       }
     ]
   },

+ 9 - 0
src/utils/enum/AdviceStatusTypeEnum.js

@@ -0,0 +1,9 @@
+import createEnum from '@/utils/enum/createEnum'
+import i18n from '@/utils/i18n'
+
+export const ADVICE_STATUS_TYPE = createEnum(
+  {
+    LOSE_EFFICACY: [0, '失效'],
+    TAKE_EFFECT: [1, '生效']
+  }
+)

+ 9 - 0
src/utils/enum/AdviceTypeEnym.js

@@ -0,0 +1,9 @@
+import createEnum from '@/utils/enum/createEnum'
+import i18n from '@/utils/i18n'
+
+export const ADVICE_TYPE = createEnum(
+  {
+    LONG_TERM: ['LONG_TERM', '长期'],
+    TEMP: ['TEMP', '临时']
+  }
+)

+ 43 - 24
src/views/customer/components/patientManager.vue

@@ -367,26 +367,26 @@
                     <div style="height: 450px;display: flex;flex-direction: column;">
                         <div style="height: 350px;overflow-y: auto;box-sizing:border-box;box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);margin:5px -10px">
                             <el-card v-for="(item, index) in remarks" :key="index" style="margin-bottom: 10px">
-                                <div>
-                                    <span style="margin-left: 20px;font-weight:bold">{{ customerRemarks }}</span><span
-                                        style="line-height:1.5">{{ item.content }}</span>
-                                </div>
-                                <div style="margin: 10px">
-                                    <div style="float: left">
-                    <span v-if="item.file_name">
-                      <el-link :href="item.file_path" icon="el-icon-folder" type="success" target="_blank"
-                               :download="item.file_name">{{ item.file_name }}</el-link>
-                    </span>
-                                    </div>
-                                    <div style="float: right">
-                                        <p>
-                                            <span style="font-weight:bold">{{ customerRemarkTime }}</span>{{ item.create_time |
-                                            unixDateFilter }}
-                                            <span style="font-weight:bold;margin-left: 10px;">{{ customerRemarkName }}</span>{{
-                                            item.create_name }}
-                                        </p>
-                                    </div>
+                              <div>
+                                  <span style="margin-left: 20px;font-weight:bold">{{ customerRemarks }}</span><span
+                                      style="line-height:1.5">{{ item.content }}</span>
+                              </div>
+                              <div style="margin: 10px">
+                                <div style="float: left">
+                                  <span v-if="item.file_name">
+                                    <el-link :href="item.file_path" icon="el-icon-folder" type="success" target="_blank"
+                                             :download="item.file_name">{{ item.file_name }}</el-link>
+                                  </span>
                                 </div>
+                                  <div style="float: right">
+                                    <p>
+                                      <span style="font-weight:bold">{{ customerRemarkTime }}</span>{{ item.create_time |
+                                      unixDateFilter }}
+                                      <span style="font-weight:bold;margin-left: 10px;">{{ customerRemarkName }}</span>{{
+                                      item.create_name }}
+                                    </p>
+                                  </div>
+                              </div>
                             </el-card>
 
                         </div>
@@ -436,6 +436,14 @@
                 <my-map-html :map-url="mapUrl" style="width: 100%; height: 670px;"></my-map-html>
               </el-tab-pane>
 
+              <el-tab-pane v-if="formmodel.id" :label="this.$t('customerManage.fee')" name="customer-fee">
+                <customer-fee :customer-id="formmodel.id" :active-name="'customer_fee'"/>
+              </el-tab-pane>
+
+              <el-tab-pane v-if="formmodel.id" :label="this.$t('customerManage.advice')" name="customer-advice">
+                <advice :customer-id="formmodel.id" :part-id="formmodel.part_id" :active-name="'customer_advice'"/>
+              </el-tab-pane>
+
 <!--                <el-tab-pane  :label="this.$t('sleepData.SleepData')" name="sleepData">-->
 <!--                  <sleep-detect-data :member-id="formmodel.member_id"></sleep-detect-data>-->
 <!--                </el-tab-pane>-->
@@ -531,6 +539,8 @@
     import * as API_NurseConfig from '@/api/ncs_nurse_config'
     import * as API_CustomerMapping from "@/api/ncs_customer_mapping";
     import vitalSignLog from '@/views/vital-sign/log'
+    import customerFee from '@/views/ncs_fee/index'
+    import advice from '@/views/ncs_advice/index'
     import vueQr from "vue-qr";
     import {FRAME_TYPE} from "@/utils/enum/FrameTypeEnum";
     import * as API_SystemConfig from "@/api/ncs_systemconfig";
@@ -544,7 +554,7 @@
     const serverUrl = domain.serverUrl
     export default {
         name: 'PatientManager',
-        components: {SleepDetectData, ButtonCellRenderList, ButtonCellRender, ListFilter, RadioFilter, vitalSignLog, vueQr, myMapHtml },
+        components: { ButtonCellRenderList, ButtonCellRender, ListFilter, RadioFilter, vitalSignLog, vueQr, myMapHtml, customerFee, advice },
         filters: {
             unixDateFilter(val) {
                 return unixToDate(val)
@@ -925,13 +935,20 @@
                         buttonType: 'success',
                         buttonSize: 'mini',
                         disabled: param.data['status'] !== 0
-                      },{
+                      },
+                      {
                         onClick: this.deleteSingle,
                         label: this.$t('action.delete'),
                         buttonType: 'danger',
                         buttonSize: 'mini',
                         disabled: param.data['member_name'] === 'superadmin'
-                      }
+                      },
+                      // {
+                      //   onClick: this.advice,
+                      //   label: this.$t('customerManage.advice'),
+                      //   buttonType: 'primary',
+                      //   buttonSize: 'mini',
+                      // },
                     ]}
                 },
                 filter: false,
@@ -1566,7 +1583,6 @@
                     const groupData = groupBy(res, item => item.role_id)
                     if (Object.entries(groupData).length > 0) {
                         Object.entries(groupData).forEach(item => {
-                          console.log(item[0])
                             if (item[0] === '2') {
                                 _this.doctors = item[1]
                             } else if (item[0] === '3') {
@@ -1727,7 +1743,10 @@
             if (index != null) {
               this.deleteNurseConfig.splice(index, index + 1)
             }
-          }
+          },
+          advice(row) {
+            this.$router.push({ name: 'advice', params: { id: row.id, callback: this.getList() }})
+          },
         }
     }
 </script>

+ 0 - 1
src/views/ncs-device/deviceInfo.vue

@@ -111,7 +111,6 @@ export default {
   mounted() {
     this.GET_List()
     console.log('frame=', this.frame)
-    console.log(this.frameId)
   },
   methods: {
     formatterDeviceType(row, column, cellValue) {

+ 578 - 0
src/views/ncs_advice/index.vue

@@ -0,0 +1,578 @@
+<template>
+  <div>
+    <ag-grid-layout
+        toolbar
+        theme="ag-theme-alpine"
+        :column-defs="columnDefs"
+        :row-data="rowData"
+        :locale-text="localeText"
+        :grid-options="gridOptions"
+        :debounce-vertical-scrollbar="true"
+        :default-col-def="defaultColDef"
+        :animate-rows="true"
+        :row-selection="rowSelection"
+        :framework-components="frameworkComponents"
+        @filterChanged="filterModifed"
+        @sortChanged="gridSortChange"
+    >
+      <div slot="toolbar" class="inner-toolbar">
+        <div class="toolbar-search">
+          <en-table-search :placeholder="this.$t('action.keywords')" @search="handlerSearch" />
+        </div>
+
+        <div class="toolbar-btns">
+          <el-button type="primary" size="mini" @click="handleAdd">{{ this.$t('action.add') }}</el-button>
+          <el-button type="danger" size="mini" @click="batchDelete">{{ this.$t('action.deleteList') }}</el-button>
+        </div>
+      </div>
+
+      <el-pagination
+          v-if="pageData"
+          slot="pagination"
+          :current-page="pageData.page_no"
+          :page-sizes="[10, 20, 50, 100]"
+          :page-size="pageData.page_size"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="pageData.data_total"
+          @size-change="handlePageSizeChange"
+          @current-change="handlePageCurrentChange"
+      />
+    </ag-grid-layout>
+
+    <!--添加医嘱 dialog-->
+    <el-dialog :title="adviceEditTitle" :visible.sync="dialogAddVisible"
+               width="50%" :close-on-click-modal="false" :close-on-press-escape="false"
+               append-to-body
+    >
+      <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-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>
+          </el-col>
+        </el-row>
+
+
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="开始时间" prop="start_time">
+              <el-date-picker
+                  v-model="addAdviceForm.start_time"
+                  type="date"
+                  :editable="false"
+                  value-format="timestamp"
+                  :default-value="new Date()"
+                  :placeholder="this.$t('customerManage.choiceDate')"
+                  :picker-options="{disabledDate(time) { return time.getTime() > Date.now() }}"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="结束时间" prop="end_time">
+              <el-date-picker
+                  v-model="addAdviceForm.end_time"
+                  type="date"
+                  :editable="false"
+                  value-format="timestamp"
+                  :default-value="new Date()"
+                  :placeholder="this.$t('customerManage.choiceDate')"
+                  :picker-options="{disabledDate(time) { return time.getTime() > Date.now() }}"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="内容" prop="content">
+              <el-input
+                  v-model="addAdviceForm.content"
+                  type="textarea"
+                  :autosize="{ minRows: 2, maxRows: 4}"
+                  :minlength="2"
+                  :maxlength="50"
+                  :placeholder="this.$t('customerManage.inputAdvice')"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-form-item
+            v-for="(detail, index) in detailForm"
+            label="参数"
+            :key="detail.key"
+            :rules="{
+              required: false, message: '参数不能为空', trigger: 'blur'
+            }"
+          >
+            <el-col :span="8">
+              <el-input v-model="detailForm[index].name" placeholder="请输入参数名"></el-input>
+            </el-col>
+
+            <el-col :span="1">
+              <span style="margin-left: 10px">-</span>
+            </el-col>
+
+            <el-col :span="8">
+              <el-input v-model="detailForm[index].value" placeholder="请输入参数值"></el-input>
+            </el-col>
+            <el-button style="margin-left: 20px" @click.prevent="removeDetail(detailForm[index])">删除</el-button>
+          </el-form-item>
+
+          <el-form-item>
+            <el-button @click="addDetail">新增参数</el-button>
+          </el-form-item>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogAddVisible = false">{{ this.$t('action.cancel') }}</el-button>
+        <el-button type="primary" @click="handlerFormSubmit('addAdviceForm')">{{ this.$t('action.yes') }}</el-button>
+      </div>
+    </el-dialog>
+  </div>
+
+</template>
+
+<script>
+import {AG_GRID_LOCALE_CN} from "@/utils/AgGridVueLocaleCn";
+import * as API_Advice from "@/api/ncs_advice";
+import {unix2Date, unixToDate} from "@/utils/Foundation";
+import ButtonCellRender from "@/components/AgGridCellRender/ButtonCellRender";
+import ListFilter from "@/components/AgGridCustomFilter/ListFilter";
+import RadioFilter from "@/components/AgGridCustomFilter/RadioFilter";
+import {ADVICE_TYPE} from "@/utils/enum/AdviceTypeEnym";
+import {ADVICE_STATUS_TYPE} from "@/utils/enum/AdviceStatusTypeEnum";
+
+export default {
+  name: "Advice",
+  components: {ButtonCellRender, ListFilter, RadioFilter},
+  props: {
+    customerId: {
+      type: Number,
+      default: null
+    },
+    partId: {
+      type: Number,
+      default: null
+    },
+    activeName: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      /** ag-grid参数 **/
+      pageData: {}, // 翻页数据
+      errorId: null,
+      shopVisible: false,
+      columnDefs: null,
+      rowData: [],
+      defaultColDef: null,
+      gridOptions: null,
+      gridApi: null,
+      columnApi: null,
+      localeText: AG_GRID_LOCALE_CN,
+      filterState: null,
+      rowSelection: null,
+      frameworkComponents: null,
+      adviceEditTitle: this.$t('adviceManage.adviceEdit'),
+      /** 添加会员弹出框指示 */
+      dialogAddVisible: false,
+      /** 添加医嘱 表单数据 */
+      addAdviceForm: {},
+      /** 添加医嘱 表单规则 */
+      addAdviceRules: {
+        type: [
+          { required: true, message: '', trigger: 'blur' }
+        ],
+        content: [
+          { required: true, message: '', trigger: 'blur' }
+        ]
+      },
+      detailForm: [
+        {
+          name: '',
+          value: ''
+        }
+      ],
+      /** 列表参数 */
+      params: {
+        page_size: 20,
+        page_no: 1,
+        fixedCondition: ' customer_id = ' + this.customerId,
+        sort: 'id',
+        dir: 'desc'
+      },
+      adviceTypeEnum: ADVICE_TYPE.getValueList(),
+    }
+  },
+  computed: {
+  },
+  watch: {},
+  beforeMount() {
+    this.gridOptions = {}
+    this.columnDefs = [
+      {
+        headerName: '#',
+        headerCheckboxSelection: true,
+        headerCheckboxSelectionFilteredOnly: true,
+        checkboxSelection: true,
+        sortable: false, filter: false,
+        width: 80,
+        resizable: false,
+        valueGetter: this.hashValueGetter
+      },
+      {headerName: "医嘱类型", field: 'type', sortable: true, filter: 'agTextColumnFilter',
+        valueGetter: this.adviceTypeGetter,
+        width: 120,
+      },
+      {headerName: "状态", field: 'status', sortable: true, filter: 'agNumberColumnFilter',
+        valueGetter: this.adviceStatusGetter,
+        width: 100,},
+      {
+        headerName: "开始时间",
+        field: 'start_time',
+        sortable: true,
+        filter: 'agDateColumnFilter',
+        valueFormatter: this.unixDateFormatter,
+        filterParams: {
+          comparator: (filterLocalDateAtMidnight, cellValue) => { // 所有数据都由服务器端过滤,此处只需返回0 即可
+            const celldate = unixToDate(cellValue, 'yyyy-MM-dd')
+            return (new Date(celldate).getTime() / 1000) - (filterLocalDateAtMidnight.getTime() / 1000)
+          }
+        }
+      },
+      {
+        headerName: "结束时间",
+        field: 'end_time',
+        sortable: true,
+        filter: 'agDateColumnFilter',
+        valueFormatter: this.unixDateFormatter,
+        filterParams: {
+          comparator: (filterLocalDateAtMidnight, cellValue) => { // 所有数据都由服务器端过滤,此处只需返回0 即可
+            const celldate = unixToDate(cellValue, 'yyyy-MM-dd')
+            return (new Date(celldate).getTime() / 1000) - (filterLocalDateAtMidnight.getTime() / 1000)
+          }
+        }
+      },
+      {headerName: "内容", field: 'content', sortable: true, filter: 'agTextColumnFilter'},
+      {headerName: "规格", field: 'detail', sortable: true, filter: 'agTextColumnFilter'},
+      {
+        headerName: this.$t('action.edit'), field: 'id',
+        cellRendererFramework: 'ButtonCellRender',
+        cellRendererParams: {
+          onClick: this.handleEdit,
+          label: this.$t('action.edit'),
+          buttonType: 'primary',
+          buttonSize: 'mini'
+        },
+        filter: false,
+        pinned: 'right',
+        lockPinned: true,
+        width: 90,
+        resizable: false,
+        sortable: false
+      },
+      {
+        headerName: this.$t('action.delete'), field: 'id',
+        cellRendererFramework: 'ButtonCellRender',
+        cellRendererParams: param => {
+          return {
+            onClick: this.deleteSingle,
+            label: this.$t('action.delete'),
+            buttonType: 'danger',
+            buttonSize: 'mini',
+            disabled: param.data['member_name'] === 'superadmin'
+          }
+        },
+        pinned: 'right',
+        lockPinned: true,
+        width: 90,
+        resizable: false,
+        filter: false,
+        sortable: false
+      }
+    ]
+    this.defaultColDef = {
+      // filter: 'agTextColumnFilter',
+      sortable: true,
+      resizable: true,
+      enableValue: true,
+      filter: true,
+      // comparator: this.dateCustomComparator,
+      filterParams: {
+        debounceMs: 500,
+        newRowsAction: 'keep',
+        textCustomComparator: this.textCustomComparator
+      }
+    }
+    this.rowSelection = 'multiple'
+  },
+  mounted() {
+    window.onresize = this.windowResize
+    this.gridApi = this.gridOptions.api
+    // this.gridColumnApi = this.gridOptions.columnApi
+    this.getList()
+  },
+  methods: {
+    windowResize() {
+      this.$set(this, 'mainAreaHeight', Number(document.documentElement.clientHeight) - 84)
+    },
+    /** 加载列表数据 */
+    getList() {
+      const param = this.MixinClone(this.params)
+      this.gridApi.showLoadingOverlay()
+      API_Advice.getList(param).then(response => {
+        this.rowData = response.data
+        this.pageData = {
+          page_no: response.page_no,
+          page_size: response.page_size,
+          data_total: response.data_total
+        }
+        this.$nextTick(() => {
+          const node = this.gridApi.getDisplayedRowAtIndex(0)
+          if (node !== null && node !== undefined) {
+            node.setSelected(true)
+          }
+        })
+      })
+    },
+
+    /**
+     * 过滤状态发生变化,发送到服务器检索数据
+     */
+    filterModifed(param) {
+      var model = param.api.getFilterModel()
+      // 连接状态不经过服务器过滤
+      delete model.online_state
+      this.params.filter = JSON.stringify(model)
+      this.getList()
+    },
+    gridSortChange(param) {
+      const columnState = param.columnApi.getColumnState()
+      // 排序状态
+      const sortState = columnState.filter(function (s) {
+        return s.sort != null
+      }).map(function (s) {
+        return {
+          colId: s.colId,
+          sort: s.sort,
+          sortIndex: s.sortIndex
+        }
+      }).sort(function (a, b) {
+        return a.sortIndex - b.sortIndex
+      })
+      if (sortState.length > 0) {
+        if (sortState.length === 1) {
+          this.params.sort = sortState[0].colId
+          this.params.dir = sortState[0].sort
+        } else {
+          let sortstring = ''
+          sortState.forEach(function (item) {
+            sortstring += item.colId + ' ' + item.sort + ','
+          })
+          this.params.sort = sortstring.substring(0, sortstring.length - 1)
+          this.params.dir = ' '
+        }
+      } else {
+        delete this.params.sort
+        delete this.params.dir
+      }
+
+      this.getList()
+    },
+    /** 处理搜索 */
+    handlerSearch(keywords) {
+      this.params.query = keywords
+      this.getList()
+    },
+    /** 格式化时间函数 */
+    unixDateFormatter(param) {
+      if (!param.value) return ''
+      return unix2Date(param.value * 1000, 'yyyy-MM-dd')
+    },
+    /** 分页大小发生改变 */
+    handlePageSizeChange(size) {
+      this.params.page_size = size
+      this.getList()
+    },
+    /** 分页页数发生改变 */
+    handlePageCurrentChange(page) {
+      this.params.page_no = page
+      this.getList()
+    },
+    formatterDate(params) {
+      return unixToDate(params.value)
+    },
+    /** 删除医嘱 **/
+    deleteSingle(row) {
+      this.handlerDelete(row.id)
+    },
+    /** 单条数据删除处理 */
+    handlerDelete(ids) {
+      this.$confirm(this.$t('action.sureDelete'), this.$t('action.waring'), {
+        confirmButtonText: this.$t('action.yes'),
+        cancelButtonText: this.$t('action.cancel'),
+        type: 'warning'
+      }).then(() => {
+        API_Advice.remove(ids).then(
+          response => {
+            this.getList()
+            this.$message({
+              type: 'success',
+              message: this.$t('action.deleted')
+            })
+          }
+        ).catch(response => {
+          this.$message({
+            type: 'info',
+            message: response.message
+          })
+        })
+      }).catch((response) => {
+        this.$message({
+          type: 'info',
+          message: this.$t('action.cancelDelete')
+        })
+      })
+    },
+    /** 批量数据删除处理(删除选中的行) */
+    batchDelete: function() {
+      const rows = this.gridApi.getSelectedRows()
+      if (rows.length === 0) {
+        this.$message({ type: 'info', message: this.$t('action.pleaseChoiceDelete') })
+        return
+      }
+      const ids = []
+      const uids = []
+      let isFounder = 0
+      rows.forEach(function(item) {
+        if (item.founder === 1) {
+          isFounder = 1
+          return
+        }
+        ids.push(item.clerk_id)
+        uids.push(item.member_id)
+      })
+      if (isFounder === 1) {
+        this.$message({ type: 'info', message: this.$t('action.cannotDeleteAdmin') })
+        return
+      }
+      this.handlerDelete(ids.join(','))
+    },
+    /** 添加医嘱事件 **/
+    handleAdd() {
+      this.adviceEditTitle = '新增医嘱'
+      this.dialogAddVisible = true
+      this.addAdviceForm = {
+        status: 1,
+        customer_id: this.customerId,
+        part_id: this.partId
+      }
+    },
+    /** 修改医嘱  **/
+    handleEdit(params) {
+      this.addAdviceForm = {
+        ...params
+      }
+      this.adviceEditTitle = this.$t('adviceManage.adviceEdit')
+      this.dialogAddVisible = true
+      if (this.addAdviceForm.start_time) {
+        this.$set(this.addAdviceForm, 'start_time', this.addAdviceForm.start_time * 1000)
+      }
+      if (this.addAdviceForm.end_time) {
+        this.$set(this.addAdviceForm, 'end_time', this.addAdviceForm.end_time * 1000)
+      }
+      if (this.addAdviceForm.detail) {
+        this.detailForm = this.addAdviceForm.detail
+      } else {
+        this.detailForm = [
+          {
+            name: '',
+            value: ''
+          }
+        ]
+      }
+    },
+    /** 新增 提交表单 */
+    handlerFormSubmit(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          const _this = this
+
+          // 判断是否存在参数,如果存在参数,就将值赋给this.addAdviceForm.detail
+          const detail = []
+          this.detailForm.forEach(v => {
+            if (v.name && v.name !== "") {
+              detail.push(v)
+            }
+          })
+          if (detail.length > 0) {
+            this.addAdviceForm.detail = detail
+          }
+          if (this.addAdviceForm.start_time) {
+            this.$set(this.addAdviceForm, 'start_time', this.addAdviceForm.start_time / 1000) // 将毫秒数转换成秒
+          }
+          if (this.addAdviceForm.end_time) {
+            this.$set(this.addAdviceForm, 'end_time', this.addAdviceForm.end_time / 1000) // 将毫秒数转换成秒
+          }
+          console.log('this.addAdviceForm', this.addAdviceForm)
+          /** 新增 */
+          if (!this.addAdviceForm.id) {
+            API_Advice.add(this.addAdviceForm).then(r => {
+              this.$message.success(this.$t('action.saveSuccess'))
+              this.dialogAddVisible = false
+              this.getList()
+            })
+          } else {
+            /** 修改 */
+            API_Advice.update(this.addAdviceForm.id, this.addAdviceForm).then(() => {
+              this.$message.success(this.$t('action.editSuccess'))
+              this.dialogAddVisible = false
+              this.getList()
+            })
+          }
+        }
+      })
+    },
+    /** 获取医嘱类型模式 */
+    adviceTypeGetter(params) {
+      const gridVal = params.data.type
+      return ADVICE_TYPE.getDescFromValue(gridVal)
+    },
+    adviceStatusGetter(params) {
+      const gridVal = params.data.status
+      return ADVICE_STATUS_TYPE.getDescFromValue(gridVal)
+    },
+    removeDetail(item) {
+      var index = this.detailForm.indexOf(item)
+      if (index !== -1) {
+        this.detailForm.splice(index, 1)
+      }
+    },
+    addDetail() {
+      this.detailForm.push({
+        name: '',
+        value: ''
+      });
+    }
+  }
+}
+</script>
+
+<style scoped>
+.el-input .el-button {
+  margin-left: 120px;
+}
+</style>

+ 6 - 1
src/views/ncs_fee/index.vue

@@ -15,6 +15,12 @@
         @filterChanged="filterModifed"
         @sortChanged="gridSortChange"
     >
+      <div slot="toolbar" class="inner-toolbar">
+        <div class="toolbar-search">
+          <en-table-search :placeholder="this.$t('action.keywords')" @search="handlerSearch" />
+        </div>
+      </div>
+
       <el-pagination
           v-if="pageData"
           slot="pagination"
@@ -96,7 +102,6 @@ export default {
         resizable: false,
         valueGetter: this.hashValueGetter
       },
-      {headerName: 'ID', field: 'id', sortable: true, filter: 'agNumberColumnFilter', width: 100},
       {headerName: this.$t('customerManage.feeName'), field: 'fee_name', sortable: true, filter: 'agTextColumnFilter', width: 100},
       {headerName: this.$t('customerManage.feeValue'), field: 'fee_value', sortable: true, filter: 'agNumberColumnFilter', width: 100},
       {headerName: this.$t('customerManage.feeNumber'), field: 'fee_number', sortable: true, filter: 'agNumberColumnFilter', width: 100},