|
@@ -1,126 +1,190 @@
|
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
- <el-row>
|
|
|
- <el-col :span="24" class="toolbar">
|
|
|
- <el-form :inline="true">
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" @click="addNurseConfig(1,null,1)">添加护理</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <div class="app-container">
|
|
|
+ <!-- <el-row>-->
|
|
|
+ <!-- <el-col :span="24" class="toolbar">-->
|
|
|
+ <!-- <el-form :inline="true">-->
|
|
|
+ <!-- <el-form-item>-->
|
|
|
+
|
|
|
+ <!-- </el-form-item>-->
|
|
|
+ <!-- </el-form>-->
|
|
|
+ <!-- </el-col>-->
|
|
|
+ <!-- </el-row>-->
|
|
|
<el-container :style="{height: tableHeight+'px'}">
|
|
|
|
|
|
- <el-aside width="360px" style="background-color: rgb(238, 241, 246)">
|
|
|
- <el-table :data="tagList1" highlight-current-row v-loading="listLoading" stripe
|
|
|
- @cell-click="tableClick" class="mytable">
|
|
|
- <el-table-column v-if="false" prop="id"></el-table-column>
|
|
|
- <el-table-column prop="config_name" label="护理名"></el-table-column>
|
|
|
+ <el-aside width="300px" style="background-color: rgb(238, 241, 246)">
|
|
|
+ <el-table
|
|
|
+ ref="nurseConfigTable"
|
|
|
+ v-loading="listLoading"
|
|
|
+ :data="tagList1"
|
|
|
+ highlight-current-row
|
|
|
+ :height="tableHeight-40"
|
|
|
+ stripe
|
|
|
+ @row-click="tableClick"
|
|
|
+ >
|
|
|
+ <el-table-column prop="config_name" label="护理名" width="120px" />
|
|
|
<el-table-column
|
|
|
- label=""
|
|
|
- width="180">
|
|
|
+ width="160px"
|
|
|
+ align="right"
|
|
|
+ >
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
+ <el-button type="primary" size="mini" @click="addNurseConfig(1,null,1)">添加护理参数</el-button>
|
|
|
+ </template>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="success" icon="el-icon-circle-plus-outline" circle
|
|
|
- @click.native.prevent="addNurseConfig(scope.$index, scope.row,2)"></el-button>
|
|
|
- <el-button type="primary" icon="el-icon-edit" circle
|
|
|
- @click.native.prevent="updateRow(scope.$index, scope.row, 1)"></el-button>
|
|
|
- <el-button type="danger" icon="el-icon-delete" circle
|
|
|
- @click.native.prevent="deleteRow(scope.$index, scope.row,1)"></el-button>
|
|
|
+ <!-- <el-button-->
|
|
|
+ <!-- type="success"-->
|
|
|
+ <!-- icon="el-icon-circle-plus-outline"-->
|
|
|
+ <!-- circle-->
|
|
|
+ <!-- size="mini"-->
|
|
|
+ <!-- @click.native.prevent="addNurseConfig(scope.$index, scope.row,2)"-->
|
|
|
+ <!-- />-->
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ circle
|
|
|
+ size="mini"
|
|
|
+ @click.native.prevent="updateRow(scope.$index, scope.row, 1)"
|
|
|
+ />
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ circle
|
|
|
+ size="mini"
|
|
|
+ @click.native.prevent="deleteRow(scope.$index, scope.row,1)"
|
|
|
+ />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</el-aside>
|
|
|
<el-main>
|
|
|
- <el-row>
|
|
|
- <el-col>当前选择:<h4>{{pName}}</h4></el-col>
|
|
|
- </el-row>
|
|
|
-<!-- <el-header style="text-align: right; font-size: 12px;height: 30px">当前选择:<h4>{{pName}}</h4></el-header>-->
|
|
|
- <el-table :data="tagList2" highlight-current-row v-loading="listLoading" stripe class="mytable">
|
|
|
- <el-table-column v-if="false" prop="id"></el-table-column>
|
|
|
- <el-table-column prop="option_name" label="护理项名"></el-table-column>
|
|
|
- <el-table-column prop="nursecfg_color" label="颜色标识" width="160" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button :style="'width: 120px;height: 30px;background-color: #'+scope.row.color_rgb" />
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="" width="140">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="primary" icon="el-icon-edit" circle @click.native.prevent="updateRow(scope.$index, scope.row, 2)"></el-button>
|
|
|
- <el-button type="danger" icon="el-icon-delete" circle @click.native.prevent="deleteRow(scope.$index, scope.row,2)"></el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <!-- <el-row>-->
|
|
|
+ <!-- <el-col>当前选择:<h4>{{ pName }}</h4></el-col>-->
|
|
|
+ <!-- </el-row>-->
|
|
|
+ <!-- <!– <el-header style="text-align: right; font-size: 12px;height: 30px">当前选择:<h4>{{pName}}</h4></el-header>–>-->
|
|
|
+ <!-- <el-table v-loading="listLoading" :data="tagList2" highlight-current-row stripe class="mytable">-->
|
|
|
+ <!-- <el-table-column v-if="false" prop="id" />-->
|
|
|
+ <!-- <el-table-column prop="option_name" label="护理项名" />-->
|
|
|
+ <!-- <el-table-column prop="nursecfg_color" label="颜色标识" width="160" align="center">-->
|
|
|
+ <!-- <template slot-scope="scope">-->
|
|
|
+ <!-- <el-button :style="'width: 120px;height: 30px;background-color: #'+scope.row.color_rgb" />-->
|
|
|
+ <!-- </template>-->
|
|
|
+ <!-- </el-table-column>-->
|
|
|
+ <!-- <el-table-column label="" width="140">-->
|
|
|
+ <!-- <template slot-scope="scope">-->
|
|
|
+ <!-- <el-button type="primary" icon="el-icon-edit" circle @click.native.prevent="updateRow(scope.$index, scope.row, 2)" />-->
|
|
|
+ <!-- <el-button type="danger" icon="el-icon-delete" circle @click.native.prevent="deleteRow(scope.$index, scope.row,2)" />-->
|
|
|
+ <!-- </template>-->
|
|
|
+ <!-- </el-table-column>-->
|
|
|
+ <!-- </el-table>-->
|
|
|
+
|
|
|
+ <ag-grid-layout
|
|
|
+ toolbar
|
|
|
+ :table-height="tableHeight-130"
|
|
|
+ theme="ag-theme-alpine"
|
|
|
+ :column-defs="columnDefs"
|
|
|
+ :row-data="tagList2"
|
|
|
+ :locale-text="localeText"
|
|
|
+ :grid-options="gridOptions"
|
|
|
+ :default-col-def="defaultColDef"
|
|
|
+ :animate-rows="true"
|
|
|
+ :row-selection="rowSelection"
|
|
|
+ @filterChanged="filterModifed"
|
|
|
+ @sortChanged="gridSortChange"
|
|
|
+ >
|
|
|
+ <!-- @rowDoubleClicked="getList"-->
|
|
|
+ <div slot="toolbar" class="inner-toolbar">
|
|
|
+ <div class="toolbar-search">
|
|
|
+ <en-table-search placeholder="请输入搜索关键字" @search="handlerSearch" />
|
|
|
+ </div>
|
|
|
+ <div class="toolbar-btns">
|
|
|
+ <el-button type="primary" size="mini" @click="addOption">新增护理项</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>
|
|
|
</el-main>
|
|
|
</el-container>
|
|
|
|
|
|
-<!-- <el-row>-->
|
|
|
-<!-- <el-col :span="8">-->
|
|
|
-<!-- <el-row>-->
|
|
|
-<!-- <el-col :span="24" class="toolbar">-->
|
|
|
-<!-- <el-form :inline="true">-->
|
|
|
-<!-- <el-form-item>-->
|
|
|
-<!-- <el-button type="primary" @click="addNurseConfig(1,null,1)">添加护理</el-button>-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- </el-form>-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- </el-row>-->
|
|
|
-<!-- <el-table :data="tagList1" highlight-current-row v-loading="listLoading" stripe-->
|
|
|
-<!-- @cell-click="tableClick" class="mytable">-->
|
|
|
-<!-- <el-table-column v-if="false" prop="id"></el-table-column>-->
|
|
|
-<!-- <el-table-column prop="config_name" label="护理名"></el-table-column>-->
|
|
|
-<!-- <el-table-column-->
|
|
|
-<!-- label=""-->
|
|
|
-<!-- width="180">-->
|
|
|
-<!-- <template slot-scope="scope">-->
|
|
|
-<!-- <el-button type="success" icon="el-icon-circle-plus-outline" circle-->
|
|
|
-<!-- @click.native.prevent="addNurseConfig(scope.$index, scope.row,2)"></el-button>-->
|
|
|
-<!-- <el-button type="primary" icon="el-icon-edit" circle-->
|
|
|
-<!-- @click.native.prevent="updateRow(scope.$index, scope.row, 1)"></el-button>-->
|
|
|
-<!-- <el-button type="danger" icon="el-icon-delete" circle-->
|
|
|
-<!-- @click.native.prevent="deleteRow(scope.$index, scope.row,1)"></el-button>-->
|
|
|
-<!-- </template>-->
|
|
|
-<!-- </el-table-column>-->
|
|
|
-<!-- </el-table>-->
|
|
|
-<!-- </el-col>-->
|
|
|
+ <!-- <el-row>-->
|
|
|
+ <!-- <el-col :span="8">-->
|
|
|
+ <!-- <el-row>-->
|
|
|
+ <!-- <el-col :span="24" class="toolbar">-->
|
|
|
+ <!-- <el-form :inline="true">-->
|
|
|
+ <!-- <el-form-item>-->
|
|
|
+ <!-- <el-button type="primary" @click="addNurseConfig(1,null,1)">添加护理</el-button>-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
+ <!-- </el-form>-->
|
|
|
+ <!-- </el-col>-->
|
|
|
+ <!-- </el-row>-->
|
|
|
+ <!-- <el-table :data="tagList1" highlight-current-row v-loading="listLoading" stripe-->
|
|
|
+ <!-- @cell-click="tableClick" class="mytable">-->
|
|
|
+ <!-- <el-table-column v-if="false" prop="id"></el-table-column>-->
|
|
|
+ <!-- <el-table-column prop="config_name" label="护理名"></el-table-column>-->
|
|
|
+ <!-- <el-table-column-->
|
|
|
+ <!-- label=""-->
|
|
|
+ <!-- width="180">-->
|
|
|
+ <!-- <template slot-scope="scope">-->
|
|
|
+ <!-- <el-button type="success" icon="el-icon-circle-plus-outline" circle-->
|
|
|
+ <!-- @click.native.prevent="addNurseConfig(scope.$index, scope.row,2)"></el-button>-->
|
|
|
+ <!-- <el-button type="primary" icon="el-icon-edit" circle-->
|
|
|
+ <!-- @click.native.prevent="updateRow(scope.$index, scope.row, 1)"></el-button>-->
|
|
|
+ <!-- <el-button type="danger" icon="el-icon-delete" circle-->
|
|
|
+ <!-- @click.native.prevent="deleteRow(scope.$index, scope.row,1)"></el-button>-->
|
|
|
+ <!-- </template>-->
|
|
|
+ <!-- </el-table-column>-->
|
|
|
+ <!-- </el-table>-->
|
|
|
+ <!-- </el-col>-->
|
|
|
|
|
|
-<!-- <el-col :span="15">-->
|
|
|
-<!-- <el-row>-->
|
|
|
-<!-- <el-col>当前选择:<h4>{{pName}}</h4></el-col>-->
|
|
|
-<!-- </el-row>-->
|
|
|
-<!-- <el-table :data="tagList2" highlight-current-row v-loading="listLoading" stripe class="mytable">-->
|
|
|
-<!-- <el-table-column v-if="false" prop="id"></el-table-column>-->
|
|
|
-<!-- <el-table-column prop="option_name" label="护理项名"></el-table-column>-->
|
|
|
-<!-- <el-table-column prop="nursecfg_color" label="颜色标识" width="160" align="center">-->
|
|
|
-<!-- <template slot-scope="scope">-->
|
|
|
-<!-- <el-button :style="'width: 120px;height: 30px;background-color: #'+scope.row.color_rgb" />-->
|
|
|
-<!-- </template>-->
|
|
|
-<!-- </el-table-column>-->
|
|
|
-<!-- <el-table-column label="" width="140">-->
|
|
|
-<!-- <template slot-scope="scope">-->
|
|
|
-<!-- <el-button type="primary" icon="el-icon-edit" circle @click.native.prevent="updateRow(scope.$index, scope.row, 2)"></el-button>-->
|
|
|
-<!-- <el-button type="danger" icon="el-icon-delete" circle @click.native.prevent="deleteRow(scope.$index, scope.row,2)"></el-button>-->
|
|
|
-<!-- </template>-->
|
|
|
-<!-- </el-table-column>-->
|
|
|
-<!-- </el-table>-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- </el-row>-->
|
|
|
+ <!-- <el-col :span="15">-->
|
|
|
+ <!-- <el-row>-->
|
|
|
+ <!-- <el-col>当前选择:<h4>{{pName}}</h4></el-col>-->
|
|
|
+ <!-- </el-row>-->
|
|
|
+ <!-- <el-table :data="tagList2" highlight-current-row v-loading="listLoading" stripe class="mytable">-->
|
|
|
+ <!-- <el-table-column v-if="false" prop="id"></el-table-column>-->
|
|
|
+ <!-- <el-table-column prop="option_name" label="护理项名"></el-table-column>-->
|
|
|
+ <!-- <el-table-column prop="nursecfg_color" label="颜色标识" width="160" align="center">-->
|
|
|
+ <!-- <template slot-scope="scope">-->
|
|
|
+ <!-- <el-button :style="'width: 120px;height: 30px;background-color: #'+scope.row.color_rgb" />-->
|
|
|
+ <!-- </template>-->
|
|
|
+ <!-- </el-table-column>-->
|
|
|
+ <!-- <el-table-column label="" width="140">-->
|
|
|
+ <!-- <template slot-scope="scope">-->
|
|
|
+ <!-- <el-button type="primary" icon="el-icon-edit" circle @click.native.prevent="updateRow(scope.$index, scope.row, 2)"></el-button>-->
|
|
|
+ <!-- <el-button type="danger" icon="el-icon-delete" circle @click.native.prevent="deleteRow(scope.$index, scope.row,2)"></el-button>-->
|
|
|
+ <!-- </template>-->
|
|
|
+ <!-- </el-table-column>-->
|
|
|
+ <!-- </el-table>-->
|
|
|
+ <!-- </el-col>-->
|
|
|
+ <!-- </el-row>-->
|
|
|
<!--新增护理界面-->
|
|
|
- <el-dialog :title="myTitle" v-model="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false">
|
|
|
- <el-form :model="addForm" label-width="140px" :rules="addFormRules" ref="addForm">
|
|
|
+ <el-dialog v-model="addFormVisible" :title="myTitle" :visible.sync="addFormVisible" :close-on-click-modal="false">
|
|
|
+ <el-form ref="addForm" :model="addForm" label-width="140px" :rules="addFormRules">
|
|
|
<el-form-item label="护理名" prop="config_name">
|
|
|
- <el-input v-model="addForm.config_name" maxlength="12"></el-input>
|
|
|
+ <el-input v-model="addForm.config_name" maxlength="12" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="排序" prop="index_no">
|
|
|
+ <el-input-number v-model="addForm.index_no" :min="1" :max="100" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click.native="addFormVisible = false">取消</el-button>
|
|
|
- <el-button type="primary" @click.native="addSubmit" :loading="addOptionLoading">提交</el-button>
|
|
|
+ <el-button type="primary" :loading="addOptionLoading" @click.native="addSubmit">提交</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!--新增护理项界面-->
|
|
|
- <el-dialog :title="myTitle" v-model="addFormOptionVisible" :visible.sync="addFormOptionVisible" :close-on-click-modal="false">
|
|
|
- <el-form :model="addOptionForm" label-width="140px" :rules="addFormRules" ref="addOptionForm">
|
|
|
+ <el-dialog v-model="addFormOptionVisible" :title="myTitle" :visible.sync="addFormOptionVisible" :close-on-click-modal="false">
|
|
|
+ <el-form ref="addOptionForm" :model="addOptionForm" label-width="140px" :rules="addFormRules">
|
|
|
<el-form-item label="护理项名" prop="option_name">
|
|
|
- <el-input v-model="addOptionForm.option_name" maxlength="12"></el-input>
|
|
|
+ <el-input v-model="addOptionForm.option_name" maxlength="12" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="护理灯颜色">
|
|
|
<colorPicker v-model="addOptionForm.color_rgb" />
|
|
@@ -128,220 +192,406 @@
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click.native="addFormOptionVisible = false">取消</el-button>
|
|
|
- <el-button type="primary" @click.native="addOptionSubmit" :loading="addOptionLoading">提交</el-button>
|
|
|
+ <el-button type="primary" :loading="addOptionLoading" @click.native="addOptionSubmit">提交</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import * as API_NcsNurseConfig from '@/api/ncs_nurse_config'
|
|
|
- import * as API_NcsNurseConfigOption from '@/api/ncs_nurse_config_option'
|
|
|
+import { AG_GRID_LOCALE_CN } from '@/utils/AgGridVueLocaleCn'
|
|
|
+import { unix2Date } from '@/utils/Foundation'
|
|
|
+import ButtonCellRender from '../../components/AgGridCellRender/ButtonCellRender'
|
|
|
+import * as API_NcsNurseConfig from '@/api/ncs_nurse_config'
|
|
|
+import * as API_NcsNurseConfigOption from '@/api/ncs_nurse_config_option'
|
|
|
|
|
|
- export default {
|
|
|
- name: 'ncsNurseConfigList',
|
|
|
- data() {
|
|
|
- return {
|
|
|
- listLoading: false,
|
|
|
- tagList1: [],
|
|
|
- tagList2: [],
|
|
|
- pid: '',
|
|
|
- type: '',
|
|
|
- addForm: {
|
|
|
- config_name: ''
|
|
|
- },
|
|
|
- addFormVisible: false,
|
|
|
- addLoading: false,
|
|
|
- addFormRules: {
|
|
|
- config_name: [
|
|
|
- { required: true, message: '请输入护理名称', trigger: 'blur' }
|
|
|
- ],
|
|
|
- option_name: [
|
|
|
- { required: true, message: '请输入护理项名称', trigger: 'blur' }
|
|
|
- ]
|
|
|
- },
|
|
|
- addFormOptionVisible: false,
|
|
|
- addOptionLoading: false,
|
|
|
- addOptionForm: {
|
|
|
- option_name: '',
|
|
|
- color_rgb: '#000000'
|
|
|
+export default {
|
|
|
+ name: 'NcsNurseConfigList',
|
|
|
+ components: { ButtonCellRender },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ listLoading: false,
|
|
|
+ tagList1: [],
|
|
|
+ tagList2: [],
|
|
|
+ pid: 0,
|
|
|
+ type: '',
|
|
|
+ addForm: {
|
|
|
+ config_name: ''
|
|
|
+ },
|
|
|
+ addFormVisible: false,
|
|
|
+ addLoading: false,
|
|
|
+ addFormRules: {
|
|
|
+ config_name: [
|
|
|
+ { required: true, message: '请输入护理名称', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ option_name: [
|
|
|
+ { required: true, message: '请输入护理项名称', trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ addFormOptionVisible: false,
|
|
|
+ addOptionLoading: false,
|
|
|
+ addOptionForm: {
|
|
|
+ option_name: '',
|
|
|
+ color_rgb: '#000000'
|
|
|
+ },
|
|
|
+ addOredit: '',
|
|
|
+ myTitle: '',
|
|
|
+ shopVisible: false,
|
|
|
+ member_tags: null,
|
|
|
+ params: {
|
|
|
+ page_size: 20,
|
|
|
+ page_no: 1,
|
|
|
+ sort: 'id',
|
|
|
+ dir: 'desc'
|
|
|
+ },
|
|
|
+ partId: this.$store.getters.partId,
|
|
|
+ pName: null,
|
|
|
+ /** ag-grid参数 **/
|
|
|
+ pageData: [],
|
|
|
+ loading: false,
|
|
|
+ errorId: null,
|
|
|
+ columnDefs: null,
|
|
|
+ rowData: null,
|
|
|
+ defaultColDef: null,
|
|
|
+ gridOptions: null,
|
|
|
+ gridApi: null,
|
|
|
+ columnApi: null,
|
|
|
+ localeText: AG_GRID_LOCALE_CN,
|
|
|
+ filterState: null,
|
|
|
+ rowSelection: null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ tableHeight() {
|
|
|
+ return this.mainAreaHeight - 40
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeMount() {
|
|
|
+ this.gridOptions = {
|
|
|
+ }
|
|
|
+ this.columnDefs = [
|
|
|
+ {
|
|
|
+ headerName: '#',
|
|
|
+ headerCheckboxSelection: true,
|
|
|
+ headerCheckboxSelectionFilteredOnly: true,
|
|
|
+ checkboxSelection: true,
|
|
|
+ sortable: false, filter: false,
|
|
|
+ width: 100,
|
|
|
+ resizable: false,
|
|
|
+ valueGetter: this.hashValueGetter
|
|
|
+ },
|
|
|
+ { headerName: 'ID', field: 'id', sortable: true, filter: 'agNumberColumnFilter' },
|
|
|
+ { headerName: '护理项名称', field: 'option_name', sortable: true, flex: 1, filter: 'agTextColumnFilter', filterParams: {
|
|
|
+ debounceMs: 200,
|
|
|
+ newRowsAction: 'keep'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // lockPosition 锁定位置,会在第一列
|
|
|
+ // lockPinned = true 不能拖动然后固定
|
|
|
+ // resizeable 单元个大小是否可以调整
|
|
|
+ { headerName: '颜色标识', field: 'color_rgb', sortable: true, filter: false,
|
|
|
+ cellRenderer: this.colorFormatter
|
|
|
+ },
|
|
|
+
|
|
|
+ { headerName: '编辑',
|
|
|
+ cellRendererFramework: 'ButtonCellRender',
|
|
|
+ cellRendererParams: {
|
|
|
+ onClick: this.handEdit,
|
|
|
+ label: '编辑',
|
|
|
+ buttonType: 'primary',
|
|
|
+ buttonSize: 'mini'
|
|
|
},
|
|
|
- addOredit: '',
|
|
|
- myTitle: '',
|
|
|
- shopVisible: false,
|
|
|
- member_tags: null,
|
|
|
- params : {
|
|
|
- page_size: 100,
|
|
|
- page_no: 1,
|
|
|
- sort: 'id',
|
|
|
- dir: 'desc'
|
|
|
+ filter: false,
|
|
|
+ pinned: 'right',
|
|
|
+ lockPinned: true,
|
|
|
+ width: 100,
|
|
|
+ resizable: false,
|
|
|
+ sortable: false },
|
|
|
+ { headerName: '删除',
|
|
|
+ cellRendererFramework: 'ButtonCellRender',
|
|
|
+ cellRendererParams: param => {
|
|
|
+ return {
|
|
|
+ onClick: this.deleteSingle,
|
|
|
+ label: '删除',
|
|
|
+ buttonType: 'danger',
|
|
|
+ buttonSize: 'mini',
|
|
|
+ disabled: param.data['member_name'] === 'superadmin'
|
|
|
+ }
|
|
|
},
|
|
|
- partId: this.$store.getters.partId,
|
|
|
- pName: null
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
- tableHeight() {
|
|
|
- return this.mainAreaHeight - 40
|
|
|
+ pinned: 'right',
|
|
|
+ lockPinned: true,
|
|
|
+ width: 100,
|
|
|
+ resizable: false,
|
|
|
+ filter: false,
|
|
|
+ sortable: false }
|
|
|
+ ]
|
|
|
+ this.defaultColDef = {
|
|
|
+ filter: 'agTextColumnFilter',
|
|
|
+ sortable: true,
|
|
|
+ resizable: true,
|
|
|
+ comparator: this.dateCustomComparator,
|
|
|
+ filterParams: {
|
|
|
+ debounceMs: 200,
|
|
|
+ newRowsAction: 'keep',
|
|
|
+ textCustomComparator: this.textCustomComparator,
|
|
|
+ comparator: this.dateCustomComparator
|
|
|
}
|
|
|
+ }
|
|
|
+ this.rowSelection = 'multiple'
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ window.onresize = this.windowResize()
|
|
|
+ this.gettagList1()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ windowResize() {
|
|
|
+ this.$set(this, 'mainAreaHeight', Number(document.documentElement.clientHeight) - 84)
|
|
|
},
|
|
|
- methods: {
|
|
|
- gettagList1() {
|
|
|
- this.params.fixedCondition = ' part_id=' + this.partId,
|
|
|
- API_NcsNurseConfig.getList(this.params).then(response => {
|
|
|
- this.listLoading = false
|
|
|
- this.tagList1 = response.data
|
|
|
- if (this.tagList1.length > 0) {
|
|
|
+ gettagList1() {
|
|
|
+ this.params.fixedCondition = ' part_id=' + this.partId
|
|
|
+ this.params.sort = 'index_no'
|
|
|
+ this.params.dir = 'asc'
|
|
|
+ API_NcsNurseConfig.getList(this.params).then(response => {
|
|
|
+ this.listLoading = false
|
|
|
+ this.tagList1 = response.data
|
|
|
+ if (this.tagList1.length > 0) {
|
|
|
+ if (this.pid === 0) {
|
|
|
this.pid = this.tagList1[0].id
|
|
|
- this.pName = this.tagList1[0].config_name
|
|
|
- this.gettagList2(this.pid)
|
|
|
}
|
|
|
- }).catch(() => {
|
|
|
- this.listLoading = false
|
|
|
- })
|
|
|
- },
|
|
|
- gettagList2() {
|
|
|
- this.params.fixedCondition = ' part_id=' + this.partId +' and ncfg_id = ' + this.pid
|
|
|
- API_NcsNurseConfigOption.getList(this.params).then(response => {
|
|
|
- this.tagList2 = response.data
|
|
|
- }).catch(() => {
|
|
|
- })
|
|
|
- },
|
|
|
- tableClick(row, column, event, cell) {
|
|
|
- if (column.property === 'config_name') {
|
|
|
- this.pid = row.id
|
|
|
- this.pName = row.config_name
|
|
|
- this.gettagList2()
|
|
|
+ this.pName = this.tagList1[0].config_name
|
|
|
+ this.gettagList2(this.pid)
|
|
|
+ const currentRow = this.tagList1.find(p => p.id === this.pid)
|
|
|
+ this.$refs.nurseConfigTable.setCurrentRow(currentRow)
|
|
|
}
|
|
|
- },
|
|
|
- addNurseConfig(index, row, type) {
|
|
|
- this.type = type
|
|
|
- this.addOredit = 'add'
|
|
|
- if (type === 1) {
|
|
|
- this.myTitle = '新增护理'
|
|
|
- this.addFormVisible = true
|
|
|
- } else if (type === 2) {
|
|
|
- this.addOptionForm = {
|
|
|
- option_name: null,
|
|
|
- color_rgb: '#000000'
|
|
|
- }
|
|
|
- this.pid = row.id
|
|
|
- this.myTitle = '新增护理项'
|
|
|
- this.addFormOptionVisible = true
|
|
|
+ }).catch(() => {
|
|
|
+ this.listLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ gettagList2() {
|
|
|
+ this.params.fixedCondition = ' part_id=' + this.partId + ' and ncfg_id = ' + this.pid
|
|
|
+ this.params.sort = 'id'
|
|
|
+ this.params.dir = 'desc'
|
|
|
+ API_NcsNurseConfigOption.getList(this.params).then(response => {
|
|
|
+ this.tagList2 = response.data
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+ },
|
|
|
+ tableClick(row, column, event, cell) {
|
|
|
+ if (column.property === 'config_name') {
|
|
|
+ this.pid = row.id
|
|
|
+ this.pName = row.config_name
|
|
|
+ this.gettagList2()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addNurseConfig(index, row, type) {
|
|
|
+ this.type = type
|
|
|
+ this.addOredit = 'add'
|
|
|
+ if (type === 1) {
|
|
|
+ this.myTitle = '新增护理'
|
|
|
+ this.addFormVisible = true
|
|
|
+ this.addForm = {
|
|
|
+ index_no: 1
|
|
|
}
|
|
|
- },
|
|
|
- addOptionSubmit() {
|
|
|
- let _this = this
|
|
|
- this.$refs.addOptionForm.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- this.addOptionForm.color_rgb = this.addOptionForm.color_rgb.replace('#', '')
|
|
|
- let _this = this
|
|
|
- if (this.addOredit === 'add') {
|
|
|
- let classEntity = Object.assign({}, this.addOptionForm)
|
|
|
- classEntity.part_id = this.partId
|
|
|
- classEntity.ncfg_id = this.pid
|
|
|
- API_NcsNurseConfigOption.add(classEntity).then(r => {
|
|
|
- _this.gettagList2()
|
|
|
- _this.$message({
|
|
|
- message: '新增成功!',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- })
|
|
|
- } else if (this.addOredit === 'edit') {
|
|
|
- API_NcsNurseConfigOption.update(this.addOptionForm.id, this.addOptionForm).then(r => {
|
|
|
- _this.gettagList2()
|
|
|
- _this.$message({
|
|
|
- message: '修改成功!',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- this.addFormOptionVisible = false
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- addSubmit() {
|
|
|
- let _this = this
|
|
|
- this.$refs.addForm.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- let _this = this
|
|
|
- if (this.addOredit === 'add') {
|
|
|
- let classEntity = Object.assign({}, this.addForm)
|
|
|
- classEntity.part_id = this.partId
|
|
|
- API_NcsNurseConfig.add(classEntity).then(r => {
|
|
|
- _this.gettagList1()
|
|
|
- _this.$message({
|
|
|
- message: '新增成功!',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
+ } else if (type === 2) {
|
|
|
+ this.addOptionForm = {
|
|
|
+ option_name: null,
|
|
|
+ color_rgb: '#000000'
|
|
|
+ }
|
|
|
+ this.pid = row.id
|
|
|
+ this.myTitle = '新增护理项'
|
|
|
+ this.addFormOptionVisible = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addOption() {
|
|
|
+ this.addNurseConfig(null, { id: this.pid }, 2)
|
|
|
+ },
|
|
|
+ addOptionSubmit() {
|
|
|
+ const _this = this
|
|
|
+ this.$refs.addOptionForm.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.addOptionForm.color_rgb = this.addOptionForm.color_rgb.replace('#', '')
|
|
|
+ const _this = this
|
|
|
+ if (this.addOredit === 'add') {
|
|
|
+ const classEntity = Object.assign({}, this.addOptionForm)
|
|
|
+ classEntity.part_id = this.partId
|
|
|
+ classEntity.ncfg_id = this.pid
|
|
|
+ API_NcsNurseConfigOption.add(classEntity).then(r => {
|
|
|
+ _this.gettagList2()
|
|
|
+ _this.$message({
|
|
|
+ message: '新增成功!',
|
|
|
+ type: 'success'
|
|
|
})
|
|
|
- } else if (this.addOredit === 'edit') {
|
|
|
- API_NcsNurseConfig.update(this.addForm.id, {config_name: this.addForm.config_name}).then(r => {
|
|
|
- _this.gettagList1()
|
|
|
- _this.$message({
|
|
|
- message: '修改成功!',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
+ })
|
|
|
+ } else if (this.addOredit === 'edit') {
|
|
|
+ API_NcsNurseConfigOption.update(this.addOptionForm.id, this.addOptionForm).then(r => {
|
|
|
+ _this.gettagList2()
|
|
|
+ _this.$message({
|
|
|
+ message: '修改成功!',
|
|
|
+ type: 'success'
|
|
|
})
|
|
|
- }
|
|
|
- this.addForm = {
|
|
|
- config_name: null
|
|
|
- }
|
|
|
- this.addFormVisible = false
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- updateRow(index, row, type) {
|
|
|
- this.addOredit = 'edit'
|
|
|
- this.myTitle = '修改护理'
|
|
|
- if (type === 1) {
|
|
|
- this.addForm.id = row.id
|
|
|
- this.addForm.config_name = row.config_name
|
|
|
- this.addFormVisible = true
|
|
|
- } else {
|
|
|
- this.addOptionForm = {
|
|
|
- id: row.id,
|
|
|
- option_name: row.option_name,
|
|
|
- color_rgb: '#' + row.color_rgb
|
|
|
+ })
|
|
|
}
|
|
|
- this.addFormOptionVisible = true
|
|
|
+ this.addFormOptionVisible = false
|
|
|
}
|
|
|
-
|
|
|
- },
|
|
|
- deleteRow(index, row, type) {
|
|
|
- this.type = type
|
|
|
- let _this = this
|
|
|
- this.$confirm('删除提交吗?', '提示', {}).then(() => {
|
|
|
- if (type === 1) {
|
|
|
- API_NcsNurseConfig.remove(row.id).then(r => {
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addSubmit() {
|
|
|
+ const _this = this
|
|
|
+ this.$refs.addForm.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ const _this = this
|
|
|
+ if (this.addOredit === 'add') {
|
|
|
+ const classEntity = Object.assign({}, this.addForm)
|
|
|
+ classEntity.part_id = this.partId
|
|
|
+ API_NcsNurseConfig.add(classEntity).then(r => {
|
|
|
_this.gettagList1()
|
|
|
_this.$message({
|
|
|
- message: '删除成功!',
|
|
|
+ message: '新增成功!',
|
|
|
type: 'success'
|
|
|
})
|
|
|
})
|
|
|
- } else {
|
|
|
- API_NcsNurseConfigOption.remove(row.id).then(r => {
|
|
|
- _this.gettagList2()
|
|
|
+ } else if (this.addOredit === 'edit') {
|
|
|
+ API_NcsNurseConfig.update(this.addForm.id, this.addForm).then(r => {
|
|
|
+ _this.gettagList1()
|
|
|
_this.$message({
|
|
|
- message: '删除成功!',
|
|
|
+ message: '修改成功!',
|
|
|
type: 'success'
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
- })
|
|
|
- },
|
|
|
- memberInit() {
|
|
|
- },
|
|
|
- openAdvert(index, row) {
|
|
|
- this.member_tags = row.tag
|
|
|
- this.shopVisible = true
|
|
|
+ this.addForm = {
|
|
|
+ config_name: null
|
|
|
+ }
|
|
|
+ this.addFormVisible = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handEdit(row) {
|
|
|
+ this.updateRow(null, row, 2)
|
|
|
+ },
|
|
|
+ updateRow(index, row, type) {
|
|
|
+ this.addOredit = 'edit'
|
|
|
+ this.myTitle = '修改护理'
|
|
|
+ if (type === 1) {
|
|
|
+ this.addForm = { ...row }
|
|
|
+ this.addFormVisible = true
|
|
|
+ } else {
|
|
|
+ this.addOptionForm = {
|
|
|
+ id: row.id,
|
|
|
+ option_name: row.option_name,
|
|
|
+ color_rgb: '#' + row.color_rgb
|
|
|
+ }
|
|
|
+ this.addFormOptionVisible = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deleteSingle(row) {
|
|
|
+ this.deleteRow(null, row, 2)
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 分页大小发生改变 */
|
|
|
+ handlePageSizeChange(size) {
|
|
|
+ this.params.page_size = size
|
|
|
+ this.gettagList2()
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 分页页数发生改变 */
|
|
|
+ handlePageCurrentChange(page) {
|
|
|
+ this.params.page_no = page
|
|
|
+ this.gettagList2()
|
|
|
+ },
|
|
|
+ deleteRow(index, row, type) {
|
|
|
+ this.type = type
|
|
|
+ const _this = this
|
|
|
+ this.$confirm('删除提交吗?', '提示', {}).then(() => {
|
|
|
+ if (type === 1) {
|
|
|
+ API_NcsNurseConfig.remove(row.id).then(r => {
|
|
|
+ _this.gettagList1()
|
|
|
+ _this.$message({
|
|
|
+ message: '删除成功!',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ API_NcsNurseConfigOption.remove(row.id).then(r => {
|
|
|
+ _this.gettagList2()
|
|
|
+ _this.$message({
|
|
|
+ message: '删除成功!',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ memberInit() {
|
|
|
+ },
|
|
|
+ openAdvert(index, row) {
|
|
|
+ this.member_tags = row.tag
|
|
|
+ this.shopVisible = true
|
|
|
+ },
|
|
|
+ colorFormatter(param) {
|
|
|
+ console.log('aa', param)
|
|
|
+ return '<button style="width: 120px;height: 30px;vertical-align:middle;border:0;background-color: #' + param.value + '"/>'
|
|
|
+ },
|
|
|
+ /** 处理搜索 */
|
|
|
+ handlerSearch(keywords) {
|
|
|
+ this.params.query = keywords
|
|
|
+ this.gettagList2()
|
|
|
+ },
|
|
|
+ /** 处理字段排序 */
|
|
|
+ tableSort(column) {
|
|
|
+ if (column.order !== null) {
|
|
|
+ this.params.sort = column.prop
|
|
|
+ this.params.dir = column.order === 'ascending' ? 'asc' : 'desc'
|
|
|
+ } else {
|
|
|
+ this.params.sort = null
|
|
|
+ this.params.dir = null
|
|
|
}
|
|
|
+ this.gettagList2()
|
|
|
+ },
|
|
|
+ gridSortChange(param) {
|
|
|
+ console.log('sortparam', 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.gettagList2()
|
|
|
+ console.log(sortState)
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.gettagList1()
|
|
|
+ filterModifed(param) {
|
|
|
+ console.log(param)
|
|
|
+ var model = param.api.getFilterModel()
|
|
|
+ console.log('model', JSON.stringify(model))
|
|
|
+ this.params.filter = JSON.stringify(model)
|
|
|
+ this.gettagList2()
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|