lipengtao 5 jaren geleden
bovenliggende
commit
dff37b238b
6 gewijzigde bestanden met toevoegingen van 549 en 16 verwijderingen
  1. 1 1
      config/dev.env.js
  2. 7 2
      config/index.js
  3. 14 1
      src/router/index.js
  4. 12 12
      src/views/login/index.vue
  5. 276 0
      src/views/superAdministrator/editDoctor.vue
  6. 239 0
      src/views/superAdministrator/index.vue

+ 1 - 1
config/dev.env.js

4
4
5
module.exports = merge(prodEnv, {
5
module.exports = merge(prodEnv, {
6
  NODE_ENV: '"development"',
6
  NODE_ENV: '"development"',
7
  BASE_API: '"http://localhost:92"'
7
  BASE_API: '""'
8
})
8
})

+ 7 - 2
config/index.js

8
    // Paths
8
    // Paths
9
    assetsSubDirectory: 'static',
9
    assetsSubDirectory: 'static',
10
    assetsPublicPath: '/',
10
    assetsPublicPath: '/',
11
    proxyTable: {},
11
    proxyTable: {
12
      '/ajax': {
13
        target: 'http://192.168.3.233:85',
14
        changeOrigin: true
15
      }
16
    },
12
17
13
    // Various Dev Server settings
18
    // Various Dev Server settings
14
    host: 'localhost', // can be overwritten by process.env.HOST
19
    host: 'localhost', // can be overwritten by process.env.HOST
15
    port: 9558,
20
    port: 2222,
16
    autoOpenBrowser: false,
21
    autoOpenBrowser: false,
17
    errorOverlay: true,
22
    errorOverlay: true,
18
    notifyOnErrors: false,
23
    notifyOnErrors: false,

+ 14 - 1
src/router/index.js

89
      }
89
      }
90
    ]
90
    ]
91
  },
91
  },
92
92
  {
93
    path: '',
94
    component: Layout,
95
    children: [
96
      {
97
        path: 'superAdministrator',
98
        name: 'superAdministrator',
99
        meta: {
100
          title: '超级管理员'
101
        },
102
        component: () => import('@/views/superAdministrator/index')
103
      }
104
    ]
105
  },
93
  { path: '*', redirect: '/404', hidden: true }
106
  { path: '*', redirect: '/404', hidden: true }
94
]
107
]
95
108

+ 12 - 12
src/views/login/index.vue

53
        if (!reg.test(value)) {
53
        if (!reg.test(value)) {
54
          callback(new Error('请输入正确的手机号码'))
54
          callback(new Error('请输入正确的手机号码'))
55
        } else {
55
        } else {
56
          request.get(checkRegister, { account: value }, function(response) {
57
            if (response.success) {
58
              if (response.data === -1) {
59
                callback(new Error('该账号已停用,请联系管理员'))
60
              } else if (response.data === 1) {
61
                callback(new Error('该账号不存在,请检查后重试'))
62
              } else if (response.data === 0) {
63
                callback()
64
              }
65
            }
66
          })
56
          // request.get(checkRegister, { account: value }, function(response) {
57
          //   if (response.success) {
58
          //     if (response.data === -1) {
59
          //       callback(new Error('该账号已停用,请联系管理员'))
60
          //     } else if (response.data === 1) {
61
          //       callback(new Error('该账号不存在,请检查后重试'))
62
          //     } else if (response.data === 0) {
63
          //       callback()
64
          //     }
65
          //   }
66
          // })
67
          callback()
67
        }
68
        }
68
      }
69
      }
69
    }
70
    }
115
              for (let i = 0; i < errorCode.length; i++) {
116
              for (let i = 0; i < errorCode.length; i++) {
116
                if (response.code === errorCode[i].code) {
117
                if (response.code === errorCode[i].code) {
117
                  Message.error(errorCode[i].msg)
118
                  Message.error(errorCode[i].msg)
118
                  this.changeImgVc()
119
                  return
119
                  return
120
                }
120
                }
121
              }
121
              }

+ 276 - 0
src/views/superAdministrator/editDoctor.vue

1
<template>
2
  <el-dialog class="dialogClass" title="医院管理" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="860px">
