|
@@ -287,7 +287,9 @@
|
|
|
|
|
|
<el-form-item align="center" class="margin-top-sm">
|
|
|
<el-button type="success" @click="onSubmit">保存设置</el-button>
|
|
|
- <el-button type="ss" @click="saveList">批量添加测试用户</el-button>
|
|
|
+ <el-button v-if="isShow" type="primary" @click="initializeSystem">初始化系统</el-button>
|
|
|
+ <el-button v-if="isShow" type="success" plain :disabled="isDisabled" @click="initialize485Device">初始化485设备</el-button>
|
|
|
+ <el-button v-if="isShow" type="ss" @click="saveList">批量添加测试用户</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-card>
|
|
@@ -297,9 +299,9 @@
|
|
|
<script>
|
|
|
// 系统设置
|
|
|
import * as API_Part from '@/api/ncs_partInfo'
|
|
|
-import * as API_Nurse from '@/api/calling-nurse'
|
|
|
import { saveListByCustomer } from '@/api/ncs_customer'
|
|
|
-import * as API_ErrorLog from '@/api/ncs_errorlog'
|
|
|
+import Storage from '@/utils/storage'
|
|
|
+import { init485Device, initData } from "@/api/initialize";
|
|
|
|
|
|
export default {
|
|
|
name: 'PartInfoEdit',
|
|
@@ -316,10 +318,13 @@ export default {
|
|
|
dayStart: new Date(2020, 11, 11, 7, 0),
|
|
|
nightStart: new Date(2020, 11, 11, 18, 0),
|
|
|
nurseLevel0Config: [],
|
|
|
- parents: []
|
|
|
+ parents: [],
|
|
|
+ isShow: false,
|
|
|
+ isDisabled: false
|
|
|
}
|
|
|
},
|
|
|
async mounted() {
|
|
|
+ this.isShow = JSON.parse(Storage.getItem('calling_user')).username === 'superadmin'
|
|
|
// this.nurseLevel0Config = await API_Nurse.getNurseConfigs(this.partId, 0)
|
|
|
this.getPartInfo()
|
|
|
this.getPartents()
|
|
@@ -418,6 +423,7 @@ export default {
|
|
|
this.parents = [...res]
|
|
|
})
|
|
|
},
|
|
|
+ // 批量增加测试用户
|
|
|
saveList() {
|
|
|
const _this = this
|
|
|
this.$confirm('确定需要批量增加测试用户吗?', '提示', {
|
|
@@ -432,6 +438,29 @@ export default {
|
|
|
}).catch(() => {
|
|
|
console.log('取消')
|
|
|
})
|
|
|
+ },
|
|
|
+ // 初始化485设备
|
|
|
+ initialize485Device() {
|
|
|
+ this.isDisabled = true
|
|
|
+ const _this = this
|
|
|
+ init485Device(_this.partId).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ _this.$message.info(res.message)
|
|
|
+ setTimeout(() => {
|
|
|
+ _this.isDisabled = false
|
|
|
+ }, 60000)
|
|
|
+ } else {
|
|
|
+ _this.isDisabled = false
|
|
|
+ _this.$message.info(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 初始化系统
|
|
|
+ initializeSystem() {
|
|
|
+ const _this = this
|
|
|
+ initData(_this.partId).then(res => {
|
|
|
+ _this.$message.info(res.message)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|