Prechádzať zdrojové kódy

Merge branch 'master' of http://git.wdklian.com/allen/ncs_ui

* 'master' of http://git.wdklian.com/allen/ncs_ui:
  1、科室人员开发; 2、呼叫历史开发; 3、护理项开发; 4、其他优化

# Conflicts:
#	package-lock.json
#	src/views/customer/customerEdit.vue
wuyunfeng 4 rokov pred
rodič
commit
073ab31171

+ 14 - 14
package-lock.json

@@ -5169,7 +5169,8 @@
     "console-control-strings": {
     "console-control-strings": {
       "version": "1.1.0",
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
       "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
-      "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
+      "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
+      "optional": true
     },
     },
     "consolidate": {
     "consolidate": {
       "version": "0.15.1",
       "version": "0.15.1",
@@ -7740,7 +7741,8 @@
         "ansi-regex": {
         "ansi-regex": {
           "version": "2.1.1",
           "version": "2.1.1",
           "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
           "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
-          "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
+          "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
+          "optional": true
         },
         },
         "is-fullwidth-code-point": {
         "is-fullwidth-code-point": {
           "version": "1.0.0",
           "version": "1.0.0",
@@ -7766,6 +7768,7 @@
           "version": "3.0.1",
           "version": "3.0.1",
           "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
           "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
           "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
           "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+          "optional": true,
           "requires": {
           "requires": {
             "ansi-regex": "^2.0.0"
             "ansi-regex": "^2.0.0"
           }
           }
@@ -10120,9 +10123,8 @@
     },
     },
     "js-md5": {
     "js-md5": {
       "version": "0.7.3",
       "version": "0.7.3",
-      "resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz",
-      "integrity": "sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==",
-      "dev": true
+      "resolved": "https://registry.npm.taobao.org/js-md5/download/js-md5-0.7.3.tgz",
+      "integrity": "sha1-tPL7sLMnRV9ZjWcn447Ccs0Jw/I="
     },
     },
     "js-message": {
     "js-message": {
       "version": "1.0.5",
       "version": "1.0.5",
@@ -10301,11 +10303,6 @@
         "set-immediate-shim": "~1.0.1"
         "set-immediate-shim": "~1.0.1"
       }
       }
     },
     },
-    "jwt-decode": {
-      "version": "3.1.2",
-      "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz",
-      "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A=="
-    },
     "keypress": {
     "keypress": {
       "version": "0.1.0",
       "version": "0.1.0",
       "resolved": "https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz",
       "resolved": "https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz",
@@ -11996,7 +11993,8 @@
     "npm-normalize-package-bin": {
     "npm-normalize-package-bin": {
       "version": "1.0.1",
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz",
       "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz",
-      "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA=="
+      "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==",
+      "optional": true
     },
     },
     "npm-packlist": {
     "npm-packlist": {
       "version": "1.4.8",
       "version": "1.4.8",
@@ -12756,7 +12754,8 @@
       "version": "2.2.2",
       "version": "2.2.2",
       "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
       "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
       "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
       "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
-      "dev": true
+      "dev": true,
+      "optional": true
     },
     },
     "pify": {
     "pify": {
       "version": "4.0.1",
       "version": "4.0.1",
@@ -13896,7 +13895,7 @@
       "version": "git+https://github.com/nhn/raphael.git#78a6ed3ec269f33b6457b0ec66f8c3d1f2ed70e0",
       "version": "git+https://github.com/nhn/raphael.git#78a6ed3ec269f33b6457b0ec66f8c3d1f2ed70e0",
       "from": "git+https://github.com/nhn/raphael.git#2.2.0-c",
       "from": "git+https://github.com/nhn/raphael.git#2.2.0-c",
       "requires": {
       "requires": {
-        "eve": "git://github.com/adobe-webplatform/eve.git#eef80ed8d188423c2272746fb8ae5cc8dad84cb1"
+        "eve": "git://github.com/adobe-webplatform/eve.git#eef80ed"
       }
       }
     },
     },
     "raw-body": {
     "raw-body": {
@@ -16118,6 +16117,7 @@
           "version": "2.9.0",
           "version": "2.9.0",
           "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz",
           "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz",
           "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==",
           "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==",
+          "optional": true,
           "requires": {
           "requires": {
             "safe-buffer": "^5.1.2",
             "safe-buffer": "^5.1.2",
             "yallist": "^3.0.0"
             "yallist": "^3.0.0"
@@ -16496,7 +16496,7 @@
       "integrity": "sha512-DUJIutBG/tOdvJnGCo1PcBhFyGBWsY8VIMdXe3WRtGXynMwOcC5cojYpULf3qFJ4Jj1Riv3/kbF6Ygmi+BpjCw==",
       "integrity": "sha512-DUJIutBG/tOdvJnGCo1PcBhFyGBWsY8VIMdXe3WRtGXynMwOcC5cojYpULf3qFJ4Jj1Riv3/kbF6Ygmi+BpjCw==",
       "requires": {
       "requires": {
         "core-js": "^3.6.4",
         "core-js": "^3.6.4",
-        "raphael": "git+https://github.com/nhn/raphael.git#78a6ed3ec269f33b6457b0ec66f8c3d1f2ed70e0",
+        "raphael": "git+https://github.com/nhn/raphael.git#2.2.0-c",
         "tui-code-snippet": "^2.3.1"
         "tui-code-snippet": "^2.3.1"
       },
       },
       "dependencies": {
       "dependencies": {

+ 1 - 0
package.json

@@ -28,6 +28,7 @@
     "file-saver": "2.0.1",
     "file-saver": "2.0.1",
     "fuse.js": "3.4.4",
     "fuse.js": "3.4.4",
     "js-cookie": "2.2.0",
     "js-cookie": "2.2.0",
+    "js-md5": "^0.7.3",
     "jsonlint": "1.6.3",
     "jsonlint": "1.6.3",
     "jszip": "3.2.1",
     "jszip": "3.2.1",
     "jwt-decode": "^3.1.2",
     "jwt-decode": "^3.1.2",

+ 4 - 4
src/api/calling-list.js

@@ -1,7 +1,7 @@
 import request from '@/utils/request'
 import request from '@/utils/request'
 export function getList(params) {
 export function getList(params) {
   return request({
   return request({
-    url: '/mgr/calllist/page',
+    url: '/ncs/calling_history/page',
     method: 'POST',
     method: 'POST',
     loading: true,
     loading: true,
     data: params,
     data: params,
@@ -12,16 +12,16 @@ export function getList(params) {
 export function remove(params) {
 export function remove(params) {
   const ids = params.toString()
   const ids = params.toString()
   return request({
   return request({
-    url: `/mgr/calllist/${ids}`,
+    url: `/ncs/calling_history/${ids}`,
     method: 'DELETE',
     method: 'DELETE',
     loading: true,
     loading: true,
     data: params
     data: params
   })
   })
 }
 }
 
 
-export function clearRecord() {
+export function clearRecord(id) {
   return request({
   return request({
-    url: `/mgr/calllist`,
+    url: `/ncs/calling_history/deleteByPartId/${id}`,
     method: 'DELETE',
     method: 'DELETE',
     loading: true
     loading: true
   })
   })

+ 49 - 0
src/api/ncs_clerk.js

@@ -1,4 +1,5 @@
 import request from '@/utils/request'
 import request from '@/utils/request'
+import md5 from 'js-md5'
 
 
 export function listByPartRoleId(params) {
 export function listByPartRoleId(params) {
   return request({
   return request({
@@ -7,3 +8,51 @@ export function listByPartRoleId(params) {
     data: params
     data: params
   })
   })
 }
 }
+export function getList(params) {
+  return request({
+    url: '/ncs/clerk/page',
+    method: 'POST',
+    loading: true,
+    data: params,
+    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
+  })
+}
+export function add(params) {
+  // params = JSON.parse(JSON.stringify(params))
+  // params.password = md5(params.password)
+  return request({
+    url: '/ncs/clerk',
+    method: 'POST',
+    loading: true,
+    data: params
+  })
+}
+/** 删除设备 */
+export function remove(params) {
+  const ids = params.toString()
+  return request({
+    url: `/ncs/clerk/${ids}`,
+    method: 'DELETE',
+    loading: true,
+    data: params
+  })
+}
+
+export function update(id, params) {
+  // if (params.password) {
+  //   params.password = md5(params.password)
+  // }
+  return request({
+    url: `/ncs/clerk/${id}`,
+    method: 'put',
+    data: params
+  })
+}
+export function getRoles(params) {
+  return request({
+    url: '/ncs/clerk/getRoles',
+    method: 'POST',
+    loading: true,
+    data: params
+  })
+}

+ 10 - 16
src/api/ncs_nurseConfig.js

@@ -8,17 +8,21 @@ export function getList(params) {
     headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
     headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
   })
   })
 }
 }
-
-export function remove(params) {
-  const ids = params.toString()
+export function remove(id) {
   return request({
   return request({
-    url: `/ncs/nurse_config/${ids}`,
+    url: `/ncs/nurse_config/${id}`,
     method: 'DELETE',
     method: 'DELETE',
-    loading: true,
+    loading: true
+  })
+}
+/** 修改 */
+export function update(id, params) {
+  return request({
+    url: `/ncs/nurse_config/${id}`,
+    method: 'put',
     data: params
     data: params
   })
   })
 }
 }
-
 /** 新增 */
 /** 新增 */
 export function add(params) {
 export function add(params) {
   return request({
   return request({
@@ -28,16 +32,6 @@ export function add(params) {
     data: params
     data: params
   })
   })
 }
 }
-
-/** 修改 */
-export function update(id, params) {
-  return request({
-    url: `/ncs/nurse_config/${id}`,
-    method: 'put',
-    data: params
-  })
-}
-
 export function listByPartId(params) {
 export function listByPartId(params) {
   return request({
   return request({
     url: `/ncs/nurse_config/listByPartId`,
     url: `/ncs/nurse_config/listByPartId`,

+ 36 - 0
src/api/ncs_nurse_config_option.js

@@ -0,0 +1,36 @@
+import request from '@/utils/request'
+export function getList(params) {
+  return request({
+    url: '/ncs/nurse_config_option/page',
+    method: 'POST',
+    loading: true,
+    data: params,
+    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
+  })
+}
+export function remove(params) {
+  const ids = params.toString()
+  return request({
+    url: `/ncs/nurse_config_option/${ids}`,
+    method: 'DELETE',
+    loading: true,
+    data: params
+  })
+}
+/** 修改 */
+export function update(id, params) {
+  return request({
+    url: `/ncs/nurse_config_option/${id}`,
+    method: 'put',
+    data: params
+  })
+}
+/** 新增 */
+export function add(params) {
+  return request({
+    url: '/ncs/nurse_config_option',
+    method: 'POST',
+    loading: true,
+    data: params
+  })
+}

+ 0 - 1
src/api/user.js

@@ -61,7 +61,6 @@ export function add(params) {
 }
 }
 
 
 export function remove(params) {
 export function remove(params) {
-  console.log('1111111111', params)
   const ids = params.toString()
   const ids = params.toString()
   return request({
   return request({
     url: `/Mgr/member/${ids}`,
     url: `/Mgr/member/${ids}`,

+ 15 - 15
src/router/index.js

@@ -113,26 +113,26 @@ export const partRoutes = [
     ]
     ]
   },
   },
   {
   {
-    path: '/calling-staff',
+    path: '/ncs-clerk',
     component: Layout,
     component: Layout,
-    redirect: '/calling-staff/index',
+    redirect: '/ncs-clerk/clerkList',
     children: [
     children: [
       {
       {
-        path: 'index',
-        component: () => import('@/views/calling-staff/index'),
-        name: 'Staff',
+        path: 'clerkList',
+        component: () => import('@/views/ncs-clerk/clerkList'),
+        name: 'clerkList',
         meta: { title: '科室员工设置', icon: 'user', noCache: true }
         meta: { title: '科室员工设置', icon: 'user', noCache: true }
       }
       }
     ]
     ]
   },
   },
   {
   {
-    path: '/calling-calllist',
+    path: '/ncs-calling-history',
     component: Layout,
     component: Layout,
-    redirect: '/calling-calllist/index',
+    redirect: '/ncs-calling-history/index',
     children: [
     children: [
       {
       {
         path: 'index',
         path: 'index',
-        component: () => import('@/views/calling-calllist/index'),
+        component: () => import('@/views/ncs-calling-history/index'),
         name: 'CallingList',
         name: 'CallingList',
         meta: { title: '呼叫历史查询', icon: 'list', noCache: true }
         meta: { title: '呼叫历史查询', icon: 'list', noCache: true }
       }
       }
@@ -165,14 +165,14 @@ export const partRoutes = [
     ]
     ]
   },
   },
   {
   {
-    path: '/calling-nurse',
+    path: '/ncs-nurse-config',
     component: Layout,
     component: Layout,
-    redirect: '/calling-nurse/index',
+    redirect: '/ncs-nurse-config/index',
     children: [
     children: [
       {
       {
         path: 'index',
         path: 'index',
-        component: () => import('@/views/calling-nurse/index'),
-        name: 'CallingNurse',
+        component: () => import('@/views/ncs-nurse-config/index'),
+        name: 'NcsNurseConfig',
         meta: { title: '护理设置', icon: 'el-icon-s-goods', noCache: true }
         meta: { title: '护理设置', icon: 'el-icon-s-goods', noCache: true }
       }
       }
     ]
     ]
@@ -245,13 +245,13 @@ export const adminRoutes = [
     ]
     ]
   },
   },
   {
   {
-    path: '/calling-ncConfig',
+    path: '/ncs-nurse-config',
     component: Layout,
     component: Layout,
-    redirect: '/calling-ncConfig/index',
+    redirect: '/ncs-nurse-config/index',
     children: [
     children: [
       {
       {
         path: 'index',
         path: 'index',
-        component: () => import('@/views/calling-ncConfig/index'),
+        component: () => import('@/views/ncs-nurse-config/index'),
         name: 'CallingNcConfig',
         name: 'CallingNcConfig',
         meta: { title: '系统参数', icon: 'nested', noCache: true }
         meta: { title: '系统参数', icon: 'nested', noCache: true }
       }
       }

+ 0 - 239
src/views/calling-ncConfig/index.vue

@@ -1,239 +0,0 @@
-<template>
-  <div class="app-container">
-
-    <en-table-layout toolbar pagination :table-data="tableData" :loading="loading" @sort-change="tableSort">
-      <!--工具栏-->
-      <div slot="toolbar" class="inner-toolbar">
-        <div class="toolbar-search">
-          <en-table-search placeholder="请输入搜索关键字" @search="handlerSearch" />
-        </div>
-        <div class="toolbar-btns">
-          <el-button type="success" @click="handlerAdd">新增配置</el-button>
-        </div>
-      </div>
-      <!--表头-->
-      <template slot="table-columns">
-        <!--                <el-table-column prop="id" sortable="custom" label="ID" width="100" align="center"/>-->
-        <el-table-column prop="code" sortable="custom" label="标识码" min-width="160" align="center" />
-        <el-table-column prop="cn_name" sortable="custom" label="配置名" min-width="260" align="center" />
-        <el-table-column prop="val" sortable="custom" label="配置内容" min-width="200" align="center" />
-        <el-table-column
-          prop="description"
-          sortable="custom"
-          label="描述"
-          min-width="200"
-          :show-overflow-tooltip="true"
-          align="center"
-        />
-        <el-table-column label="操作" align="center" width="160">
-          <template slot-scope="scope">
-            <el-button type="permary" size="mini" @click="showDetail(scope.row)">修改</el-button>
-            <el-button type="danger" size="mini" @click="handlerDelete(scope.row.id)">删除</el-button>
-          </template>
-        </el-table-column>
-      </template>
-      <!--翻页-->
-      <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"
-      />
-    </en-table-layout>
-
-    <el-dialog :title.sync="formtitle" :visible.sync="formshow" width="50%">
-      <div>
-        <el-form ref="editform" :rules="rules" label-width="120px" :model="formmodel">
-          <el-form-item label="标识码" prop="code">
-            <el-input v-model="formmodel.code" maxlength="20" placeholder="请输入标识码" />
-          </el-form-item>
-          <el-form-item label="配置名" prop="cn_name">
-            <el-input v-model="formmodel.cn_name" maxlength="50" label="请输入配置名" />
-          </el-form-item>
-          <el-form-item label="配置内容" prop="val">
-            <el-input v-model="formmodel.val" maxlength="50" placeholder="请输入配置内容" />
-          </el-form-item>
-          <el-form-item label="描述">
-            <el-input
-              v-model="formmodel.description"
-              type="textarea"
-              :rows="2"
-              maxlength="200"
-              placeholder="请输入描述"
-            />
-          </el-form-item>
-
-        </el-form>
-      </div>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="formshow = false">取 消</el-button>
-        <el-button type="primary" @click="handlerFormSubmit('editform')">确 定</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import * as API_CallingNcConfig from '@/api/ncs_nurseConfig'
-
-export default {
-  name: 'Index',
-  data() {
-    return {
-      tableData: [],
-      /** 列表参数 */
-      params: {
-        page_size: 20,
-        page_no: 1
-      },
-      pageData: [],
-      loading: false,
-      editflag: 0,
-      formshow: false,
-      formtitle: '新增系统配置',
-      formmodel: {
-        code: null,
-        cn_name: null,
-        val: null
-      },
-      /** 表单校验 */
-      rules: {
-        code: [
-          { required: true, message: '请输入标识码', trigger: 'blur' }
-        ],
-        cn_name: [
-          { required: true, message: '请输入配置名', trigger: 'blur' }
-        ],
-        val: [
-          { required: true, message: '请输入配置内容', trigger: 'blur' }
-        ]
-      }
-    }
-  },
-  mounted() {
-    this.getList()
-  },
-  methods: {
-    handlerDelete(ids) {
-      this.$confirm('删除操作后数据不可复原,您确定要删除此数据?', '警告', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        API_CallingNcConfig.remove(ids).then(
-          response => {
-            this.getList()
-            this.$message({
-              type: 'success',
-              message: '删除成功!'
-            })
-          }
-        ).catch(response => {
-          this.$message({
-            type: 'info',
-            message: response.message
-          })
-        })
-      }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: '已取消删除'
-        })
-      })
-    },
-    /** 分页大小发生改变 */
-    handlePageSizeChange(size) {
-      this.params.page_size = size
-      this.getList()
-    },
-
-    /** 分页页数发生改变 */
-    handlePageCurrentChange(page) {
-      this.params.page_no = page
-      this.getList()
-    },
-    /** 加载列表数据 */
-    getList() {
-      this.loading = true
-      const param = this.MixinClone(this.params)
-      API_CallingNcConfig.getList(param).then(response => {
-        this.loading = false
-        this.tableData = [...response.data]
-        this.pageData = {
-          page_no: response.page_no,
-          page_size: response.page_size,
-          data_total: response.data_total
-        }
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /** 处理搜索 */
-    handlerSearch(keywords) {
-      this.params.query = keywords
-      this.getList()
-    },
-    /** 处理字段排序 */
-    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.getList()
-    },
-    showDetail(item) {
-      this.editflag = 1
-      this.formshow = true
-      this.formtitle = '修改系统配置'
-      this.formmodel = JSON.parse(JSON.stringify(item))
-    },
-    handlerAdd() {
-      this.editflag = 0
-      this.formshow = true
-      this.formmodel = {
-        code: null,
-        cn_name: null,
-        val: null
-      }
-      this.formtitle = '新增系统配置'
-    },
-    handlerFormSubmit(formName) {
-      this.$refs[formName].validate((valid) => {
-        if (valid) {
-          if (this.editflag === 0) {
-            API_CallingNcConfig.add(this.formmodel).then(() => {
-              this.formshow = false
-              this.$message.success('保存成功!')
-              this.getList()
-            })
-          } else {
-            /** 修改 */
-            API_CallingNcConfig.update(this.formmodel.id, this.formmodel).then(() => {
-              this.formshow = false
-              this.$message.success('修改成功!')
-              this.getList()
-            }).catch(response => {
-              this.formshow = false
-              this.$message.warning(response.message)
-              this.getList()
-            })
-          }
-        }
-      })
-    }
-  }
-}
-</script>
-
-<style scoped type="text/scss">
-
-
-</style>

+ 0 - 502
src/views/calling-staff/index.vue

@@ -1,502 +0,0 @@
-<template>
-  <div class="app-container">
-
-    <en-table-layout
-      toolbar
-      pagination
-      :table-data="tableData"
-      :height="tableHeight"
-      :loading="loading"
-      @selection-change="selectFun"
-      @sort-change="tableSort"
-    >
-      <!--工具栏-->
-      <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" @click="handlerAdd">新增职员</el-button>
-          <el-button type="danger" @click="batchDelete">批量删除</el-button>
-        </div>
-      </div>
-      <!--表头-->
-      <template slot="table-columns">
-        <el-table-column
-          type="selection"
-          width="55"
-          align="center"
-        />
-
-        <el-table-column prop="id" sortable="custom" label="ID" width="100" align="center" />
-        <el-table-column prop="staff_his_id" sortable="custom" label="HIS系统ID" width="120" align="center" />
-        <el-table-column prop="staff_name" sortable="custom" label="姓名" width="160" align="center" />
-        <el-table-column prop="staff_name_py" sortable="custom" label="姓名拼音首码" width="160" align="center" />
-        <el-table-column prop="staff_sex" sortable="custom" label="性别" width="100" align="center" :formatter="formatterSex" />
-        <el-table-column prop="staff_type" sortable="custom" label="岗位类型" width="100" align="center" :formatter="formatterStaffType" />
-
-        <el-table-column prop="staff_mobile" sortable="custom" label="手机号" width="160" align="center" />
-        <el-table-column prop="staff_birthday" sortable="custom" label="生日" width="200" align="center" />
-        <el-table-column prop="staff_idcard" sortable="custom" label="身份证号" width="200" align="center" />
-        <el-table-column prop="staff_passwordcard" sortable="custom" label="身份识别号码" width="200" align="center" />
-        <el-table-column prop="staff_workdate" sortable="custom" label="入职日期" width="200" align="center" />
-        <el-table-column prop="staff_datetime" sortable="custom" label="最后修改时间" width="200" align="center" />
-        <el-table-column
-          label="操作"
-          align="center"
-          fixed="right"
-          width="160"
-        >
-          <template slot-scope="scope">
-            <el-button type="success" size="mini" @click="handlerEdit(scope.$index,scope.row)">
-              编辑
-            </el-button>
-
-            <el-button type="danger" size="mini" @click="handlerDelete(scope.row.id)">
-              删除
-            </el-button>
-          </template>
-        </el-table-column>
-
-      </template>
-
-      <!--翻页-->
-      <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"
-      />
-    </en-table-layout>
-
-    <el-dialog :title.sync="formtitle" :visible.sync="formshow" width="50%">
-      <div>
-        <el-form ref="editform" :rules="rules" label-width="120px" :model="formmodel">
-
-          <el-row>
-            <el-col :span="12">
-              <el-form-item label="HIS索引" prop="android_idno">
-                <el-input v-model="formmodel.staff_his_id" clearable :maxlength="20" placeholder="请输入HIS索引" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="姓名" prop="staff_name">
-                <el-input v-model="formmodel.staff_name" clearable :maxlength="20" placeholder="请输入姓名" @change="nameInput" />
-                <!--                              <el-select placeholder="请选择设备类型" clearable v-model="formmodel.dtype">-->
-                <!--                                  <el-option :label="item" v-for="(item,index) in devicetype" :key="index" :value="item"></el-option>-->
-                <!--                              </el-select>-->
-              </el-form-item>
-            </el-col>
-          </el-row>
-
-          <el-row>
-            <el-col :span="12">
-              <el-form-item label="拼音首码">
-                <el-input v-model="formmodel.staff_name_py" clearable :maxlength="20" placeholder="自动获取" readonly />
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="岗位类型" prop="staff_type">
-                <el-select v-model="formmodel.staff_type" placeholder="请选择岗位类型" clearable>
-                  <el-option label="医生" :value="1" />
-                  <el-option label="护士" :value="2" />
-                  <el-option label="护工" :value="3" />
-                </el-select>
-              <!--                              <el-input clearable v-model="formmodel.staff_type" :maxlength="20" placeholder="请输入MEID"></el-input>-->
-              </el-form-item>
-            </el-col>
-          </el-row>
-
-          <el-row>
-            <el-col :span="12">
-              <el-form-item label="性别" prop="staff_sex">
-                <el-select v-model="formmodel.staff_sex" placeholder="请选择性别" clearable>
-                  <el-option label="男" :value="1" />
-                  <el-option label="女" :value="2" />
-                  <el-option label="未知" :value="3" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="生日" prop="staff_birthday">
-                <el-date-picker
-                  v-model="formmodel.staff_birthday"
-                  type="date"
-                  :editable="false"
-                  value-format="yyyy/MM/dd"
-                  placeholder="选择生日"
-                  :picker-options="{disabledDate(time) { return time.getTime() > Date.now() }}"
-                />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="12">
-              <el-form-item label="入职日期" prop="staff_workdate">
-                <el-date-picker
-                  v-model="formmodel.staff_workdate"
-                  type="date"
-                  :editable="false"
-                  value-format="yyyy/MM/dd"
-                  placeholder="选择入职日期"
-                  :picker-options="{disabledDate(time) { return time.getTime() > Date.now() }}"
-                />
-              </el-form-item>
-              <el-form-item label="手机号码" prop="staff_mobile">
-                <el-input v-model="formmodel.staff_mobile" clearable :maxlength="11" placeholder="请输入手机号码" />
-              </el-form-item>
-              <el-form-item label="工作电话" prop="staff_worktel">
-                <el-input v-model="formmodel.staff_worktel" clearable :maxlength="11" placeholder="请输入工作电话" />
-              </el-form-item>
-              <el-form-item label="身份识别号" prop="staff_passwordcard">
-                <el-input v-model="formmodel.staff_passwordcard" clearable placeholder="请输入身份识别号码" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="照片">
-                <el-upload
-                  class="avatar-uploader"
-                  :action="`${uploadServer}/mgr/staff/upload`"
-                  :show-file-list="false"
-                  :on-success="uploaded"
-                  :before-upload="handleShopLogoBefore"
-                >
-                  <img v-if="imageUrl" :src="imageUrl" class="avatar">
-                  <i v-else class="el-icon-plus avatar-uploader-icon" />
-                </el-upload>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-form-item label="简介">
-              <el-input
-                v-model="formmodel.staff_content"
-                type="textarea"
-                :rows="3"
-                placeholder="请输入内容"
-              />
-            </el-form-item>
-          </el-row>
-        </el-form>
-
-      </div>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="formshow = false">取 消</el-button>
-        <el-button type="primary" @click="handlerFormSubmit('editform')">确 定</el-button>
-      </div>
-    </el-dialog>
-
-  </div>
-</template>
-
-<script>
-import * as API_Staff from '@/api/calling-staff'
-var pinyin = require('pinyin')
-import { serverUrl } from '@/utils/domain'
-import * as RegExp from '@/utils/RegExp'
-export default {
-
-  name: 'Index',
-  data: function() {
-    var checkMobile = (rule, value, callback) => {
-      if (this.formmodel.staff_mobile && this.formmodel.staff_mobile !== '' && this.formmodel.staff_mobile !== null && !RegExp.mobile.test(value)) {
-        callback(new Error('请输入正确的手机号码'))
-      } else {
-        callback()
-      }
-    }
-    return {
-      /** 表格数据 */
-      tableData: [],
-      uploadServer: serverUrl,
-      imageUrl: null,
-      createform: {},
-      /** 表单数据 */
-      formmodel: {
-        staff_his_id: null,
-        staff_name: null,
-        staff_name_py: null,
-        staff_sex: null,
-        staff_mobile: null,
-        staff_birthday: null,
-        staff_idcard: null,
-        staff_workdate: null,
-        staff_passwordcard: null
-      },
-      /** 弹出窗口标题信息 */
-      formtitle: '新增职员',
-      formshow: false, // 编辑表单显示开关
-      /** 表单校验 */
-      rules: {
-        staff_workdate: [
-          { required: true, message: '请选择入职日期', trigger: 'blur' }
-        ],
-        staff_name: [
-          { required: true, message: '请输入姓名', trigger: 'blur' }
-        ],
-        staff_mobile: [
-          { validator: checkMobile, trigger: 'blur' }
-        ],
-        staff_sex: [
-          { required: true, message: '请选择性别', trigger: 'blur' }
-        ],
-        staff_type: [
-          { required: true, message: '请选择岗位类型', trigger: 'blur' }
-        ]
-      },
-      /** 列表参数 */
-      params: {
-        page_size: 20,
-        page_no: 1,
-        fixedCondition: 'PARTID=' + this.$store.getters.partId
-      },
-      /** 翻页数据*/
-      pageData: [],
-      loading: false,
-      /** 表格选中记录 */
-      multipleSelection: [],
-      /** 表单提交指示 0 代表新增 1代表修改 */
-      editflag: 0
-    }
-  },
-  computed: {
-    tableHeight() {
-      return this.mainAreaHeight - 130
-    }
-  },
-  mounted() {
-    this.getList()
-  },
-  methods: {
-    /** 新增按钮 */
-    handlerAdd: function() {
-      this.formmodel = {
-
-      }
-      if (this.$refs.editform) {
-        this.$refs.editform.resetFields()
-      }
-      this.imageUrl = null
-      if (this.$refs.editform) {
-        this.$refs.editform.resetFields()
-      }
-      this.editflag = 0
-      this.formtitle = '新增职员'
-      this.formshow = true
-    },
-    /** 编辑按钮 */
-    handlerEdit: function(index, row) {
-      if (this.$refs.editform) {
-        this.$refs.editform.resetFields()
-      }
-      this.formmodel = { ...row }
-      /** 转换照片显示 */
-      if (this.formmodel.staff_picture && this.formmodel.staff_picture !== '') {
-        this.imageUrl = serverUrl + '/' + this.formmodel.staff_picture
-      } else {
-        this.imageUrl = null
-      }
-      this.editflag = 1
-      this.formtitle = '修改职员'
-      this.formshow = true
-    },
-    /** 表格行选择变化记录选中行数据*/
-    selectFun: function(val) {
-      this.multipleSelection = val
-    },
-    /** 删除单条数据 */
-
-    handlerDelete(ids) {
-      this.$confirm('删除操作后数据不可复原,您确定要删除此数据?', '警告', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        API_Staff.remove(ids).then(
-          response => {
-            this.getList()
-            this.$message({
-              type: 'success',
-              message: '删除成功!'
-            })
-          }
-        ).catch(response => {
-          this.$message({
-            type: 'info',
-            message: response.message
-          })
-        })
-      }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: '已取消删除'
-        })
-      })
-    },
-    /** 批量数据删除处理(删除选中的行) */
-    batchDelete: function() {
-      if (this.multipleSelection.length === 0) {
-        this.$alert('没有选择任何记录!', '系统提示', {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
-      } else {
-        const ids = []
-        this.multipleSelection.forEach(function(item) {
-          ids.push(item.id)
-        })
-        this.handlerDelete(ids.join(','))
-      }
-    },
-    /** 分页大小发生改变 */
-    handlePageSizeChange(size) {
-      this.params.page_size = size
-      this.getList()
-    },
-
-    /** 分页页数发生改变 */
-    handlePageCurrentChange(page) {
-      this.params.page_no = page
-      this.getList()
-    },
-    /** 加载列表数据 */
-    getList() {
-      this.loading = true
-      const param = this.MixinClone(this.params)
-      API_Staff.getList(param).then(response => {
-        this.loading = false
-        this.tableData = [...response.data]
-        this.pageData = {
-          page_no: response.page_no,
-          page_size: response.page_size,
-          data_total: response.data_total
-        }
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-
-    /** 新增 提交表单 */
-    handlerFormSubmit(formName) {
-      this.$refs[formName].validate((valid) => {
-        if (valid) {
-          /** 新增 */
-          if (this.editflag === 0) {
-            this.formmodel.partid = this.$store.getters.partId
-            API_Staff.add(this.formmodel).then(() => {
-              this.formshow = false
-              this.$message.success('保存成功!')
-              this.getList()
-            }).catch(response => {
-              this.formshow = false
-              this.$message.error(response.message)
-              this.getList()
-            })
-          } else {
-            /** 修改 */
-            API_Staff.update(this.formmodel.id, this.formmodel).then(() => {
-              this.formshow = false
-              this.$message.success('修改成功!')
-              this.getList()
-            }).catch(response => {
-              this.formshow = false
-              this.$message.error(response.message)
-              this.getList()
-            })
-          }
-        }
-      })
-    },
-    formatterSex(row, column, cellValue) {
-      if (row.staff_sex === 1) {
-        return '男'
-      } else if (row.staff_sex === 2) {
-        return '女'
-      } else {
-        return '未知'
-      }
-    },
-    formatterStaffType(row, column, cellValue) {
-      if (row.staff_type === 1) {
-        return '医生'
-      } else if (row.staff_type === 2) {
-        return '护士'
-      } else {
-        return '护工'
-      }
-    },
-    /** 处理搜索 */
-    handlerSearch(keywords) {
-      this.params.query = keywords
-      this.getList()
-    },
-    /** 处理字段排序 */
-    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.getList()
-    },
-    /** 上传成功后的钩子 更换图片 置空存储数组*/
-    uploaded(response) {
-      this.imageUrl = serverUrl + '/' + response
-      this.formmodel.staff_picture = response
-    },
-    /** 图片上传之前的校验 */
-    handleShopLogoBefore(file) {
-      const isImg = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif'
-      const isLt2M = file.size / 1024 / 1024 < 2
-      if (!isImg) {
-        this.$message.error('上传头像图片只能是 JPG、PNG、GIF 格式!')
-      }
-      if (!isLt2M) {
-        this.$message.error('上传头像图片大小不能超过 2MB!')
-      }
-      return isImg && isLt2M
-    },
-    nameInput(e) {
-      const firstChar = pinyin(e, {
-        style: pinyin.STYLE_FIRST_LETTER, // 设置拼音风格
-        heteronym: true
-      }).join('').toUpperCase()
-      this.formmodel.staff_name_py = firstChar
-    }
-  }
-}
-</script>
-
-<style scoped>
-   /deep/ .avatar-uploader .el-upload {
-        border: 1px dashed #d9d9d9;
-        border-radius: 6px;
-        cursor: pointer;
-        position: relative;
-        overflow: hidden;
-    }
-    .avatar-uploader .el-upload:hover {
-        border-color: #409EFF;
-    }
-    .avatar-uploader-icon {
-        font-size: 28px;
-        color: #8c939d;
-        width: 178px;
-        height: 178px;
-        line-height: 178px;
-        text-align: center;
-    }
-    .avatar {
-        width: 178px;
-        height: 178px;
-        display: block;
-    }
-</style>

+ 372 - 375
src/views/customer/customerEdit.vue

@@ -2,16 +2,16 @@
   <div class="formwrap">
   <div class="formwrap">
     <el-tabs v-model="activeName" @tab-click="handleClick">
     <el-tabs v-model="activeName" @tab-click="handleClick">
       <el-tab-pane label="用户管理" name="customerEdit">
       <el-tab-pane label="用户管理" name="customerEdit">
-        <el-form ref="editForm" :model="formmodel" :rules="rules" label-width="140px">
+        <el-form :model="formmodel" :rules="rules" ref="editForm" label-width="140px">
           <el-row>
           <el-row>
             <el-col :span="8">
             <el-col :span="8">
               <el-form-item label="病人姓名" prop="named">
               <el-form-item label="病人姓名" prop="named">
-                <el-input v-model="formmodel.named" clearable placeholder="请输入姓名" :maxlength="20" />
+                <el-input v-model="formmodel.named" clearable placeholder="请输入姓名" :maxlength="20"></el-input>
               </el-form-item>
               </el-form-item>
             </el-col>
             </el-col>
             <el-col :span="8">
             <el-col :span="8">
               <el-form-item label="病人编号">
               <el-form-item label="病人编号">
-                <el-input v-model="formmodel.card_no" clearable placeholder="请输入病人编号" :maxlength="20" />
+                <el-input v-model="formmodel.card_no" clearable placeholder="请输入病人编号" :maxlength="20"></el-input>
               </el-form-item>
               </el-form-item>
             </el-col>
             </el-col>
             <el-col :span="8">
             <el-col :span="8">
@@ -53,31 +53,31 @@
           <el-row>
           <el-row>
             <el-col :span="8">
             <el-col :span="8">
               <el-form-item label="证件号">
               <el-form-item label="证件号">
-                <el-input v-model="formmodel.id_no" clearable placeholder="请输入证件号" :maxlength="20" />
+                <el-input v-model="formmodel.id_no" clearable placeholder="请输入证件号" :maxlength="20"></el-input>
               </el-form-item>
               </el-form-item>
             </el-col>
             </el-col>
             <el-col :span="8">
             <el-col :span="8">
               <el-form-item label="入院日期" prop="in_date">
               <el-form-item label="入院日期" prop="in_date">
                 <el-date-picker
                 <el-date-picker
-                  v-model="formmodel.in_date"
-                  type="date"
-                  :editable="false"
-                  value-format="timestamp"
-                  placeholder="选择入院日期"
-                  :picker-options="{disabledDate(time) { return time.getTime() > Date.now() }}"
-                />
+                        v-model="formmodel.in_date"
+                        type="date"
+                        :editable="false"
+                        value-format="timestamp"
+                        placeholder="选择入院日期"
+                        :picker-options="{disabledDate(time) { return time.getTime() > Date.now() }}">
+                </el-date-picker>
               </el-form-item>
               </el-form-item>
             </el-col>
             </el-col>
             <el-col :span="8">
             <el-col :span="8">
               <el-form-item label="出院日期" prop="out_date">
               <el-form-item label="出院日期" prop="out_date">
                 <el-date-picker
                 <el-date-picker
-                  v-model="formmodel.out_date"
-                  type="date"
-                  :editable="false"
-                  value-format="timestamp"
-                  placeholder="选择出院日期"
-                  :picker-options="{disabledDate(time) { return time.getTime() < Date.now() }}"
-                />
+                        v-model="formmodel.out_date"
+                        type="date"
+                        :editable="false"
+                        value-format="timestamp"
+                        placeholder="选择出院日期"
+                        :picker-options="{disabledDate(time) { return time.getTime() < Date.now() }}">
+                </el-date-picker>
               </el-form-item>
               </el-form-item>
             </el-col>
             </el-col>
           </el-row>
           </el-row>
@@ -85,22 +85,22 @@
           <el-row>
           <el-row>
             <el-col :span="8">
             <el-col :span="8">
               <el-form-item label="责任医生">
               <el-form-item label="责任医生">
-                <el-select v-model="formmodel.doctor_id" placeholder="请选择医生" @change="doctorChange(1)">
-                  <el-option v-for="(item,index) in doctors" :key="index" :label="item.clerk_name" :value="item.clerk_id" />
+                <el-select placeholder="请选择医生" v-model="formmodel.doctor_id" @change="doctorChange(1)">
+                  <el-option :label="item.clerk_name" :key="index" v-for="(item,index) in doctors" :value="item.clerk_id"></el-option>
                 </el-select>
                 </el-select>
               </el-form-item>
               </el-form-item>
             </el-col>
             </el-col>
             <el-col :span="8">
             <el-col :span="8">
               <el-form-item label="责任护士">
               <el-form-item label="责任护士">
-                <el-select v-model="formmodel.nurse_id" placeholder="请选择护士" @change="doctorChange(2)">
-                  <el-option v-for="(item,index) in nurses" :key="index" :label="item.clerk_name" :value="item.clerk_id" />
+                <el-select placeholder="请选择护士" v-model="formmodel.nurse_id" @change="doctorChange(2)">
+                  <el-option :label="item.clerk_name" :key="index" v-for="(item,index) in nurses" :value="item.clerk_id"></el-option>
                 </el-select>
                 </el-select>
               </el-form-item>
               </el-form-item>
             </el-col>
             </el-col>
             <el-col :span="8">
             <el-col :span="8">
               <el-form-item label="责任护工">
               <el-form-item label="责任护工">
-                <el-select v-model="formmodel.worker_id" placeholder="请选择护工" @change="doctorChange(3)">
-                  <el-option v-for="(item,index) in workrs" :key="index" :label="item.clerk_name" :value="item.clerk_id" />
+                <el-select placeholder="请选择护工" v-model="formmodel.worker_id" @change="doctorChange(3)">
+                  <el-option :label="item.clerk_name" :key="index" v-for="(item,index) in workrs" :value="item.clerk_id"></el-option>
                 </el-select>
                 </el-select>
               </el-form-item>
               </el-form-item>
             </el-col>
             </el-col>
@@ -109,7 +109,7 @@
           <el-row v-if="nurseData.length > 0">
           <el-row v-if="nurseData.length > 0">
             <el-col v-for="(item, index) in nurseList" :key="index" :span="24 / nurseList.length">
             <el-col v-for="(item, index) in nurseList" :key="index" :span="24 / nurseList.length">
               <el-form-item :label="item[0]">
               <el-form-item :label="item[0]">
-                <el-select v-model="nurseData[index].nurse_level" :placeholder="'请选择'+item[0]" @change="changeNurseData(index)">
+                <el-select :placeholder="'请选择'+item[0]" v-model="nurseData[index].nurse_level" @change="changeNurseData(index)">
                   <el-option v-for="(t,i) in item[1]" :key="i" :label="t.option_name" :value="t.id">
                   <el-option v-for="(t,i) in item[1]" :key="i" :label="t.option_name" :value="t.id">
                     <span style="float: left">{{ t.option_name }}</span>
                     <span style="float: left">{{ t.option_name }}</span>
                     <span :style="'float: right; background-color: #'+t.color_rgb+';color: #'+t.color_rgb">颜色</span>
                     <span :style="'float: right; background-color: #'+t.color_rgb+';color: #'+t.color_rgb">颜色</span>
@@ -123,89 +123,88 @@
             <el-col :span="16">
             <el-col :span="16">
               <el-form-item label="病况描述">
               <el-form-item label="病况描述">
                 <el-input
                 <el-input
-                  v-model="formmodel.illness_desc"
-                  type="textarea"
-                  :autosize="{ minRows: 2, maxRows: 4}"
-                  :minlength="2"
-                  :maxlength="50"
-                  :placeholder="'请输入文本内容,长度2~50'"
-                />
+                        type="textarea"
+                        :autosize="{ minRows: 2, maxRows: 4}"
+                        :minlength="2"
+                        :maxlength="50"
+                        :placeholder="'请输入文本内容,长度2~50'"
+                        v-model="formmodel.illness_desc">
+                </el-input>
               </el-form-item>
               </el-form-item>
             </el-col>
             </el-col>
           </el-row>
           </el-row>
 
 
           <el-form-item style="margin-top:15px;">
           <el-form-item style="margin-top:15px;">
-            <el-button type="primary" :disabled="isDisabled" class="save" @click="handlerSubmit('editForm')">保存修改</el-button>
+            <el-button type="primary" @click="handlerSubmit('editForm')" :disabled="isDisabled" class="save">保存修改</el-button>
           </el-form-item>
           </el-form-item>
         </el-form>
         </el-form>
 
 
         <el-card v-if="this.customerId != 0" style="maring:15px">
         <el-card v-if="this.customerId != 0" style="maring:15px">
           <div>
           <div>
-            <div style="float: left"><h4>用户备注</h4></div>
+            <div style="float: left"><h4 >用户备注</h4></div>
             <div style="float: right">
             <div style="float: right">
               <el-button type="success" @click="dialogAddVisible = true">添加备注</el-button>
               <el-button type="success" @click="dialogAddVisible = true">添加备注</el-button>
             </div>
             </div>
           </div>
           </div>
           <div style="clear:both">
           <div style="clear:both">
-            <div>
+            <div >
               <el-card v-for="(item, index) in tableData" :key="index">
               <el-card v-for="(item, index) in tableData" :key="index">
                 <div>
                 <div>
-                  <span style="margin-left: 20px;font-weight:bold">标签内容:</span><span style="line-height:1.5">{{ item.content }}</span>
+                  <span style="margin-left: 20px;font-weight:bold">标签内容:</span><span style="line-height:1.5">{{item.content}}</span>
                 </div>
                 </div>
                 <div style="margin: 10px">
                 <div style="margin: 10px">
                   <div style="float: left">
                   <div style="float: left">
-                    <span v-if="item.file_name">
-                      <el-link href="https://imgm.gmw.cn/attachement/jpg/site215/20210309/4101699327084478802.jpg" icon="el-icon-folder" type="success" target="_blank" :download="item.file_name">{{ item.file_name }}</el-link>
-                    </span>
+                <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>
                   <div style="float: right">
                   <div style="float: right">
                     <p>
                     <p>
-                      <span style="font-weight:bold">创建时间:</span>{{ forDate(item.create_time) }}
-                      <span style="font-weight:bold;margin-left: 10px;">创建人:</span>{{ item.create_name }}
+                      <span style="font-weight:bold">创建时间:</span>{{forDate(item.create_time)}}
+                      <span style="font-weight:bold;margin-left: 10px;">创建人:</span>{{item.create_name}}
                     </p>
                     </p>
                   </div>
                   </div>
                 </div>
                 </div>
               </el-card>
               </el-card>
               <!--翻页-->
               <!--翻页-->
               <el-pagination
               <el-pagination
-                v-if="pageData"
-                slot="pagination"
-                :current-page="pageData.page_no"
-                :page-sizes="[10, 30, 50, 100]"
-                :page-size="pageData.page_size"
-                layout="total, sizes, prev, pager, next, jumper"
-                :total="pageData.data_total"
-                @size-change="handlePageSizeChange"
-                @current-change="handlePageCurrentChange"
-              />
+                      slot="pagination"
+                      v-if="pageData"
+                      :current-page="pageData.page_no"
+                      :page-sizes="[10, 30, 50, 100]"
+                      :page-size="pageData.page_size"
+                      @size-change="handlePageSizeChange"
+                      @current-change="handlePageCurrentChange"
+                      layout="total, sizes, prev, pager, next, jumper"
+                      :total="pageData.data_total">
+              </el-pagination>
             </div>
             </div>
           </div>
           </div>
         </el-card>
         </el-card>
         <el-dialog title="添加用户备注" :visible.sync="dialogAddVisible" :append-to-body="true" width="80%">
         <el-dialog title="添加用户备注" :visible.sync="dialogAddVisible" :append-to-body="true" width="80%">
-          <el-form ref="editForm" :model="formmodel" :rules="rules" label-width="140px">
+          <el-form :model="formmodel" :rules="rules" ref="editForm" label-width="140px">
             <el-form-item label="内容">
             <el-form-item label="内容">
               <el-input
               <el-input
-                v-model="content"
-                type="textarea"
-                :autosize="{ minRows: 2, maxRows: 6}"
-                :minlength="2"
-                :maxlength="300"
-                show-word-limit
-                :placeholder="'请输入文本内容,长度300'"
-              />
+                      type="textarea"
+                      :autosize="{ minRows: 2, maxRows: 6}"
+                      :minlength="2"
+                      :maxlength="300"
+                      show-word-limit
+                      :placeholder="'请输入文本内容,长度300'"
+                      v-model="content">
+              </el-input>
             </el-form-item>
             </el-form-item>
             <el-form-item label="复件">
             <el-form-item label="复件">
-              <el-upload
-                v-if="!fileName"
-                class="avatar-uploader"
-                :action="`${uploadServer}/ncs/remark/upload`"
-                :show-file-list="false"
-                :on-success="uploaded"
-                :before-upload="handleShopLogoBefore"
+              <el-upload v-if="!fileName"
+                         class="avatar-uploader"
+                         :action="`${uploadServer}/ncs/remark/upload`"
+                         :show-file-list="false"
+                         :on-success="uploaded"
+                         :before-upload="handleShopLogoBefore"
               >
               >
                 <i class="el-icon-plus avatar-uploader-icon" />
                 <i class="el-icon-plus avatar-uploader-icon" />
               </el-upload>
               </el-upload>
-              <span v-if="fileName">{{ fileName }}</span>
+              <span v-if="fileName">{{fileName}}</span>
             </el-form-item>
             </el-form-item>
             <el-form-item>
             <el-form-item>
               <el-button type="primary" @click="addRemark">立即添加</el-button>
               <el-button type="primary" @click="addRemark">立即添加</el-button>
@@ -215,7 +214,7 @@
         </el-dialog>
         </el-dialog>
       </el-tab-pane>
       </el-tab-pane>
       <el-tab-pane v-if="customerId != 0" label="病人亲属" name="customer-relative">
       <el-tab-pane v-if="customerId != 0" label="病人亲属" name="customer-relative">
-        <customer-relative :member-id="memberId" />
+        <customer-relative :member-id="memberId"></customer-relative>
       </el-tab-pane>
       </el-tab-pane>
     </el-tabs>
     </el-tabs>
 
 
@@ -224,333 +223,331 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import * as customer_API from '@/api/ncs_customer'
-import * as clerk_API from '@/api/ncs_clerk'
-import * as NurseConfig_API from '@/api/ncs_nurseConfig'
-import * as remark_API from '@/api/ncs_remark'
-import * as RegExp from '@/utils/RegExp'
-import { unixToDate } from '@/utils/Foundation'
-import { serverUrl } from '@/utils/domain'
-import customerRelative from '@/views/customer/customer_relative'
+  import * as customer_API from '@/api/ncs_customer'
+  import * as clerk_API from '@/api/ncs_clerk'
+  import * as NurseConfig_API from '@/api/ncs_nurse_config'
+  import * as remark_API from '@/api/ncs_remark'
+  import * as RegExp from '@/utils/RegExp'
+  import { unixToDate } from '@/utils/Foundation'
+  import { serverUrl } from '@/utils/domain'
+  import customerRelative from '@/views/customer/customer_relative'
 
 
-export default {
-  name: 'PatientInfoEdit',
-  components: { customerRelative },
-  props: {
-    customerId: {
-      type: Number,
-      default: 0
-    },
-    frameId: {
-      type: Number,
-      default: 0
-    }
-  },
-  data: function() {
-    return {
-      formmodel: {
-        sex: 1,
-        status: 0,
-        age_unit: '岁',
-        id_type: '身份证',
-        part_id: this.$store.getters.partId
+  export default {
+    components: { customerRelative },
+    name: 'patientInfoEdit',
+    props: {
+      customerId: {
+        type: Number,
+        default: 0
       },
       },
-      nurseList: [],
-      nurseData: [],
-      nurseConfigDtos: [],
-      rules: {
-        named: [
-          this.MixinRequired('请输入真实姓名!'),
-          { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' },
-          {
-            validator: (rule, value, callback) => {
-              if (!RegExp.userName.test(value)) {
-                callback(new Error('只支持汉字、字母、数字、“-”、“_”的组合!'))
-              } else {
-                callback()
+      frameId: {
+        type: Number,
+        default: 0
+      }
+    },
+    data: function() {
+      return {
+        formmodel: {
+          sex: 1,
+          status: 0,
+          age_unit: '岁',
+          id_type: '身份证',
+          part_id: this.$store.getters.partId
+        },
+        nurseList: [],
+        nurseData: [],
+        nurseConfigDtos: [],
+        rules: {
+          named: [
+            this.MixinRequired('请输入真实姓名!'),
+            { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' },
+            {
+              validator: (rule, value, callback) => {
+                if (!RegExp.userName.test(value)) {
+                  callback(new Error('只支持汉字、字母、数字、“-”、“_”的组合!'))
+                } else {
+                  callback()
+                }
               }
               }
             }
             }
-          }
-        ],
-        age: [{
-          required: true, message: '请输入年龄', trigger: 'blur'
-        }],
-        content: [{
-          required: true, message: '请输入备注内容', trigger: 'blur'
-        }]
-      },
-      isDisabled: false,
-      doctors: [],
-      nurses: [],
-      workrs: [],
-      doctor_mapping_id: false,
-      nurse_Mapping_id: false,
-      worker_mapping_id: false,
-      params: {
-        page_size: 10,
-        page_no: 1,
-        sort: 'create_time',
-        dir: 'desc'
-      },
-      tableData: [],
-      pageData: [],
-      dialogAddVisible: false,
-      fileName: null,
-      filePath: null,
-      uploadServer: serverUrl,
-      userInfo: JSON.parse(this.$store.getters.userInfo),
-      content: null,
-      activeName: 'customerEdit',
-      memberId: null
-    }
-  },
-  watch: {
-    frameId: function(newval) {
-      this.getNurseConfigs()
-      this.hasCustomerId()
-    }
-  },
-  mounted() {
-    this.getEmployees()
-    if (this.nurseList.length === 0) {
-      this.getNurseConfigs()
-      this.hasCustomerId()
-    }
-    console.log('params',this.params)
-  },
-
-  methods: {
-    getEmployees() {
-      const _this = this
-      clerk_API.listByPartRoleId({ partId: this.$store.getters.partId }).then(res => {
-        const groupBy = (arr, func) =>
-          arr.map(typeof func === 'function' ? func : val => val[func]).reduce((acc, val, i) => {
-            acc[val] = (acc[val] || []).concat(arr[i])
-            return acc
-          }, {})
-        const groupData = groupBy(res, item => item.role_name)
-        if (Object.entries(groupData).length > 0) {
-          Object.entries(groupData).forEach(item => {
-            if (item[0] === '医生') {
-              _this.doctors = item[1]
-            } else if (item[0] === '护士') {
-              _this.nurses = item[1]
-            } else if (item[0] === '护工') {
-              _this.workrs = item[1]
-            }
-          })
-        }
-      })
+          ],
+          age: [{
+            required: true, message: '请输入年龄', trigger: 'blur'
+          }],
+          content: [{
+            required: true, message: '请输入备注内容', trigger: 'blur'
+          }],
+        },
+        isDisabled: false,
+        doctors: [],
+        nurses: [],
+        workrs: [],
+        doctor_mapping_id: false,
+        nurse_Mapping_id: false,
+        worker_mapping_id: false,
+        params: {
+          page_size: 10,
+          page_no: 1,
+          sort: 'create_time',
+          dir: 'desc'
+        },
+        tableData: [],
+        pageData: [],
+        dialogAddVisible: false,
+        fileName: null,
+        filePath: null,
+        uploadServer: serverUrl,
+        userInfo: JSON.parse(this.$store.getters.userInfo),
+        content: null,
+        activeName: 'customerEdit',
+        memberId: null
+      }
     },
     },
-    getNurseConfigs() {
-      this.nurseData = []
-      const _this = this
-      NurseConfig_API.listByPartId({ partId: this.$store.getters.partId }).then(res => {
-        const groupBy = (arr, func) =>
-          arr.map(typeof func === 'function' ? func : val => val[func]).reduce((acc, val, i) => {
-            acc[val] = (acc[val] || []).concat(arr[i])
-            return acc
-          }, {})
-          // 以参数名称来分组
-        const groupData = groupBy(res, item => item.config_name)
-        _this.nurseList = Object.entries(groupData)
-        console.log(_this.nurseList)
-        if (_this.nurseList.length > 0) {
-          _this.nurseList.forEach((item, index) => {
-            _this.nurseData.push({ nurse_level: null, id: null, nurse_config: item[1][0].ncfg_id })
-          })
-        }
-      })
+    mounted() {
+      this.getEmployees()
+      if (this.nurseList.length === 0) {
+        this.getNurseConfigs()
+        this.hasCustomerId()
+      }
     },
     },
-    hasCustomerId() {
-      this.clearForm()
-      if (this.customerId !== 0) {
-        const _this = this
-        customer_API.getCustomerInfo(this.customerId).then(res => {
-          _this.formmodel = res
-          _this.doctor_mapping_id = res.doctor_mapping_id
-          _this.nurse_Mapping_id = res.nurse_Mapping_id
-          _this.worker_mapping_id = res.worker_mapping_id
-          _this.formmodel.doctor_mapping_id = null
-          _this.formmodel.nurse_Mapping_id = null
-          _this.formmodel.worker_mapping_id = null
-          _this.getRemarks()
-          if (res.list !== null) {
-            _this.nurseData.forEach((item, index) => {
-              res.list.forEach((t, i) => { // 为护理项赋值
-                if (item.nurse_config === t.nurse_config) {
-                  item.nurse_level = t.nurse_level
-                  item.id = t.id
-                }
-              })
-            })
-          }
-        })
+    watch: {
+      frameId: function(newval) {
+        this.getNurseConfigs()
+        this.hasCustomerId()
       }
       }
     },
     },
-    doctorChange(type) {
-      if (this.customerId !== 0) {
-        if (type === 1) {
-          if (this.doctor_mapping_id === null) {
-            this.formmodel.doctor_mapping_id = 0 // 为0则新增,// 其他值为修改
-          } else {
-            this.formmodel.doctor_mapping_id = this.doctor_mapping_id
+
+    methods: {
+      getEmployees() {
+        let _this = this
+        clerk_API.listByPartRoleId({partId: this.$store.getters.partId}).then(res => {
+          const groupBy = (arr, func) =>
+                  arr.map(typeof func === 'function' ? func : val => val[func]).reduce((acc, val, i) => {
+                    acc[val] = (acc[val] || []).concat(arr[i]);
+                    return acc;
+                  }, {});
+          let groupData = groupBy(res, item => item.role_name)
+          if (Object.entries(groupData).length > 0) {
+            Object.entries(groupData).forEach(item=> {
+              if (item[0] === '医生') {
+                _this.doctors = item[1]
+              } else if (item[0] === '护士') {
+                _this.nurses = item[1]
+              } else if (item[0] === '护工'){
+                _this.workrs = item[1]
+              }
+            })
           }
           }
-        } else if (type === 2) {
-          if (this.nurse_Mapping_id === null) {
-            this.formmodel.nurse_Mapping_id = 0 // 为0则新增,// 其他值为修改
-          } else {
-            this.formmodel.nurse_Mapping_id = this.nurse_Mapping_id
+        })
+      },
+      getNurseConfigs() {
+        this.nurseData = []
+        let _this = this
+        NurseConfig_API.listByPartId({partId: this.$store.getters.partId}).then(res => {
+          const groupBy = (arr, func) =>
+                  arr.map(typeof func === 'function' ? func : val => val[func]).reduce((acc, val, i) => {
+                    acc[val] = (acc[val] || []).concat(arr[i]);
+                    return acc;
+                  }, {});
+          // 以参数名称来分组
+          let groupData = groupBy(res, item => item.config_name)
+          _this.nurseList = Object.entries(groupData)
+          if (_this.nurseList.length > 0) {
+            _this.nurseList.forEach((item, index)=> {
+              _this.nurseData.push({nurse_level: null, id: null, nurse_config: item[1][0].ncfg_id})
+            })
           }
           }
-        } else {
-          if (this.worker_mapping_id === null) {
-            this.formmodel.worker_mapping_id = 0 // 为0则新增,// 其他值为修改
+
+        })
+      },
+      hasCustomerId() {
+        this.clearForm()
+        if (this.customerId !== 0) {
+          let _this = this
+          customer_API.getCustomerInfo(this.customerId).then(res => {
+            _this.formmodel = res
+            _this.doctor_mapping_id = res.doctor_mapping_id
+            _this.nurse_Mapping_id = res.nurse_Mapping_id
+            _this.worker_mapping_id = res.worker_mapping_id
+            _this.formmodel.doctor_mapping_id = null
+            _this.formmodel.nurse_Mapping_id = null
+            _this.formmodel.worker_mapping_id = null
+            _this.getRemarks()
+            if (res.list !== null) {
+              _this.nurseData.forEach((item, index)=> {
+                res.list.forEach((t, i)=> { // 为护理项赋值
+                  if (item.nurse_config === t.nurse_config) {
+                    item.nurse_level = t.nurse_level
+                    item.id = t.id
+                  }
+                })
+              })
+            }
+
+          })
+        }
+
+      },
+      doctorChange(type) {
+        if (this.customerId !== 0) {
+          if (type === 1) {
+            if (this.doctor_mapping_id === null) {
+              this.formmodel.doctor_mapping_id = 0 // 为0则新增,// 其他值为修改
+            } else {
+              this.formmodel.doctor_mapping_id = this.doctor_mapping_id
+            }
+          } else if (type === 2) {
+            if (this.nurse_Mapping_id === null) {
+              this.formmodel.nurse_Mapping_id = 0 // 为0则新增,// 其他值为修改
+            } else {
+              this.formmodel.nurse_Mapping_id = this.nurse_Mapping_id
+            }
           } else {
           } else {
-            this.formmodel.worker_mapping_id = this.worker_mapping_id
+            if (this.worker_mapping_id === null) {
+              this.formmodel.worker_mapping_id = 0 // 为0则新增,// 其他值为修改
+            } else {
+              this.formmodel.worker_mapping_id = this.worker_mapping_id
+            }
           }
           }
         }
         }
-      }
-    },
-    /** 保存按钮处理事件 */
-    handlerSubmit(formName) {
-      this.$refs[formName].validate(valid => {
-        if (valid) {
-          this.isDisabled = true
-          if (this.customerId === 0) {
-            this.formmodel.frame_id = this.frameId
-            this.formmodel.list = this.nurseConfigDtos
-            customer_API.addAll(this.formmodel).then(res => {
-              this.$message.success('添加成功!')
-              this.clearForm()
-              this.$emit('saved')
-            }).catch(e => {
-              this.isDisabled = false
-            })
+      },
+      /** 保存按钮处理事件 */
+      handlerSubmit(formName) {
+        this.$refs[formName].validate(valid => {
+          if (valid) {
+            this.isDisabled = true
+            if (this.customerId === 0) {
+              this.formmodel.frame_id = this.frameId
+              this.formmodel.list = this.nurseConfigDtos
+              customer_API.addAll(this.formmodel).then(res => {
+                this.$message.success('添加成功!')
+                this.clearForm()
+                this.$emit('saved')
+              }).catch( e =>{
+                this.isDisabled = false
+              })
+            } else {
+              this.formmodel.list = this.nurseConfigDtos
+              customer_API.updateAll(this.formmodel).then(res => {
+                this.$message.success('修改成功!')
+                this.isDisabled = false
+                this.$emit('saved')
+              })
+            }
           } else {
           } else {
-            this.formmodel.list = this.nurseConfigDtos
-            customer_API.updateAll(this.formmodel).then(res => {
-              this.$message.success('修改成功!')
-              this.isDisabled = false
-              this.$emit('saved')
-            })
+            this.$message.error('表单填写有误,请检查!')
+            return false
           }
           }
-        } else {
-          this.$message.error('表单填写有误,请检查!')
-          return false
-        }
-      })
-    },
-    clearForm() {
-      this.activeName = 'customerEdit'
-      this.formmodel = {
-        sex: 1,
-        status: 0,
-        age_unit: '岁',
-        id_type: '身份证',
-        part_id: this.$store.getters.partId,
-        named: null,
-        card_no: null,
-        id_no: null,
-        in_date: null,
-        out_date: null,
-        doctor_id: null,
-        nurse_id: null,
-        worker_id: null,
-        illness_desc: null
-      }
-      this.isDisabled = false
-      this.nurseConfigDtos = []
-    },
-    // 选择了护理项
-    changeNurseData(index) {
-      const i = this.nurseConfigDtos.findIndex(item => {
-        return item.nurse_level === this.nurseData[index].nurse_level
-      })
-      if (i !== -1) {
-        this.nurseConfigDtos.splice(i, 1)
-      }
-      this.nurseConfigDtos.push(this.nurseData[index])
-    },
-    getRemarks() {
-      console.log('this.formmodel.member_id=', this.formmodel.member_id)
-      const _this = this
-      console.log('this',_this.params)
-      this.params.fixedCondition = ' part_id=' + this.$store.getters.partId + ' and type=1 and member_id = ' + this.formmodel.member_id
-      remark_API.getRemarks(this.params).then(res => {
-        _this.tableData = res.data
-        _this.pageData = {
-          page_no: res.page_no,
-          page_size: res.page_size,
-          data_total: res.data_total
+        })
+      },
+      clearForm() {
+        this.activeName = 'customerEdit'
+        this.formmodel = {
+          sex: 1,
+          status: 0,
+          age_unit: '岁',
+          id_type: '身份证',
+          part_id: this.$store.getters.partId,
+          named: null,
+          card_no: null,
+          id_no: null,
+          in_date: null,
+          out_date: null,
+          doctor_id: null,
+          nurse_id: null,
+          worker_id: null,
+          illness_desc: null
         }
         }
-      })
-    },
-    /** 分页大小发生改变 */
-    handlePageSizeChange(size) {
-      this.params.page_size = size
-      this.getRemarks()
-    },
-    /** 分页页数发生改变 */
-    handlePageCurrentChange(page) {
-      this.params.page_no = page
-      this.getRemarks()
-    },
-    forDate(date) {
-      return unixToDate(date)
-    },
-    /** 上传成功后的钩子 更换图片 置空存储数组*/
-    uploaded(res) {
-      this.filePath = serverUrl + '/' + res.file_path
-      this.fileName = res.file_name
-    },
-    /** 图片上传之前的校验 */
-    handleShopLogoBefore(file) {
-      return new Promise((resolve, reject) => {
-        let hz = file.name
-        const index = hz.lastIndexOf('.')
-        hz = hz.substring(index + 1, hz.length)
-        console.log(hz)
-        const isImg = hz === 'jpeg' || hz === 'png' || hz === 'jpg' || hz === 'txt' || hz === 'doc' || hz === 'docx' || hz === 'xls' || hz === 'xlsx'
-        const isLt5M = file.size / 1024 / 1024 < 5
-        if (!isImg) {
-          this.$message.error('上传复件只能是txt,doc,docx,xls,xlsx,jpg,png,jpeg格式!')
-          reject()
+        this.isDisabled = false
+        this.nurseConfigDtos = []
+      },
+      // 选择了护理项
+      changeNurseData(index) {
+        let i = this.nurseConfigDtos.findIndex(item => {
+          return item.nurse_level === this.nurseData[index].nurse_level;
+        })
+        if (i !== -1) {
+          this.nurseConfigDtos.splice(i,1)
         }
         }
-        if (!isLt5M) {
-          this.$message.error('上传复件大小不能超过 5MB!')
-          reject()
+        this.nurseConfigDtos.push(this.nurseData[index])
+      },
+      getRemarks() {
+        let _this = this
+        this.params.fixedCondition = ' part_id=' + this.$store.getters.partId + ' and type=1 and member_id = '+ this.formmodel.member_id
+        remark_API.getRemarks(this.params).then(res=> {
+          _this.tableData = res.data
+          _this.pageData = {
+            page_no: res.page_no,
+            page_size: res.page_size,
+            data_total: res.data_total
+          }
+        })
+      },
+      /** 分页大小发生改变 */
+      handlePageSizeChange(size) {
+        this.params.page_size = size
+        this.getRemarks()
+      },
+      /** 分页页数发生改变 */
+      handlePageCurrentChange(page) {
+        this.params.page_no = page
+        this.getRemarks()
+      },
+      forDate(date) {
+        return unixToDate(date)
+      },
+      /** 上传成功后的钩子 更换图片 置空存储数组*/
+      uploaded(res) {
+        this.filePath = serverUrl + '/' + res.file_path
+        this.fileName = res.file_name
+      },
+      /** 图片上传之前的校验 */
+      handleShopLogoBefore(file) {
+        return new Promise((resolve, reject) => {
+          let hz = file.name
+          let index = hz .lastIndexOf(".");
+          hz  = hz .substring(index + 1, hz .length);
+          const isImg = hz === 'jpeg' || hz === 'png' || hz === 'jpg' || hz === 'txt'  || hz === 'doc' || hz === 'docx' || hz === 'xls' || hz === 'xlsx'
+          const isLt5M = file.size / 1024 / 1024 < 5
+          if (!isImg) {
+            this.$message.error('上传复件只能是txt,doc,docx,xls,xlsx,jpg,png,jpeg格式!')
+            reject()
+          }
+          if (!isLt5M) {
+            this.$message.error('上传复件大小不能超过 5MB!')
+            reject()
+          }
+          resolve()
+        })
+      },
+      addRemark() {
+        const data = {
+          partId: this.$store.getters.partId,
+          type: 1,
+          memberId: this.formmodel.member_id,
+          createName: this.userInfo.username,
+          content: this.content,
+          filePath: this.filePath,
+          fileName: this.fileName
         }
         }
-        resolve()
-      })
-    },
-    addRemark() {
-      const data = {
-        partId: this.$store.getters.partId,
-        type: 1,
-        memberId: this.formmodel.member_id,
-        createName: this.userInfo.username,
-        content: this.content,
-        filePath: this.filePath,
-        fileName: this.fileName
+        let _this = this
+        remark_API.save(data).then(res=> {
+          _this.$message.success('添加成功!')
+          _this.getRemarks()
+          _this.quxiao()
+        })
+      },
+      quxiao(){
+        this.dialogAddVisible = false
+        this.content = null
+        this.fileName = null
+        this.filePath = null
+      },
+      handleClick(tab) {
+        this.memberId = this.formmodel.member_id
       }
       }
-      const _this = this
-      remark_API.save(data).then(res => {
-        _this.$message.success('添加成功!')
-        _this.getRemarks()
-        _this.quxiao()
-      })
-    },
-    quxiao() {
-      this.dialogAddVisible = false
-      this.content = null
-      this.fileName = null
-      this.filePath = null
-    },
-    handleClick(tab) {
-      this.memberId = this.formmodel.member_id
     }
     }
   }
   }
-}
 </script>
 </script>
 
 
 <style type="text/scss" scoped>
 <style type="text/scss" scoped>

+ 10 - 3
src/views/customer/customer_relative.vue

@@ -24,7 +24,7 @@
         <el-table-column type="selection" width="55" align="center"></el-table-column>
         <el-table-column type="selection" width="55" align="center"></el-table-column>
         <el-table-column prop="nickname" label="姓名" align="center"></el-table-column>
         <el-table-column prop="nickname" label="姓名" align="center"></el-table-column>
         <el-table-column prop="relative_name" label="亲属称呼" align="center"></el-table-column>
         <el-table-column prop="relative_name" label="亲属称呼" align="center"></el-table-column>
-        <el-table-column prop="sex" label="性别" align="center"></el-table-column>
+        <el-table-column prop="sex" label="性别" align="center" :formatter="formatterSex"></el-table-column>
         <el-table-column prop="mobile" label="手机" align="center"></el-table-column>
         <el-table-column prop="mobile" label="手机" align="center"></el-table-column>
         <el-table-column label="操作" width="120">
         <el-table-column label="操作" width="120">
           <template slot-scope="scope">
           <template slot-scope="scope">
@@ -155,11 +155,9 @@
       // if (this.memberId) {
       // if (this.memberId) {
       //   this.GET_List()
       //   this.GET_List()
       // }
       // }
-      console.log('memberId=',this.memberId)
     },
     },
     watch: {
     watch: {
       memberId: function() {
       memberId: function() {
-        console.log('this.memberId=',this.memberId)
         if (this.memberId) {
         if (this.memberId) {
           this.GET_List()
           this.GET_List()
         }
         }
@@ -252,6 +250,15 @@
         this.formmodel = {
         this.formmodel = {
           sex: 1
           sex: 1
         }
         }
+      },
+      formatterSex(row, column, cellValue) {
+        if (row.sex === 1) {
+          return '男'
+        } else if (row.sex === 2) {
+          return '女'
+        } else {
+          return '未知'
+        }
       }
       }
     }
     }
   }
   }

+ 18 - 13
src/views/hospitalFrame/hospitalFrame.vue

@@ -34,22 +34,27 @@
           <div v-for="(subItem, i) in item.frame_bed_vos" :key="i" class="param-item">
           <div v-for="(subItem, i) in item.frame_bed_vos" :key="i" class="param-item">
             <span><i class="el-icon-s-flag"></i> {{ subItem.frame_bed.name }} 床</span>
             <span><i class="el-icon-s-flag"></i> {{ subItem.frame_bed.name }} 床</span>
             <span v-if="subItem.customer_id">
             <span v-if="subItem.customer_id">
-              <el-button size="mini" plain round @click="handleEditPatient(subItem.customer_id,subItem.frame_bed.id)"><i class="el-icon-user"></i> {{ subItem.customer_name}}</el-button>
+              <el-button style="width: 150px;" size="mini" plain round @click="handleEditPatient(subItem.customer_id,subItem.frame_bed.id)">
+                <i class="el-icon-user"></i> {{ subItem.customer_name+ ' '+ subItem.customer_age+subItem.customer_age_unit}}
+                <span v-if="subItem.customer_sex === 1">男</span>
+                <span v-else-if="subItem.customer_sex === 2">女</span>
+                <span v-else>未知</span>
+              </el-button>
             </span>
             </span>
             <span v-else>
             <span v-else>
-          <el-button size="mini" type="success" plain round @click="handleAddPatient(subItem.frame_bed)"><i class="el-icon-circle-plus-outline"></i> 病人</el-button>
-        </span>
+              <el-button size="mini" type="success" plain round @click="handleAddPatient(subItem.frame_bed)"><i class="el-icon-circle-plus-outline"></i> 病人</el-button>
+            </span>
             <span>
             <span>
-          <el-dropdown size="mini" @command="handleGroupCommand">
-            <span class="el-dropdown-link">操作<i class="el-icon-arrow-down el-icon--right"></i></span>
-            <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item :command="{type: 'edit', frame: subItem.frame_bed}">编辑</el-dropdown-item>
-              <el-dropdown-item :command="{type: 'delete', frame: subItem.frame_bed}" style="color: #F56C6C">删除</el-dropdown-item>
-              <el-dropdown-item :command="{type: 'device', frame: subItem.frame_bed}" divided><i class="el-icon-cpu"></i> 设备 {{subItem.device_count}}
-              </el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-        </span>
+              <el-dropdown size="mini" @command="handleGroupCommand">
+                <span class="el-dropdown-link">操作<i class="el-icon-arrow-down el-icon--right"></i></span>
+                <el-dropdown-menu slot="dropdown">
+                  <el-dropdown-item :command="{type: 'edit', frame: subItem.frame_bed}">编辑</el-dropdown-item>
+                  <el-dropdown-item :command="{type: 'delete', frame: subItem.frame_bed}" style="color: #F56C6C">删除</el-dropdown-item>
+                  <el-dropdown-item :command="{type: 'device', frame: subItem.frame_bed}" divided><i class="el-icon-cpu"></i> 设备 {{subItem.device_count}}
+                  </el-dropdown-item>
+                </el-dropdown-menu>
+              </el-dropdown>
+            </span>
           </div>
           </div>
           <el-button type="text" class="add-params-btn" @click="handleAddFrame(item.frame_room.id)"><i class="el-icon-circle-plus"></i> 添加床位</el-button>
           <el-button type="text" class="add-params-btn" @click="handleAddFrame(item.frame_room.id)"><i class="el-icon-circle-plus"></i> 添加床位</el-button>
         </template>
         </template>

+ 67 - 32
src/views/calling-calllist/index.vue

@@ -13,7 +13,20 @@
       <!--工具栏-->
       <!--工具栏-->
       <div slot="toolbar" class="inner-toolbar">
       <div slot="toolbar" class="inner-toolbar">
         <div class="toolbar-search">
         <div class="toolbar-search">
-          <en-table-search placeholder="请输入搜索关键字" @search="handlerSearch" />
+<!--          <en-table-search placeholder="请输入搜索关键字" @search="handlerSearch" />-->
+          <el-form ref="editform" label-width="120px">
+            <el-form-item label="呼叫类型">
+              <el-select v-model="callingType" placeholder="请选择设备类型" clearable @change="handlerSearch">
+                <el-option label="病房普通呼叫" :value="1" />
+                <el-option label="门口机呼叫" :value="2" />
+                <el-option label="卫生间紧急呼叫" :value="3" />
+                <el-option label="请求增援" :value="4" />
+                <el-option label="优先呼叫" :value="5" />
+                <el-option label="关系人电话呼叫" :value="6" />
+              </el-select>
+            </el-form-item>
+          </el-form>
+
         </div>
         </div>
         <div class="toolbar-btns">
         <div class="toolbar-btns">
 
 
@@ -32,13 +45,6 @@
                 :default-time="['00:00:00', '23:59:59']"
                 :default-time="['00:00:00', '23:59:59']"
                 @change="dateRangeChange"
                 @change="dateRangeChange"
               />
               />
-              <!--          <el-date-picker-->
-              <!--                  v-model="searchDateRange"-->
-              <!--                  type="daterange"-->
-              <!--                  start-placeholder="开始日期"-->
-              <!--                  end-placeholder="结束日期"-->
-              <!--                  :default-time="['00:00:00', '23:59:59']">-->
-              <!--          </el-date-picker>-->
               <el-button style="margin-left: 20px" type="danger" @click="clearRecord">清空记录</el-button>
               <el-button style="margin-left: 20px" type="danger" @click="clearRecord">清空记录</el-button>
             </el-form-item>
             </el-form-item>
 
 
@@ -52,22 +58,16 @@
           width="55"
           width="55"
           align="center"
           align="center"
         />
         />
-
-        <el-table-column prop="id" sortable="custom" label="ID" width="100" align="center" />
-        <el-table-column prop="calllist_content" sortable="custom" label="呼叫内容" width="320" align="center" />
         <el-table-column prop="calllist_type" sortable="custom" label="呼叫类型" width="160" align="center" :formatter="formatterCallType" />
         <el-table-column prop="calllist_type" sortable="custom" label="呼叫类型" width="160" align="center" :formatter="formatterCallType" />
-        <el-table-column prop="calllist_datetime" sortable="custom" label="呼叫时间" width="200" align="center" />
-        <el-table-column prop="calllist_text" sortable="custom" label="呼叫代码" align="center" />
-
-        <el-table-column
-          label="操作"
-          align="center"
-          width="160"
-        >
+        <el-table-column prop="content" label="呼叫内容" width="320" align="center" />
+        <el-table-column prop="create_time" sortable="custom" label="呼叫时间" width="170" align="center" :formatter="formatterCreateTime" />
+        <el-table-column prop="calling_text" label="呼叫代码" align="center" />
+        <el-table-column prop="calling_direct" sortable="custom" label="呼叫方向" align="center" :formatter="formatterCallDirect" />
+        <el-table-column prop="nickname" label="呼叫人" align="center" />
+        <el-table-column prop="calling_time" sortable="custom" label="是否接听" align="center" :formatter="formatterCallTime" />
+        <el-table-column label="操作" align="center" width="100">
           <template slot-scope="scope">
           <template slot-scope="scope">
-            <el-button type="danger" size="mini" @click="handlerDelete(scope.row.id)">
-              删除
-            </el-button>
+            <el-button type="danger" size="mini" @click="handlerDelete(scope.row.id)">删除</el-button>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
 
 
@@ -91,7 +91,8 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import * as API_CallingList from '@/api/calling-list'
+import * as API_CallingList from '@/api/ncs_calling_history'
+import { unixToDate } from '@/utils/Foundation'
 export default {
 export default {
   name: 'Index',
   name: 'Index',
   data() {
   data() {
@@ -128,11 +129,14 @@ export default {
       params: {
       params: {
         page_size: 20,
         page_size: 20,
         page_no: 1,
         page_no: 1,
-        fixedCondition: 'PARTID=' + this.$store.getters.partId
+        fixedCondition: ' nch.part_id=' + this.$store.getters.partId,
+        sort: 'nch.id',
+        dir: 'desc'
       },
       },
       pageData: [],
       pageData: [],
       loading: false,
       loading: false,
-      searchDateRange: []
+      searchDateRange: [],
+      callingType: null
     }
     }
   },
   },
   computed: {
   computed: {
@@ -150,7 +154,6 @@ export default {
       this.multipleSelection = val
       this.multipleSelection = val
     },
     },
     /** 删除单条数据 */
     /** 删除单条数据 */
-
     handlerDelete(ids) {
     handlerDelete(ids) {
       this.$confirm('删除操作后数据不可复原,您确定要删除此数据?', '警告', {
       this.$confirm('删除操作后数据不可复原,您确定要删除此数据?', '警告', {
         confirmButtonText: '确定',
         confirmButtonText: '确定',
@@ -206,17 +209,49 @@ export default {
       })
       })
     },
     },
     /** 处理搜索 */
     /** 处理搜索 */
-    handlerSearch(keywords) {
-      this.params.query = keywords
+    handlerSearch(value) {
+      if (value) {
+        this.params.fixedCondition = ' nch.calling_type=' + value
+      } else {
+        delete this.params.fixedCondition
+      }
       this.getList()
       this.getList()
     },
     },
     formatterCallType(row, column, cellValue) {
     formatterCallType(row, column, cellValue) {
-      if (cellValue === 1) {
-        return '主叫'
+      switch (row.calling_type) {
+        case 1:
+          return '病房普通呼叫'
+        case 2:
+          return '门口机呼叫'
+        case 3:
+          return '卫生间紧急呼叫'
+        case 4:
+          return '请求增援'
+        case 5:
+          return '优先呼叫'
+        case 6:
+          return '关系人电话呼叫'
+        default:
+          return '未知呼叫'
+      }
+    },
+    formatterCallDirect(row, column, cellValue) {
+      if (row.calling_direct === 0) {
+        return '呼出'
       } else {
       } else {
-        return '被叫'
+        return '呼入'
       }
       }
     },
     },
+    formatterCallTime(row, column, cellValue) {
+      if (row.calling_time === null) {
+        return '未接听'
+      } else {
+        return '已接听'
+      }
+    },
+    formatterCreateTime(row, column, cellValue) {
+      return unixToDate(row.create_time)
+    },
     /** 处理字段排序 */
     /** 处理字段排序 */
     tableSort(column) {
     tableSort(column) {
       if (column.order !== null) {
       if (column.order !== null) {
@@ -245,7 +280,7 @@ export default {
         cancelButtonText: '取消',
         cancelButtonText: '取消',
         type: 'warning'
         type: 'warning'
       }).then(() => {
       }).then(() => {
-        API_CallingList.clearRecord().then(res => {
+        API_CallingList.clearRecord(this.$store.getters.partId).then(res => {
           this.$message.success('清除成功!')
           this.$message.success('清除成功!')
           this.getList()
           this.getList()
         }).catch(err => {
         }).catch(err => {

+ 566 - 0
src/views/ncs-clerk/clerkList.vue

@@ -0,0 +1,566 @@
+<template>
+  <div>
+    <en-table-layout
+      toolbar
+      @selection-change="selectFun"
+      @sort-change="tableSort"
+      pagination
+      :tableData="tableData"
+      :height="600"
+      :loading="loading"
+      :default-sort="{prop: 'member_id', order: 'ascending'}"
+    >
+      <!--工具栏-->
+      <div slot="toolbar" class="inner-toolbar">
+        <div class="toolbar-search">
+          <en-table-search @search="handlerSearch" placeholder="请输入搜索关键字"/>
+        </div>
+        <div class="toolbar-btns">
+          <el-button type="primary" @click="handleAddMember">新增</el-button>
+         <!-- <el-button type="danger" @click="batchDelete">禁用</el-button>-->
+        </div>
+      </div>
+      <!--表头-->
+      <template slot="table-columns">
+        <el-table-column type="selection" width="55" align="center"></el-table-column>
+        <el-table-column prop="uname" label="登陆名" min-width="150" align="center"></el-table-column>
+        <el-table-column prop="nickname" label="真实名字" min-width="150" align="center"></el-table-column>
+        <el-table-column prop="sex" label="性别" :formatter="formatterSex" width="100" align="center"></el-table-column>
+        <el-table-column prop="mobile" label="手机" align="center"></el-table-column>
+        <el-table-column prop="role_name" label="角色"  :formatter="formatterRole" width="150" align="center"></el-table-column>
+        <el-table-column style="text-align: left;" label="操作" width="100">
+          <template slot-scope="scope">
+            <el-button type="success" size="mini"  @click="handlerEdit(scope.$index,scope.row)">编辑</el-button>
+          </template>
+        </el-table-column>
+      </template>
+
+      <!--翻页-->
+      <el-pagination
+        slot="pagination"
+        v-if="pageData"
+        :current-page="pageData.page_no"
+        :page-sizes="[10, 20, 50, 100]"
+        :page-size="pageData.page_size"
+        @size-change="handlePageSizeChange"
+        @current-change="handlePageCurrentChange"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="pageData.data_total">
+      </el-pagination>
+    </en-table-layout>
+
+    <!--添加会员 dialog-->
+    <el-dialog
+      title="编辑成员信息"
+      :visible.sync="dialogAddMemberVisible"
+      width="60%"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+    >
+      <el-form :model="addMemberForm" :rules="addMemberRules" ref="addMemberForm" label-width="110px" class="formwrap">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="医生头像">
+              <el-upload
+                      class="avatar-uploader"
+                      :action="`${uploadurl}?scene=avatar`"
+                      :show-file-list="false"
+                      :on-success="uploaded"
+                      :before-upload="handleShopLogoBefore">
+                <img v-if="imageUrl" :src="imageUrl" class="avatar">
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+              </el-upload>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="登录名" prop="uname">
+              <el-input v-model="addMemberForm.uname" :maxlength="20"></el-input>
+            </el-form-item>
+            <el-form-item label="密码" prop="password">
+              <el-input v-model="addMemberForm.password" :type="pwdType" :maxlength="20"></el-input>
+              <span class="show-pwd" @click="pwdType = pwdType === 'password' ? 'text' : 'password'">
+              <svg-icon :icon-class="pwdType === 'password' ? 'eye' : 'eye-open'"/>
+              </span>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="真实姓名" prop="nickname">
+              <el-input v-model="addMemberForm.nickname" :maxlength="20"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="手机号码" prop="mobile">
+              <el-input v-model.number="addMemberForm.mobile" :maxlength="11"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="性别" class="form-item-sex">
+              <el-radio v-model="addMemberForm.sex" :label="1">男</el-radio>
+              <el-radio v-model="addMemberForm.sex" :label="2">女</el-radio>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <!--固定电话-->
+            <el-form-item label="身份证号">
+              <el-input v-model="addMemberForm.midentity" :maxlength="20"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+
+
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <!--生日-->
+            <el-form-item label="生日" prop="birthday">
+              <el-date-picker
+                      v-model="addMemberForm.birthday"
+                      type="date"
+                      :editable="false"
+                      value-format="timestamp"
+                      placeholder="选择生日"
+                      :picker-options="{disabledDate(time) { return time.getTime() > Date.now() }}">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="角色" prop="role_id">
+              <el-select
+                      v-model="addMemberForm.role_id"
+                      placeholder="请选择角色"
+                      clearable
+              >
+
+                <el-option
+                        v-for="item in rolesOptions"
+                        :key="item.role_id"
+                        :label="item.role_name"
+                        :value="item.role_id">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
+            <!--详细地址-->
+            <el-form-item label="详细地址" prop="address">
+              <el-input v-model="addMemberForm.address" :maxlength="50"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+
+<!--        <el-row>-->
+<!--          <el-col :span="12">-->
+<!--            &lt;!&ndash;地区&ndash;&gt;-->
+<!--            <el-form-item label="地区" prop="region" class="form-item-region">-->
+<!--              <en-region-picker :api="MixinRegionApi" @changed="(object) => { addMemberForm.region = object.last_id }"/>-->
+<!--            </el-form-item>-->
+<!--          </el-col>-->
+<!--          <el-col :span="12">-->
+
+<!--            &lt;!&ndash;邮箱&ndash;&gt;-->
+<!--            <el-form-item label="邮箱" prop="email">-->
+<!--              <el-input v-model="addMemberForm.email"></el-input>-->
+<!--            </el-form-item>-->
+<!--          </el-col>-->
+<!--        </el-row>-->
+
+
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogAddMemberVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submitAddMemberForm('addMemberForm')">确 定</el-button>
+      </div>
+    </el-dialog>
+
+
+  </div>
+</template>
+
+<script>
+  import { serverUrl } from '@/utils/domain'
+  import * as clerk_API from '@/api/ncs_clerk'
+  import * as RegExp from '@/utils/RegExp'
+
+  export default {
+    name: 'careDoctorManager',
+    data: function() {
+      return {
+        uploadurl: serverUrl + '/ncs/upload/uploadFile',
+        imageUrl: '',
+        /** 列表loading状态 */
+        loading: false,
+        /** 列表参数 */
+        params: {
+          page_size: 10,
+          page_no: 1,
+          sort: 'nc.member_id',
+          dir: 'asc'
+        },
+        /** 列表数据 */
+        tableData: [],
+        pageData: [],
+        /** 添加会员弹出框指示 */
+        dialogAddMemberVisible: false,
+        /** 添加会员 表单数据 */
+        addMemberForm: {},
+        /** 选中行数据 */
+        multipleSelection: [],
+        rolesOptions: [],
+        /** 添加会员 表单规则 */
+        addMemberRules: {
+          uname: [
+            this.MixinRequired('请输入用户名'),
+            { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
+          ],
+          password: [
+            this.MixinRequired('请输入密码!'),
+            {
+              validator: (rule, value, callback) => {
+                if (!RegExp.password.test(value)) {
+                  callback(new Error('密码格式有误,密码只能包含字母数字和!#$%^&*.~,字符,长度为6-20位'))
+                } else {
+                  callback()
+                }
+              },
+              trigger: 'blur'
+            }
+          ],
+          nickname: [
+            this.MixinRequired('请输入真实姓名'),
+            { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
+          ],
+          role_id: [this.MixinRequired('请选择角色')],
+          mobile: [
+            this.MixinRequired('请输入手机号码!'),
+            {
+              validator: (rule, value, callback) => {
+                if (!RegExp.mobile.test(value)) {
+                  callback(new Error('手机格式格式有误'))
+                } else {
+                  callback()
+                }
+              },
+              trigger: 'blur'
+            }
+          ],
+          address: [
+            { max: 50, message: '最长50个字符', trigger: 'blur' }]
+        },
+        pwdType: 'password'
+      }
+    },
+    mounted() {
+      this.getRoles({ page_size: 200, page_no: 1, fixedCondition: ' shop_id = -1', sort: ' role_id', dir: 'desc' })
+      this.GET_MemberList()
+    },
+    activated() {
+      this.GET_MemberList()
+    },
+    methods: {
+      /** 选择行变化时,记录选中的行数据 */
+      selectFun(val) {
+        this.multipleSelection = val
+      },
+      /** 加载用户列表 */
+      GET_MemberList() {
+        this.loading = true
+        clerk_API.getList(this.params).then(response => {
+          this.loading = false
+          let size = 0
+          // response.data.forEach((item, index) => {
+          //   if (item.founder === 1) {
+          //     delete response.data[index]
+          //     size++
+          //   }
+          // })
+          this.tableData = response.data
+          this.pageData = {
+            page_no: response.page_no,
+            page_size: response.page_size,
+            data_total: response.data_total - size
+          }
+        }).catch(() => {
+          this.loading = false
+        })
+      },
+      /** 处理搜索 **/
+      handlerSearch(keywords) {
+        this.params.query = keywords
+        this.GET_MemberList()
+      },
+      /** 表头排序 **/
+      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.GET_MemberList()
+      },
+      /** 单条数据删除处理 */
+      handlerDelete(ids) {
+        this.$confirm('你确定要禁用此用户?', '警告', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          clerk_API.remove(ids).then(
+            response => {
+              this.GET_MemberList()
+              this.$message({
+                type: 'success',
+                message: '已禁用!'
+              })
+            }
+          ).catch(response => {
+            this.$message({
+              type: 'info',
+              message: response.message
+            })
+          })
+        }).catch((response) => {
+          this.$message({
+            type: 'info',
+            message: '已取消禁用'
+          })
+        })
+      },
+      getRoles(param) {
+        // 获取角色
+        clerk_API.getRoles(param).then(response => {
+          this.rolesOptions = response.data
+        })
+      },
+      /** 批量数据删除处理(删除选中的行) */
+      batchDelete: function() {
+        if (this.multipleSelection.length === 0) {
+          this.$alert('没有选择任何记录!', '系统提示', {
+            confirmButtonText: '确定',
+            callback: action => {
+
+            }
+          })
+        } else {
+          const ids = []
+          this.multipleSelection.forEach(function(item) {
+            ids.push(item.member_id)
+          })
+
+          this.handlerDelete(ids.join(','))
+        }
+      },
+
+      /** 性别格式化 */
+      formatterSex(row, column, cellValue) {
+        return row.sex === 1 ? '男' : '女'
+      },
+
+      formatterRole(row, column, cellValue) {
+        if (row.founder === 1) {
+          return '机构负责人'
+        } else {
+          return cellValue
+        }
+      },
+      /** 提交添加会员表单 */
+      submitAddMemberForm(formName) {
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            const params = this.MixinClone(this.addMemberForm)
+            if (isNaN(params.birthday)) {
+              params.birthday = null
+            } else {
+              params.birthday = parseInt(params.birthday / 1000)
+            }
+            if (this.imageUrl) {
+              params.face = this.imageUrl
+            }
+            if (params.member_id) {
+              clerk_API.update(params.clerk_id, params).then(response => {
+                this.dialogAddMemberVisible = false
+                this.imageUrl = null
+                this.GET_MemberList()
+              })
+            } else {
+              params.shop_id = this.$store.getters.partId
+              clerk_API.add(params).then(response => {
+                this.dialogAddMemberVisible = false
+                this.imageUrl = null
+                this.GET_MemberList()
+              })
+            }
+
+          } else {
+            this.$message.error('表单填写有误,请检查!')
+            return false
+          }
+        })
+      },
+      /** 添加会员 */
+      handleAddMember() {
+        this.addMemberForm = { sex: 1 }
+        this.addMemberRules.password[0].required = true
+        this.dialogAddMemberVisible = true
+      },
+      /** 编辑用户 */
+      handlerEdit(index, row) {
+        this.addMemberForm = Object.assign({}, row)
+        this.imageUrl = row.face
+        delete this.addMemberForm.password
+        this.addMemberRules.password[0].required = false
+        if (row.birthday) {
+          this.addMemberForm.birthday *= 1000
+        }
+        console.log(this.addMemberForm)
+        this.dialogAddMemberVisible = true
+      },
+      /** 分页大小发生改变 */
+      handlePageSizeChange(size) {
+        this.params.page_size = size
+        this.GET_MemberList()
+      },
+
+      /** 分页页数发生改变 */
+      handlePageCurrentChange(page) {
+        this.params.page_no = page
+        this.GET_MemberList()
+      },
+      /** 图片上传之前的校验 */
+      handleShopLogoBefore(file) {
+        return new Promise((resolve, reject) => {
+          const isImg = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif'
+          const isLt2M = file.size / 1024 / 1024 < 2
+
+          if (!isImg) {
+            this.$message.error('上传头像图片只能是 JPG、PNG、GIF 格式!')
+            reject()
+          }
+          if (!isLt2M) {
+            this.$message.error('上传头像图片大小不能超过 2MB!')
+            reject()
+          }
+
+          let reader = new FileReader()
+          reader.onload = (event) => {
+            let image = new Image()
+            image.onload = () => {
+              let width = image.width
+              let height = image.height
+              if (width > 500 || width < 100) {
+                this.$message.error('图片宽度必须在100~500之间,宽高比为1:1!')
+                reject()
+              }
+              if (width !== height) {
+                this.$message.error('请上传宽高比为1:1的图片')
+                reject()
+              }
+              if (height > 500 || height < 100) {
+                this.$message.error('图片高度必须在100~500之间!')
+                reject()
+              }
+              resolve()
+            }
+            image.src = event.target.result
+          }
+          reader.readAsDataURL(file)
+        })
+      },
+
+      /** 上传成功后的钩子 更换图片 置空存储数组*/
+      uploaded(res) {
+        this.imageUrl = serverUrl + '/' + res.file_path
+        this.addMemberForm.face = this.imageUrl
+      }
+
+    }
+
+  }
+</script>
+
+<style type="text/scss" scoped>
+
+  .show-pwd {
+    position: absolute;
+    top: 0;
+    right: 10px;
+    cursor: pointer;
+  }
+
+  .formwrap /deep/ .el-tabs__content {
+    overflow: visible !important;
+  }
+
+  .formwrap /deep/ .app-address-title {
+    height: 32px !important;
+    line-height: 32px !important;
+  }
+
+  .formwrap /deep/ .app-address {
+    width: 100% !important;
+  }
+
+  /deep/ div.toolbar {
+    height: 70px;
+    padding: 20px 0;
+  }
+
+  /deep/ .el-date-editor {
+    width: 100%;
+  }
+
+  /deep/ .el-table {
+    width: 100%;
+    overflow-x: scroll;
+
+    & td:not(.is-left) {
+      text-align: center;
+    }
+  }
+
+  .el-tag + .el-tag {
+    margin-left: 10px;
+    margin-bottom: 10px;
+  }
+
+  /deep/ .avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+  }
+
+  /deep/ .avatar-uploader .el-upload:hover {
+    border-color: #409EFF;
+  }
+
+  /deep/ .avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 110px;
+    height: 110px;
+    line-height: 110px;
+    text-align: center;
+  }
+
+  /deep/ .avatar {
+    width: 110px;
+    height: 110px;
+    display: block;
+  }
+
+</style>

+ 0 - 6
src/views/ncs-device/device-edit.vue

@@ -161,18 +161,12 @@ export default {
   },
   },
   watch: {
   watch: {
     deviceId: function () {
     deviceId: function () {
-      console.log('111111this.deviceId=',this.deviceId)
-      console.log('111111111this.frameId=',this.frameId)
       if (this.deviceId != 0) {
       if (this.deviceId != 0) {
         this.getDeviceById()
         this.getDeviceById()
         this.editflag = 1
         this.editflag = 1
       } else {
       } else {
         this.handlerAdd()
         this.handlerAdd()
       }
       }
-    },
-    frameId: function () {
-      console.log('2222222this.deviceId=',this.deviceId)
-      console.log('2222222this.frameId=',this.frameId)
     }
     }
   },
   },
   computed: {
   computed: {

+ 304 - 0
src/views/ncs-nurse-config/index.vue

@@ -0,0 +1,304 @@
+<template>
+  <div  class="app-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-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-form-item label="护理名" prop="config_name">
+          <el-input v-model="addForm.config_name" maxlength="12"></el-input>
+        </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>
+      </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-form-item label="护理项名" prop="option_name">
+          <el-input v-model="addOptionForm.option_name" maxlength="12"></el-input>
+        </el-form-item>
+        <el-form-item label="护理灯颜色">
+          <colorPicker v-model="addOptionForm.color_rgb" />
+        </el-form-item>
+      </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>
+      </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'
+
+  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'
+        },
+        addOredit: '',
+        myTitle: '',
+        shopVisible: false,
+        member_tags: null,
+        params : {
+          page_size: 100,
+          page_no: 1,
+          sort: 'id',
+          dir: 'desc'
+        },
+        partId: this.$store.getters.partId,
+        pName: null
+      }
+    },
+    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) {
+            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()
+        }
+      },
+      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
+        }
+      },
+      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 (this.addOredit === 'edit') {
+              API_NcsNurseConfig.update(this.addForm.id, {config_name: this.addForm.config_name}).then(r => {
+                _this.gettagList1()
+                _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
+        }
+
+      },
+      deleteRow(index, row, type) {
+        this.type = type
+        let _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
+      }
+    },
+    mounted() {
+      this.gettagList1()
+    }
+  }
+</script>
+
+<style scoped>
+  .mytable {
+    width: 100%;
+    padding: 20px;
+    min-height: 480px;
+    cursor: pointer;
+    font-size: 16px;
+  }
+  /deep/ .colorBtn {
+    width: 80px !important;
+    height: 40px !important;
+  }
+  /deep/ .m-colorPicker .box.open{
+    z-index: 1000 !important;
+  }
+</style>