3
    <el-form :model="formObj" ref="formObj" :rules="rulesObj" label-width="80px" class="update-wrapper demo-ruleForm"
4
      v-loading="formLoading">
5
      <el-row :gutter="25">
6
        <el-col :span="14">
7
          <el-row :gutter="20" class="update-main">
8
            <el-col :span="item.span||''" v-for="item in formItem" :key="item.index">
9
              <el-form-item v-if="item.prop" :label="item.tit" :prop="item.prop">
10
                <el-input v-if="item.textarea" type="textarea" :rows="8" v-model="formObj[item.prop]" :placeholder="`请填写${item.tit}`"
11
                  :maxlength="item.num||''"></el-input>
12
                <cityPicker v-else-if="item.city" @paren="toshow" :addrCode="formObj[item.prop]"></cityPicker>
13
                <el-select v-else-if="item.select" v-model="formObj[item.prop]" placeholder="请选择">
14
                  <el-option v-for="item in item.select" :key="item.value" :label="item.label" :value="item.value"
15
                    @current-change="item.value">
16
                  </el-option>
17
                </el-select>
18
                <el-input v-else v-model="formObj[item.prop]" :placeholder="`请填写${item.tit}`" :maxlength="item.num||''"></el-input>
19
              </el-form-item>
20
              <el-form-item v-else class="space-form-item"></el-form-item>
21
            </el-col>
22
            <el-col :span="24">
23
              <el-form-item align="center">
24
                <el-button type="primary" @click="submitForm('formObj')">保存</el-button>
25
              </el-form-item>
26
            </el-col>
27
          </el-row>
28
        </el-col>
29
        <el-col :span="10">
30
          <uploadFile :upImgsStr="formObj.logo" :uploadImg="uploadImg" @uploadfun="uploadfun"></uploadFile>
31
        </el-col>
32
      </el-row>
33
    </el-form>
34
  </el-dialog>
35
</template>
36
37
<script>
38
  //   import {
39
  //     addCompany,
40
  //     updateCompany,
41
  //     queryCompanyOne,
42
  //     queryCompKeyword,
43
  //     uploadCompanyLogo
44
  //   } from '@/api/companyCen'
45
46
  //   import queryDict from '@/utils/queryDict'
47
  import { requiredTip } from '@/utils'
48
49
  import cityPicker from '@/components/CityPicker'
50
  import uploadFile from '@/components/uploadFile'
51
52
  export default {
53
    data() {
54
      return {
55
        dialogFormVisible: false,
56
        formItem: [
57
          {
58
            span: 24,
59
            prop: 'name',
60
            tit: '医院名称',
61
            num: 100,
62
            required: true
63
          },
64
          {
65
            span: 12,
66
            prop: 'size',
67
            tit: '医院级别',
68
            select: [
69
              { label: '一级', value: '1' },
70
              { label: '二级', value: '2' },
71
              { label: '三级', value: '3' }
72
            ],
73
            required: true
74
          },
75
          {
76
            span: 12,
77
            prop: 'size',
78
            tit: '子级别',
79
            select: [
80
              { label: '特等', value: '1' },
81
              { label: '甲等', value: '2' },
82
              { label: '乙等', value: '3' },
83
              { label: '丙等', value: '4' }
84
            ],
85
            required: true
86
          },
87
          {
88
            span: 12,
89
            prop: 'size',
90
            tit: '医院类型',
91
            select: [
92
              { label: '特等', value: '1' },
93
              { label: '甲等', value: '2' },
94
              { label: '乙等', value: '3' },
95
              { label: '丙等', value: '4' }
96
            ],
97
            required: true
98
          },
99
          {
100
            span: 12,
101
            prop: 'phone',
102
            tit: '电话',
103
            num: 20,
104
            required: true
105
          },
106
          {
107
            span: 24,
108
            prop: 'addr',
109
            city: true,
110
            tit: '所在城市',
111
            required: true
112
          },
113
          {
114
            span: 24,
115
            prop: 'location',
116
            tit: '详细地址',
117
            num: 50
118
          },
119
          {
120
            span: 24,
121
            prop: 'descp',
122
            tit: '医院简介',
123
            textarea: true,
124
            num: 2000
125
          }
126
        ],
127
        formLoading: false,
128
        formObj: {
129
          name: '',
130
          logo: '',
131
          url: '',
132
          manageOrg: '',
133
          addr: '',
134
          location: '',
135
          zipCode: '',
136
          servicePhone: '',
137
          serviceEmail: '',
138
          operateTime: '',
139
          linkman: '',
140
          job: '',
141
          department: '',
142
          comp: '',
143
          linkphone: '',
144
          linkemail: '',
145
          descp: ''
146
        },
147
        rulesObj: {},
148
        uploadImg: {
149
          // url: uploadLogo,
150
          tip: '上传图片',
151
          width: '280px',
152
          height: '200px'
153
        }
154
      }
155
    },
156
    components: {
157
      cityPicker,
158
      uploadFile
159
    },
160
    created() {
161
      this.pushRulesFn()
162
      // if (urlParse('id')) {
163
      //   this.companyId = urlParse('id')
164
      //   this.formLoading = true
165
      //   this.getCompanyInfo()
166
      // }
167
      // this.getDictoryData()
168
    },
169
    methods: {
170
      pushRulesFn() {
171
        const formItem = this.formItem
172
        const rulesObj = this.rulesObj
173
        for (let i = 0; i < formItem.length; ++i) {
174
          const ru = []
175
          if (formItem[i].required) {
176
            ru.push({
177
              required: true,
178
              message: requiredTip(formItem[i].tit),
179
              trigger: 'blur'
180
            })
181
          }
182
          rulesObj[formItem[i].prop] = ru
183
        }
184
      },
185
      //   getDictoryData() {
186
      //     const that = this
187
      //     queryDict.applyDict('QYGM', function(dictData) {
188
      //       dictData.map(item => {
189
      //         that.numRanger.push({ value: item.code, label: item.caption })
190
      //       })
191
      //     }) // 企业规模
192
      //     queryDict.applyDict('QYLX', function(dictData) {
193
      //       dictData.map(item => {
194
      //         that.compType.push({ value: item.code, label: item.caption })
195
      //       })
196
      //     }) // 企业类型
197
      //   },
198
      //   getCompanyInfo() {
199
      //     var that = this
200
      //     that.$http.get(queryCompanyOne, {
201
      //       id: that.companyId
202
      //     }, function(res) {
203
      //       that.formLoading = false
204
      //       if (res.success) {
205
      //         const obj = res.data
206
      //         that.formObj = obj
207
      //         that.addrCur = obj.addr
208
      //       }
209
      //     })
210
      //   },
211
      //   submitForm(formName) {
212
      //     var that = this
213
      //     that.$refs[formName].validate((valid) => {
214
      //       if (valid) {
215
      //         const form = that.formObj
216
      //         const paramsData = {
217
      //           name: form.name,
218
      //           logo: form.logo,
219
      //           type: form.type,
220
      //           size: form.size,
221
      //           foundYear: form.foundYear,
222
      //           descp: form.descp,
223
      //           url: form.url,
224
      //           addr: form.addr,
225
      //           location: form.location,
226
      //           zipCode: form.zipCode,
227
      //           servicePhone: form.servicePhone,
228
      //           serviceEmail: form.serviceEmail,
229
      //           operateTime: form.operateTime,
230
      //           linkman: form.linkman,
231
      //           linkphone: form.linkphone,
232
      //           linkemail: form.linkemail,
233
      //           industry: JSON.stringify(form.industry),
234
      //           subject: JSON.stringify(form.subject),
235
      //           qualification: JSON.stringify(form.qualification),
236
      //           fieldOfSupplier: JSON.stringify(form.fieldOfSupplier),
237
      //           fieldOfCustomer: JSON.stringify(form.fieldOfCustomer)
238
      //         }
239
      //         if (that.companyId) {
240
      //           const paramsId = { id: that.companyId }
241
      //           const obj = Object.assign(paramsId, paramsData)
242
      //           that.$http.put(updateCompany, obj, function(res) {
243
      //             if (res.success) {
244
      //               that.$message({
245
      //                 message: '企业信息修改成功',
246
      //                 type: 'success'
247
      //               })
248
      //               that.$router.push({ name: 'noactiveList' })
249
      //             }
250
      //           })
251
      //         } else {
252
      //           that.$http.post(addCompany, paramsData, function(res) {
253
      //             if (res.success) {
254
      //               that.$message({
255
      //                 message: '企业信息添加成功',
256
      //                 type: 'success'
257
      //               })
258
      //               that.$router.push({ name: 'noactiveList' })
259
      //             }
260
      //           })
261
      //         }
262
      //       } else {
263
      //         window.scroll(0, 0)
264
      //         return false
265
      //       }
266
      //     })
267
      //   },
268
      uploadfun(value) {
269
        this.formObj.logo = value
270
      },
271
      toshow(value) {
272
        this.formObj.addr = value
273
      }
274
    }
275
  }
