Commit 241f8878 authored by 王飞龙's avatar 王飞龙

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/views/equipment-management/equipment-management/equipment-detail.vue
parent 6775e7fa
......@@ -95,6 +95,7 @@ function render(props = {}) {
store.commit('SET_DEPTID', temp.deptId)
store.commit('SET_CHANGE', props.setGlobalState)
store.commit('SET_GOLBALSTATE', props.getGlobalState())
store.commit('SET_USER_TYPE', temp.type)
}
instance = new Vue({
......
......@@ -9,6 +9,7 @@ const getters = {
avatar: state => state.user.avatar,
name: state => state.user.name,
deptId: state => state.user.deptId,
userType: state => state.user.userType,
introduction: state => state.user.introduction,
roles: state => state.user.roles,
permissions: state => state.user.permissions,
......
......@@ -8,9 +8,10 @@ const user = {
avatar: '',
roles: [],
permissions: [],
deptId: '',
setGlobalState: null,
getGlobalState: null
getGlobalState: null,
deptId: '',
userType: ''
},
mutations: {
......@@ -37,6 +38,9 @@ const user = {
},
SET_GOLBALSTATE: (state, getGlobalState) => {
state.getGlobalState = getGlobalState
},
SET_USER_TYPE: (state, userType) => {
state.userType = userType
}
},
......@@ -72,6 +76,7 @@ const user = {
}
commit('SET_NAME', user.userName)
commit('SET_DEPTID', user.deptId)
commit('SET_USER_TYPE', user.userType)
commit('SET_AVATAR', avatar)
resolve(res)
}).catch(error => {
......
......@@ -139,7 +139,7 @@
format="HH:mm"
value-format="HH:mm"
:picker-options="{
start: '01:00',
start: '00:00',
step: '01:00',
end: '12:00',
maxTime:form.useTime.ame
......@@ -157,7 +157,7 @@
format="HH:mm"
value-format="HH:mm"
:picker-options="{
start: '01:00',
start: '00:00',
step: '01:00',
end: '12:00',
minTime:form.useTime.ams
......
......@@ -9,7 +9,7 @@
color: #333333;"
>检查项目</span>
</div>
<el-form ref="form" label-width="110px" :model="form" :rules="rules">
<el-form ref="form" label-width="90px" :model="form" :rules="rules">
<!-- 检查项目可以添加n个,所以for循环 -->
<div
v-for="(item, index) in form.settingList"
......@@ -36,15 +36,14 @@
label="项目名称"
:prop="'settingList.'+index+'.name'"
:rules="[
{ required: true, message: '请输入项目名称', trigger: 'blur' },
{ min: 2, max: 20, message: '输入内容长度应为2~20个字符', trigger: 'blur' }
{ required: true, message: '请输入项目名称', trigger: 'blur' }
]"
>
<el-input
v-model.trim="item.name"
:disabled="item.isUpdate === '1'"
placeholder="请输入项目名称"
maxlength="10"
/>
</el-form-item>
</el-col>
......@@ -61,9 +60,10 @@
v-model="item.type"
style="width: 100%"
placeholder="请选择检查类型"
:disabled="true"
>
<el-option
v-for="items in dict.type.exam_type"
v-for="items in dict.type.check_type"
:key="items.value"
:label="items.label"
:value="items.value"
......@@ -89,7 +89,6 @@
style="width: 240px"
placeholder="0.00"
:precision="2"
@keydown.native="keydown($event)"
/>
</el-form-item>
......@@ -127,7 +126,7 @@
:prop="'settingList.'+index+'.sort'"
:rules="[
{ required: true, message: '请输入权重', trigger: 'change' },
{ validator: validWeigh, trigger: 'change, blur' }
{ validator: validateSort, trigger: 'change, blur' }
]"
>
<el-input-number
......@@ -136,8 +135,6 @@
:max="9999"
controls-position="right"
style="width: 256px"
@blur="handleBlur"
@keydown.native="keydown($event)"
/>
</el-form-item>
</el-col>
......@@ -179,9 +176,11 @@
<el-input
v-model.trim="item.content"
type="textarea"
:rows="4"
:rows="2"
:disabled="item.isUpdate === '1'"
placeholder="请输入描述"
maxlength="60"
show-word-limit
/>
</el-form-item>
</el-col>
......@@ -201,8 +200,8 @@
import { delItem, listItem, updateItem } from '@/api/business/item'
export default {
name: 'EquipmentCheck',
dicts: ['exam_type'],
name: 'CheckItem',
dicts: ['check_type'],
data() {
return {
// 表单内容
......@@ -210,7 +209,7 @@ export default {
settingList: [
{
name: '',
type: '',
type: '2',
price: '',
supportInsure: '',
sort: '',
......@@ -222,7 +221,6 @@ export default {
},
// 表单规则
rules: {},
// 检查类型
statusOptions: [
{ value: '1', label: '已启用' },
......@@ -242,7 +240,7 @@ export default {
methods: {
/** 获取数据 */
getList() {
listItem().then(response => {
listItem({ itemType: '2' }).then(response => {
if (response.code === 200) {
console.log('aaa', response)
if (response.rows.length > 0) {
......@@ -250,19 +248,18 @@ export default {
} else {
this.form.settingList = [{
name: '',
type: '',
type: '2',
price: '',
supportInsure: '',
sort: '',
status: '1',
content: '',
itemType: '0'
itemType: '2'
}]
}
}
})
},
/** 项目单价校验 */
validatePrice: function(rule, value, callback) {
console.log('value', value)
......@@ -272,33 +269,13 @@ export default {
callback()
}
},
// 是权重不可以输入小数
handleBlur() {
const parsedValue = parseFloat(this.form.sort)
if (!isNaN(parsedValue)) {
this.form.sort = parsedValue.toFixed(0) // 保留一位小数并进行四舍五入
}
},
// 权重不能为0
validWeigh(rule, value, callback) {
if (value > 0) {
callback()
} else {
/** 权重校验 */
validateSort: function(rule, value, callback) {
console.log('value', value)
if (value === 0) {
callback(new Error('权重不能为0'))
}
},
// 单位时段服务数不能为0
validUseNum(rule, value, callback) {
if (value > 0) {
callback()
} else {
callback(new Error('单位时段服务数不能为0'))
}
},
// 禁止输入空格
keydown(e) {
if (e.keyCode === 32) {
e.returnValue = false
callback()
}
},
/** 将阿拉伯数字转成汉字(如:1变成一)*/
......@@ -372,7 +349,7 @@ export default {
handleAddItem() {
this.form.settingList.push({
name: '',
type: '',
type: '2',
price: '',
supportInsure: '',
sort: '',
......@@ -381,11 +358,6 @@ export default {
itemType: '2'
})
},
cancel() {
this.$router.push({
path: '/equipment-management/equipment-management'
})
},
// 提交
handleSubmit() {
this.$refs['form'].validate(valid => {
......@@ -393,7 +365,6 @@ export default {
console.log('成功通过....')
const addList = JSON.parse(JSON.stringify(this.form.settingList))
console.log('新增或者修改的集合', addList)
console.log('this.form.settingList', this.form.settingList)
// 开始加loading遮罩, 防止操作
// this.fullscreenLoading = true
updateItem(addList).then(response => {
......@@ -403,17 +374,21 @@ export default {
// 解开遮罩层
this.$message.success('操作成功')
// this.fullscreenLoading = false
// 提交成功后返回表格
this.$router.push({
path: '/equipment-management/equipment-management'
})
}
})
}
})
},
// 返回
cancel() {
this.$router.push({
path: '/equipment-management/equipment-management'
})
}
// // 返回
// handleGoBack() {
// this.$router.push({
// path: '/service-management/medical-record-management'
// })
// }
}
}
</script>
......
......@@ -149,7 +149,7 @@
</span>
</template>
</el-table-column>
<el-table-column v-if="userType=== '00'" label="平台自有设备" align="left" prop="isPrivate">
<el-table-column v-if=" userType=== '00'" label="平台自有设备" align="left" prop="isPrivate">
<template slot-scope="scope">
<span v-if="scope.row.isPrivate === '0'"></span>
<span v-else-if="scope.row.isPrivate === '1'"></span>
......@@ -252,12 +252,13 @@ import { regionData } from 'element-china-area-data'
import { listDevice, delDevice, listDeviceAll } from '@/api/business/device'
import { getInfo } from '@/api/login'
import { parseTime } from '@/utils/ruoyi'
import { mapGetters } from 'vuex'
export default {
name: 'EquipmentManagement',
dicts: ['device_status', 'device_type', 'exam_type'],
data() {
data: function() {
return {
// 支持检查类型
checkType: [],
......@@ -266,6 +267,7 @@ export default {
isPrivate: '',
// 下单价格
orderShow: true,
// 筛选列表
sortedColumn: '',
// 可以使用的时间段时间范围
......@@ -349,8 +351,9 @@ export default {
citys: regionData,
// 遮罩层
loading: false,
// 用户类型
userType: '',
// // 用户类型
// userType: '',
isShow: false,
// 选中数组
ids: [],
// 非单个禁用
......@@ -448,6 +451,9 @@ export default {
}
}
},
computed: {
...mapGetters(['userType'])
},
watch: {
useTime: {
handler(newVal, oldVal) {
......@@ -464,7 +470,6 @@ export default {
},
created() {
this.getList()
this.getUserInfo()
},
methods: {
// 获取登陆人信息
......@@ -529,6 +534,7 @@ export default {
// })
this.total = response.total
this.loading = false
// console.log("---------------------",this.userType)
})
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment