hyf 3 years ago
parent
commit
b5d9b34d23

+ 0 - 1
.gitignore

@@ -15,5 +15,4 @@ tests/**
 *.njsproj
 *.sln
 
-src/settings.js
 dist.*

+ 50 - 0
src/api/system/appTargetApi.js

@@ -0,0 +1,50 @@
+import request from '@/utils/request'
+
+/**
+ * 获取列表
+ * @param data
+ */
+export function getAppTargetByList(data) {
+  return request({
+    url: '/app/target',
+    method: 'GET',
+    params: data
+  })
+}
+
+/**
+ * 获取列表
+ * @param data
+ */
+export function getAppSelectByList(data) {
+  return request({
+    url: '/app/target/select',
+    method: 'GET',
+    params: data
+  })
+}
+
+/**
+ * 添加
+ * @param data
+ */
+export function createAppTarget(data) {
+  return request({
+    url: `/app/target/add`,
+    method: 'post',
+    data
+  })
+}
+
+/**
+ * 删除
+ * @param targetId
+ * @param appId
+ */
+export function deleteAppTargetById(appId, targetId) {
+  return request({
+    url: `/app/target/${appId}/${targetId}`,
+    method: 'DELETE'
+  })
+}
+

+ 127 - 0
src/components/AppTargetConfig/AppSelected.vue

@@ -0,0 +1,127 @@
+<template>
+
+  <div class="content-container">
+    <el-row class="tool-bar">
+      <el-col :span="24" class="left">
+        <div class="tool-bar-label">
+          <span>已绑定列表</span>
+        </div>
+      </el-col>
+    </el-row>
+
+    <el-row class="content-body">
+      <VueScroll :ops="ops" style="height: calc(100vh - 150px)">
+        <el-table v-loading="listLoading" class="page-table" border :data="dataList" height="calc(100vh - 220px)">
+          <el-table-column type="index" label="序号" header-align="center" align="center" width="80" />
+
+          <el-table-column prop="checklistTitle" label="名称" header-align="center" align="center">
+            <template v-slot="{row}">
+              <span><i class="el-icon-notebook-2" /> {{ row.appTitle }}</span>
+            </template>
+          </el-table-column>
+
+          <el-table-column label="操作" header-align="center" align="center" width="80">
+            <template v-slot="{row}">
+              <el-button size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </VueScroll>
+    </el-row>
+  </div>
+</template>
+<script>
+import { getAppTargetByList, deleteAppTargetById } from '@/api/system/appTargetApi'
+import VueScroll from 'vuescroll'
+
+export default {
+  name: 'AppSelected',
+  components: { VueScroll },
+  data() {
+    return {
+      ops: {
+        bar: {
+          keepShow: false,
+          background: 'rgba(144, 147, 153, 0.4)',
+          onlyShowBarOnScroll: false
+        }
+      },
+      dialogVisible: false,
+      listLoading: false,
+      conditions: {
+        targetId: this.targetId
+      },
+      dataList: [],
+      rules: {}
+    }
+  },
+  methods: {
+
+    // 显示窗口
+    loadData(targetId) {
+      this.resetFormData()
+      this.conditions.targetId = targetId
+      this.dialogVisible = true
+      this.listLoading = true
+      getAppTargetByList(this.conditions).then((resp) => {
+        const { data } = resp
+        this.listLoading = false
+        this.dataList = data
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    // 重置
+    resetFormData() {
+      this.formData = {
+        checklistId: undefined,
+        targetId: undefined
+      }
+    },
+
+    // Delete Handling
+    handleDelete(data) {
+      const { appId } = data
+      const targetId = this.conditions.targetId
+      deleteAppTargetById(appId, targetId).then((resp) => {
+        this.loadData()
+        this.$emit('actionUpdate')
+      }).catch((error) => {
+        console.log(error)
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+
+</style>
+<style lang="scss" scoped>
+.content-container {
+  margin: 0 10px;
+  position: relative;
+  height: calc(100% - 120px);
+
+  .tool-bar-label {
+    font-size: 13px;
+    color: #F7F7F7;
+  }
+}
+
+.el-form-item-desc{
+  background: #3A71A8;
+  color: #fff;
+  padding:10px;
+  p{
+    margin: 0;
+    line-height: 1.8;
+  }
+}
+.assess-attachList{
+  overflow: hidden;
+  text-overflow:ellipsis;
+  white-space: nowrap;
+}
+</style>

+ 148 - 0
src/components/AppTargetConfig/AppUnselected.vue

@@ -0,0 +1,148 @@
+<template>
+
+  <div class="content-container">
+    <el-row class="tool-bar">
+      <el-col :span="24" class="left">
+        <div class="tool-bar-label">
+          <span> 待选择列表 </span>
+        </div>
+      </el-col>
+    </el-row>
+
+    <el-row class="content-body">
+      <VueScroll :ops="ops" style="height: calc(100vh - 400px)">
+        <el-table v-loading="listLoading" class="page-table" border :data="dataList" height="calc(100vh - 220px)">
+          <el-table-column type="index" label="序号" header-align="center" align="center" width="60" />
+
+          <el-table-column prop="appTitle" label="名称" header-align="center" align="center">
+            <template v-slot="{row}">
+              <span><i class="el-icon-notebook-2" /> {{ row.appTitle }}</span>
+            </template>
+          </el-table-column>
+
+          <el-table-column label="操作" header-align="center" align="center" width="100">
+            <template v-slot="{row}">
+              <el-button size="mini" icon="el-icon-edit" type="primary" @click="handleAdd(row)">添加</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </VueScroll>
+    </el-row>
+  </div>
+</template>
+<script>
+import { getAppSelectByList, createAppTarget } from '@/api/system/appTargetApi'
+import VueScroll from 'vuescroll'
+
+export default {
+  name: 'AppUnSelected',
+  components: { VueScroll },
+  filters: { },
+  props: {
+    targetId: {
+      type: [Number],
+      default: undefined
+    },
+
+    targetType: {
+      type: [Number],
+      default: undefined
+    }
+  },
+  data() {
+    return {
+      ops: {
+        bar: {
+          keepShow: false,
+          background: 'rgba(144, 147, 153, 0.4)',
+          onlyShowBarOnScroll: false
+        }
+      },
+      dialogVisible: false,
+      listLoading: false,
+      dataList: [],
+      formData: {
+        appId: undefined,
+        targetId: this.targetId,
+        targetType: this.targetType
+      },
+      conditions: {
+        targetId: this.targetId
+      },
+      rules: {}
+    }
+  },
+  mounted() {},
+  methods: {
+
+    // 显示窗口
+    loadData(targetId) {
+      this.resetFormData()
+      this.formData.targetId = targetId
+      this.conditions.targetId = targetId
+      this.dialogVisible = true
+      this.listLoading = true
+      getAppSelectByList(this.conditions).then((resp) => {
+        const { data } = resp
+        this.listLoading = false
+        this.dataList = data
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    // 重置
+    resetFormData() {
+      this.formData = {
+        checklistId: undefined,
+        targetId: this.targetId,
+        targetType: this.targetType
+      }
+    },
+
+    // Add Handling
+    handleAdd(data) {
+      const { appId } = data
+      this.formData.appId = appId
+      createAppTarget(this.formData).then((resp) => {
+        this.loadData()
+        this.$emit('actionUpdate')
+      }).catch((error) => {
+        console.log(error)
+      })
+    }
+
+  }
+}
+</script>
+
+<style lang="scss">
+
+</style>
+<style lang="scss" scoped>
+.content-container {
+  margin: 0 10px;
+  position: relative;
+  height: calc(100% - 120px);
+
+  .tool-bar-label {
+    font-size: 13px;
+    color: #F7F7F7;
+  }
+}
+
+.el-form-item-desc{
+  background: #3A71A8;
+  color: #fff;
+  padding:10px;
+  p{
+    margin: 0;
+    line-height: 1.8;
+  }
+}
+.assess-attachList{
+  overflow: hidden;
+  text-overflow:ellipsis;
+  white-space: nowrap;
+}
+</style>

+ 92 - 0
src/components/AppTargetConfig/index.vue

@@ -0,0 +1,92 @@
+<template>
+  <el-drawer
+    :title="title"
+    :modal-append-to-body="false"
+    :modal="false"
+    :wrapper-closable="false"
+    size="60%"
+    :visible.sync="dialogVisible"
+  >
+    <el-row class="content-container">
+      <el-col :span="12" class="left-counter-wrap">
+        <AppSelected ref="SelectedList" :target-type="targetType" @actionUpdate="updateUnselectedList" />
+      </el-col>
+
+      <el-col :span="12" class="right-counter-wrap">
+        <AppUnselected ref="UnselectedList" :target-type="targetType" @actionUpdate="updateSelectedList" />
+      </el-col>
+    </el-row>
+  </el-drawer>
+</template>
+<script>
+import AppSelected from './AppSelected'
+import AppUnselected from './AppUnselected'
+
+export default {
+  name: 'AppTargetConfig',
+  components: { AppSelected, AppUnselected },
+  props: {
+    targetType: {
+      type: [Number],
+      default: 1
+    }
+  },
+  data() {
+    return {
+      title: '小程序绑定配置',
+      dialogVisible: false,
+      targetId: undefined
+    }
+  },
+  mounted() {},
+  methods: {
+    showModel(targetId) {
+      this.targetId = targetId
+      this.dialogVisible = true
+      this.$nextTick(() => {
+        this.$refs['UnselectedList'].loadData(this.targetId)
+        this.$refs['SelectedList'].loadData(this.targetId)
+      })
+    },
+
+    // 操作更新
+    updateUnselectedList() {
+      this.$refs['UnselectedList'].loadData(this.targetId)
+      this.$refs['SelectedList'].loadData(this.targetId)
+    },
+
+    // 操作更新
+    updateSelectedList() {
+      this.$refs['SelectedList'].loadData(this.targetId)
+      this.$refs['UnselectedList'].loadData(this.targetId)
+      this.$emit('formSuccess')
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+
+</style>
+<style lang="scss" scoped>
+.content-container {
+  margin: 0 0;
+  position: relative;
+  height: calc(100% - 250px);
+}
+
+.el-form-item-desc{
+  background: #3A71A8;
+  color: #fff;
+  padding:10px;
+  p{
+    margin: 0;
+    line-height: 1.8;
+  }
+}
+.assess-attachList{
+  overflow: hidden;
+  text-overflow:ellipsis;
+  white-space: nowrap;
+}
+</style>

+ 59 - 0
src/settings.js

@@ -0,0 +1,59 @@
+module.exports = {
+  title: '满意医院管理平台',
+
+  /**
+   * @type {boolean} true | false
+   * @description Whether show the settings right-panel
+   */
+  showSettings: false,
+
+  /**
+   * @type {boolean} true | false
+   * @description Whether need tagsView
+   */
+  tagsView: false,
+
+  /**
+   * @type {boolean} true | false
+   * @description Whether fix the header
+   */
+  fixedHeader: false,
+
+  /**
+   * @type {boolean} true | false
+   * @description Whether show the logo in sidebar
+   */
+  sidebarLogo: true,
+
+  /**
+   * @type {string | array} 'production' | ['production', 'development']
+   * @description Need show err logs component.
+   * The default is only used in the production env
+   * If you want to also use it in dev, you can pass ['production', 'development']
+   */
+  errorLog: 'production',
+
+  /**
+  * 服务API地址
+  */
+  // serverUrl: 'http://192.168.1.214:8080/', // 正式环境
+  // serverUrl: 'http://1.15.92.205:8080/', // 正式环境
+  serverUrl: 'http://114.116.19.14:8080/', // 正式环境
+  // devServerUrl: 'http://1.15.92.205:8080/', // 开发环境
+  devServerUrl: 'http://127.0.0.1:8001/', // 开发环境
+  // serverUrl: 'http://114.116.19.14:8080/', // 正式环境
+  // devServerUrl: 'http://114.116.19.14:8080/', // 开发环境
+  /**
+  * websocket 地址
+  * dev 开发环境
+  * pro正式环境
+  */
+  appID: '10005',
+  appKey: '82a8bf439373e309',
+  appSecret: '82a8bf439373e309',
+  permitTplId: 7,
+  wsServerUrl: {
+    dev: 'ws://ws.58yunkang.com/websocket/link',
+    pro: 'ws://ws.58yunkang.com/websocket/link'
+  }
+}

+ 16 - 22
src/views/hos/doctor/index.vue

@@ -64,10 +64,12 @@
           </template>
         </el-table-column>
 
-        <el-table-column label="清单" align="center" header-align="center" width="120">
+        <el-table-column label="小程序" align="center" header-align="center" width="120">
           <template v-slot="{row}">
-            <span v-if="row.checklistNum> 0" @click="handleChecklist(row)"> <i class="el-icon-document-checked" /> </span>
-            <span v-else @click="handleChecklist(row)"> 绑定 </span>
+            <el-link>
+              <span v-if="row.appNum> 0" @click="handleApp(row)"><i class="el-icon-apple" /></span>
+              <span v-else @click="handleApp(row)">绑定</span>
+            </el-link>
           </template>
         </el-table-column>
 
@@ -87,7 +89,7 @@
     <Doctor ref="EditDoctor" title="编辑" @formSuccess="getData" />
     <qrcode ref="qrcode" />
     <div id="qrcode" ref="qrcodeModal" style="position:fixed;top:-9999px;" />
-    <ChecklistTargetConfig ref="ChecklistTargetConfig" :target-type="targetType" />
+    <AppTargetConfig ref="AppTargetConfig" :target-type="targetType" />
   </div>
 </template>
 
@@ -101,7 +103,7 @@ import Doctor from './components/Doctor'
 import Pagination from '@/components/Pagination'
 import qrcodeComponents from '@/views/hos/components/qrcode.vue'
 import { getDoctorByPage, deleteDoctorById } from '@/api/hos/doctorApi'
-import ChecklistTargetConfig from '@/components/ChecklistTargetConfig'
+import AppTargetConfig from '@/components/AppTargetConfig'
 import { getSettingById } from '@/api/system/settingApi'
 import { getUserData } from '@/utils/auth'
 
@@ -111,7 +113,7 @@ export default {
   components: {
     Pagination,
     Doctor,
-    ChecklistTargetConfig,
+    AppTargetConfig,
     qrcode: qrcodeComponents
   },
   filters: {
@@ -167,14 +169,10 @@ export default {
     getData() {
       this.listLoading = true
       getDoctorByPage(this.conditions).then((resp) => {
-        const { code, msg, data, total } = resp
+        const { data, total } = resp
         this.listLoading = false
-        if (code === 200) {
-          this.total = total
-          this.dataList = data
-        } else {
-          this.$message.error(msg)
-        }
+        this.total = total
+        this.dataList = data
       }).catch((error) => {
         console.log(error)
       })
@@ -200,13 +198,9 @@ export default {
         type: 'warning'
       }).then(() => {
         deleteDoctorById(doctorId).then((resp) => {
-          const { code, msg } = resp
-          if (code === 200) {
-            this.getData()
-            this.$message.success(msg)
-          } else {
-            this.$message.error(msg)
-          }
+          const { msg } = resp
+          this.getData()
+          this.$message.success(msg)
         }).catch((error) => {
           console.log(error)
         })
@@ -295,9 +289,9 @@ export default {
     },
 
     // 显示清单绑定配置
-    handleChecklist(data) {
+    handleApp(data) {
       const { doctorId } = data
-      this.$refs['ChecklistTargetConfig'].showModel(doctorId)
+      this.$refs['AppTargetConfig'].showModel(doctorId)
     }
   }
 }

+ 3 - 2
src/views/system/customer/customer/index.vue

@@ -4,9 +4,10 @@
       <el-col :span="12" class="left">
         <div class="content-title">客户信息</div>
       </el-col>
+
       <el-col :span="12" class="right">
-        <el-input v-model="conditions.keywords" style="width: 200px;" class="filter-item" prefix-icon="el-icon-search" placeholder="请输入内容" @keyup.enter.native="getData" />
-        <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-search" @click="getData">查询</el-button>
+        <el-input v-model="conditions.keywords" style="width: 200px;" class="filter-item" prefix-icon="el-icon-search" size="mini" placeholder="请输入内容" @keyup.enter.native="getData" />
+        <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-search" size="mini" @click="getData">查询</el-button>
       </el-col>
     </el-row>
 

+ 12 - 16
src/views/system/grid/index.vue

@@ -46,28 +46,24 @@
           </template>
         </el-table-column>
 
-        <el-table-column label="说明" align="left" header-align="left">
-          <template v-slot="{row}">
-            <span>{{ row.gridDesc }}</span>
-          </template>
-        </el-table-column>
-
         <el-table-column label="二维码" header-align="center" align="center" width="70">
           <template v-slot="{row}">
             <span class="icon iconfont icon-erweima" @click="showQrcode(row)" />
           </template>
         </el-table-column>
 
-        <el-table-column label="清单" align="center" header-align="center" width="70">
+        <el-table-column label="小程序" align="center" header-align="center" width="70">
           <template v-slot="{row}">
-            <span v-if="row.checklistNum> 0" @click="handleChecklist(row)"> <i class="el-icon-document-checked" /> </span>
-            <span v-else @click="handleChecklist(row)"> 绑定 </span>
+            <el-link>
+              <span v-if="row.appNum> 0" @click="handleApp(row)"> <i class="el-icon-apple" /> </span>
+              <span v-else @click="handleApp(row)">绑定 </span>
+            </el-link>
           </template>
         </el-table-column>
 
-        <el-table-column label="地图位置" header-align="center" align="center" width="100">
+        <el-table-column label="说明" align="left" header-align="left">
           <template v-slot="{row}">
-            <span @click="handleMapLayer(row)"><i class="el-icon-location" /> </span>
+            <span>{{ row.gridDesc }}</span>
           </template>
         </el-table-column>
 
@@ -87,7 +83,7 @@
     <grid ref="EditGrid" title="编辑" @formSuccess="getData" />
     <QrCode ref="qrcode" />
     <div id="qrcode" ref="qrcodeModal" style="position:fixed;top:-9999px;" />
-    <ChecklistTargetConfig ref="ChecklistTargetConfig" :target-type="targetType" @formSuccess="getData" />
+    <AppTargetConfig ref="AppTargetConfig" :target-type="targetType" @formSuccess="getData" />
     <MapLayer ref="MapLayer" />
   </div>
 </template>
@@ -102,7 +98,7 @@ import Grid from './components/Grid'
 import { QrCode } from '@/components'
 import MapLayer from './components/MapLayer'
 import Pagination from '@/components/Pagination'
-import ChecklistTargetConfig from '@/components/ChecklistTargetConfig'
+import AppTargetConfig from '@/components/AppTargetConfig'
 import { getGridByPage, deleteGridById } from '@/api/system/gridApi'
 import { getSettingById } from '@/api/system/settingApi'
 import { getUserData } from '@/utils/auth'
@@ -112,7 +108,7 @@ export default {
   name: 'GridIndex',
   components: {
     Pagination,
-    ChecklistTargetConfig,
+    AppTargetConfig,
     Grid,
     MapLayer,
     QrCode
@@ -271,9 +267,9 @@ export default {
     },
 
     // 显示清单绑定配置
-    handleChecklist(data) {
+    handleApp(data) {
       const { gridId } = data
-      this.$refs['ChecklistTargetConfig'].showModel(gridId)
+      this.$refs['AppTargetConfig'].showModel(gridId)
     },
 
     // 设定地图位置