276
</script>

+ 239 - 0
src/views/superAdministrator/index.vue

1
<template>
2
  <div class="app-container">
3
    <div class="box-container">
4
      <div class="contain-search">
5
        <el-input placeholder="搜索医院名称" clearable v-model="searchText" class="input-with-select"></el-input>
6
        <el-select v-model="useState" clearable placeholder="请选择医院级别">
7
          <el-option
8
            v-for="sel in useLists"
9
            :key="sel.value"
10
            :label="sel.label"
11
            :value="sel.value"
12
            @current-change="sel.value"
13
          ></el-option>
14
        </el-select>
15
        <el-select v-model="useSta1" clearable placeholder="请选择子级别">
16
          <el-option
17
            v-for="sel in useSta"
18
            :key="sel.value"
19
            :label="sel.label"
20
            :value="sel.value"
21
            @current-change="sel.value"
22
          ></el-option>
23
        </el-select>
24
        <el-select v-model="useSta3" clearable placeholder="请选择医院类型">
25
          <el-option
26
            v-for="sel in useSta2"
27
            :key="sel.value"
28
            :label="sel.label"
29
            :value="sel.value"
30
            @current-change="sel.value"
31
          ></el-option>
32
        </el-select>
33
        <el-button type="primary" @click.stop="search">查找</el-button>
34
        <el-button type="primary" @click.stop="addOpenDialogFun">创建医院</el-button>
35
      </div>
36
    </div>
37
    <div class="content-container">
38
      <complex-table :tableObject="tableObject"
39
        @pageCurFun="currentPageChange"
40
        @deleteFun="deleteFun"
41
        @editOpenDialogFun="editOpenDialogFun"></complex-table>
42
    </div>
43
    <edit-doctor ref="openDoctorDialog"></edit-doctor>
44
  </div>
45
</template>
46
47
<script>
48
  import complexTable from '@/components/complexTable'
49
  // import { pageInquireUrl, deleteUrl, inquireContentUrl } from '@/api/content'
50
  // import { parseTime, contentType } from '@/utils/index'
51
  // import comTable from '@/utils/comTable'
52
  // import cacheModule from '@/utils/queryName'
53
  import editDoctor from './editDoctor'
54
  export default {
55
    data() {
56
      return {
57
        searchText: '',
58
        tableLoading: false,
59
        useLists: [
60
          { label: '一级', value: '1' },
61
          { label: '二级', value: '2' },
62
          { label: '三级', value: '3' }
63
        ],
64
        useSta: [
65
          { label: '特等', value: '1' },
66
          { label: '甲等', value: '2' },
67
          { label: '乙等', value: '3' },
68
          { label: '丙等', value: '4' },
69
        ],
70
        useSta2: [
71
          { label: '综合医院', value: '1' },
72
          { label: '心血管医院', value: '2' },
73
          { label: '妇产医院', value: '3' },
74
          { label: '儿童医院', value: '4' },
75
          { label: '口腔医院', value: '5' },
76
          { label: '肿瘤医院', value: '6' },
77
          { label: '传染病医院', value: '7' },
78
          { label: '精神病医院', value: '8' },
79
          { label: '其他专科医院', value: '9' },
80
        ],
81
        tableObject: {
82
          data: [
83
            {
84
              account: '1234',
85
              name: 'dkjfjds',
86
              catalog: '2'
87
            }
88
          ],
89
          pageNo: 1,
90
          total: 0,
91
          pageSize: 10,
92
          arr: [
93
            {
94
              prop: 'account',
95
              tit: '账号'
96
            },
97
            {
98
              prop: 'name',
99
              tit: '医院名称'
100
            },
101
            {
102
              prop: 'catalog',
103
              tit: '医院级别'
104
            },
105
            {
106
              prop: 'title',
107
              tit: '医院子级别'
108
            },
109
            {
110
              prop: 'title',
111
              tit: '医院类型'
112
            },
113
            {
114
              tit: '操作',
115
              operate: 'edit',
116
              width: '200'
117
            }
118
          ],
119
          oFun: [
120
            {
121
              text: '编辑',
122
              event: 'editOpenDialogFun',
123
              type: 'primary'
124
            },
125
            {
126
              text: '删除',
127
              event: 'deleteFun',
128
              type: 'danger'
129
            },
130
            {
131
              text: '重置密码',
132
              event: 'deleteFun',
133
              type: 'success'
134
            }
135
          ]
136
        }
137
      }
138
    },
139
    created() {
140
      this.publishList()
141
    },
142
    components: {
143
      complexTable,
144
      editDoctor
145
    },
146
    methods: {
147
      publishList() {
148
        // var that = this
149
        // this.$http.get(pageInquireUrl, this.info, (response) => {
150
        //   if (response.success && response.data) {
151
        //     const res = response.data
152
        //     const epData = res.data
153
        //     let j = 0
154
        //     for (let i = 0; i < epData.length; i++) {
155
        //       epData[i].modifyTime = parseTime(epData[i].modifyTime).substr(0, 16)
156
        //       epData[i].catalog = contentType[epData[i].catalog]
157
        //       j++
158
        //       cacheModule.Judge(epData[i].creator, info => {
159
        //         j--
160
        //         epData[i].creator = info.name
161
        //         if (j === 0) {
162
        //           this.total = res.total
163
        //           if (epData.length === that.info.pageSize) {
164
        //             this.tableData = epData
165
        //           } else {
166
        //             const array = epData
167
        //             comTable.gapFilling(array)
168
        //             this.tableData = array
169
        //           }
170
        //         }
171
        //       })
172
        //     }
173
        //     if (epData.length === 0) {
174
        //       this.total = 0
175
        //       this.tableData = []
176
        //     }
177
        //   } else {
178
        //     this.total = 0
179
        //     this.tableData = []
180
        //   }
181
        // })
182
      },
183
      deleteFun(obj) {
184
        this.$confirm('确定删除该条内容?', '提示', {
185
          confirmButtonText: '确定',
186
          cancelButtonText: '取消',
187
          type: 'warning',
188
          center: true
189
        }).then(() => {
190
          // this.$http.get(deleteUrl, { id: obj.id }, response => {
191
          //   if (response.success) {
192
          //     if (response.data) {
193
          //       this.publishList()
194
          //       this.$message({
195
          //         message: '删除成功',
196
          //         type: 'success'
197
          //       })
198
          //     } else {
199
          //       this.$http.get(inquireContentUrl, { id: this.id }, (response) => {
200
          //         if (response.success && response.data) {
201
          //           const info = response.data
202
          //           if (!info.actived) {
203
          //             this.$message({
204
          //               message: '该内容已被删除',
205
          //               type: 'warning'
206
          //             })
207
          //           }
208
          //         }
209
          //       })
210
          //     }
211
          //   }
212
          // })
213
        }).catch(() => {
214
215
        })
216
      },
217
      search() {
218
        this.resetInfo()
219
      },
220
      resetInfo() {
221
        this.tableObject.data = []
222
        this.tableObject.pageNo = 1
223
        this.tableObject.total = 0
224
        this.tableObject.pageSize = 10
225
        this.queryInfoList()
226
      },
227
      currentPageChange(val) {
228
        this.tableObject.pageNo = val
229
        this.queryInfoList()
230
      },
231
      editOpenDialogFun(val) {
232
        this.$refs.openDoctorDialog.openDiag(val)
233
      },
234
      addOpenDialogFun(val) {
235
        this.$refs.openDoctorDialog.dialogFormVisible = true;
236
      }
237
    }
238
  }
239
</script>