Commit d6a40082 authored by 王飞龙's avatar 王飞龙

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/views/equipment-management/equipment-management/equipment-detail.vue
parent 449e160a
...@@ -141,7 +141,8 @@ ...@@ -141,7 +141,8 @@
:picker-options="{ :picker-options="{
start: '01:00', start: '01:00',
step: '01:00', step: '01:00',
end: '12:00' end: '12:00',
maxTime:form.useTime.ame
}" }"
/> />
</el-form-item> </el-form-item>
...@@ -180,7 +181,8 @@ ...@@ -180,7 +181,8 @@
:picker-options="{ :picker-options="{
start: '12:00', start: '12:00',
step: '01:00', step: '01:00',
end: '24:00' end: '24:00',
maxTime:form.useTime.pme
}" }"
/> />
</el-form-item> </el-form-item>
...@@ -338,8 +340,7 @@ export default { ...@@ -338,8 +340,7 @@ export default {
// 设备归属 0 平台设备 1医院设备 // 设备归属 0 平台设备 1医院设备
isPrivate: '', isPrivate: '',
cityOptions: regionData, cityOptions: regionData,
// 存储省市区选中的地址码
selectedOptions: [],
// 地址码对用的文字 // 地址码对用的文字
addtions: { addtions: {
names: '' names: ''
...@@ -381,7 +382,7 @@ export default { ...@@ -381,7 +382,7 @@ export default {
{ required: true, message: '请输入详细地址地址(街道、楼牌号等)', trigger: 'blur' } { required: true, message: '请输入详细地址地址(街道、楼牌号等)', trigger: 'blur' }
], ],
'useTime.ams': [ 'useTime.ams': [
{ required: true, validator: this.validateMorningStart, trigger: 'change' } { required: true, validator: this.validateMorningStart, trigger: 'blur' }
], ],
'useTime.ame': [ 'useTime.ame': [
{ required: true, validator: this.validateMorningEnd, trigger: 'blur' } { required: true, validator: this.validateMorningEnd, trigger: 'blur' }
...@@ -456,10 +457,13 @@ export default { ...@@ -456,10 +457,13 @@ export default {
// 表单参数 // 表单参数
form: { form: {
deviceName: '', deviceName: '',
// 存储省市区选中的地址码
selectedOptions: [],
// appointmentMethod: '', // appointmentMethod: '',
sort: 0, sort: 0,
isPrivate: '1', isPrivate: '1',
serviceArea: '', serviceArea: [],
checkType: [],
head: '', head: '',
phone: '', phone: '',
useNum: 0, useNum: 0,
...@@ -512,6 +516,7 @@ export default { ...@@ -512,6 +516,7 @@ export default {
this.isPrivate = 0 this.isPrivate = 0
} }
console.log('登陆人', res) console.log('登陆人', res)
console.log('this.form--------------------', this.form)
}) })
}, },
// 时间段获取 // 时间段获取
...@@ -560,16 +565,16 @@ export default { ...@@ -560,16 +565,16 @@ export default {
}, },
// 选择地址 // 选择地址
handleChangeAddress(value) { handleChangeAddress(value) {
this.selectedOptions = value this.form.selectedOptions = value
console.log('地区码', this.selectedOptions) console.log('地区码', this.form.selectedOptions)
var name = '' var name = ''
this.selectedOptions.map(item => name += CodeToText[item] + '') // 将省市区三个拼接一起 this.form.selectedOptions.map(item => name += CodeToText[item] + '') // 将省市区三个拼接一起
this.addtions.names = name this.addtions.names = name
console.log(this.addtions.names) console.log(this.addtions.names)
// 运用了CodeToText把编码转成了中文 // 运用了CodeToText把编码转成了中文
this.addForm.province = CodeToText[this.selectedOptions[0]] this.addForm.province = CodeToText[ this.form.selectedOptions[0]]
this.addForm.county = CodeToText[this.selectedOptions[1]] this.addForm.county = CodeToText[ this.form.selectedOptions[1]]
this.addForm.area = CodeToText[this.selectedOptions[2]] this.addForm.area = CodeToText[ this.form.selectedOptions[2]]
if (this.addForm.county === '市辖区' || this.addForm.county === '县') { if (this.addForm.county === '市辖区' || this.addForm.county === '县') {
this.city = this.addForm.province this.city = this.addForm.province
} else { } else {
...@@ -618,7 +623,7 @@ export default { ...@@ -618,7 +623,7 @@ export default {
console.log('上午开始时间第一层报错') console.log('上午开始时间第一层报错')
callback(new Error('请选择上午开始时间')) callback(new Error('请选择上午开始时间'))
} else { } else {
if (isEmpty(value) && isEmpty(morningEnd)) { if (isEmpty(value) && isEmpty(!morningEnd)) {
console.log('上午开始时间第二层报错') console.log('上午开始时间第二层报错')
callback(new Error('请选择上午开始时间')) callback(new Error('请选择上午开始时间'))
} else { } else {
...@@ -632,7 +637,7 @@ export default { ...@@ -632,7 +637,7 @@ export default {
console.log('上午结束时间第一层报错') console.log('上午结束时间第一层报错')
callback(new Error('请选择上午结束时间')) callback(new Error('请选择上午结束时间'))
} else { } else {
if (isEmpty(value) && isEmpty(morningStart)) { if (isEmpty(value) && isEmpty(!morningStart)) {
console.log('上午结束时间第一层报错') console.log('上午结束时间第一层报错')
callback(new Error('请选择上午结束时间')) callback(new Error('请选择上午结束时间'))
} else { } else {
...@@ -646,7 +651,7 @@ export default { ...@@ -646,7 +651,7 @@ export default {
console.log(' 下午开始时间第一层报错') console.log(' 下午开始时间第一层报错')
callback(new Error('请选择下午开始时间')) callback(new Error('请选择下午开始时间'))
} else { } else {
if (isEmpty(value) && isEmpty(afternoonEnd)) { if (isEmpty(value) && isEmpty(!afternoonEnd)) {
console.log('下午开始时间开始第二层报错') console.log('下午开始时间开始第二层报错')
callback(new Error('请选择下午开始时间')) callback(new Error('请选择下午开始时间'))
} else { } else {
...@@ -660,7 +665,7 @@ export default { ...@@ -660,7 +665,7 @@ export default {
console.log('下午结束时间结束第一层报错') console.log('下午结束时间结束第一层报错')
callback(new Error('请选择下午结束时间')) callback(new Error('请选择下午结束时间'))
} else { } else {
if (isEmpty(value) && isEmpty(afternoonStart)) { if (isEmpty(value) && isEmpty(!afternoonStart)) {
console.log('下午结束时间结束第二层报错') console.log('下午结束时间结束第二层报错')
callback(new Error('请选择下午结束时间')) callback(new Error('请选择下午结束时间'))
} else { } else {
...@@ -672,8 +677,8 @@ export default { ...@@ -672,8 +677,8 @@ export default {
submitForm() { submitForm() {
const form = deepClone(this.form) const form = deepClone(this.form)
console.log('this.form-----------------------', this.form) console.log('this.form-----------------------', this.form)
if (this.selectedOptions != null) { if (form.selectedOptions != null) {
form.addressCode = this.selectedOptions.join(',') form.addressCode = form.selectedOptions.join(',')
} }
if (this.addtions.names != null) { if (this.addtions.names != null) {
form.addressText = this.addtions.names form.addressText = this.addtions.names
...@@ -692,8 +697,6 @@ export default { ...@@ -692,8 +697,6 @@ export default {
} }
form.isPrivate = this.isPrivate form.isPrivate = this.isPrivate
this.loading = true this.loading = true
// TODO: please clear this log
console.log('form=======================================', form)
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
addDevice(form).then(response => { addDevice(form).then(response => {
......
...@@ -451,7 +451,8 @@ ...@@ -451,7 +451,8 @@
:picker-options="{ :picker-options="{
start: '01:00', start: '01:00',
step: '01:00', step: '01:00',
end: '12:00' end: '12:00',
maxTime:form.useTime.ame
}" }"
/> />
</el-form-item> </el-form-item>
...@@ -489,7 +490,8 @@ ...@@ -489,7 +490,8 @@
:picker-options="{ :picker-options="{
start: '12:00', start: '12:00',
step: '01:00', step: '01:00',
end: '24:00' end: '24:00',
maxTime:form.useTime.pme
}" }"
/> />
</el-form-item> </el-form-item>
...@@ -713,8 +715,8 @@ export default { ...@@ -713,8 +715,8 @@ export default {
{ required: true, message: '请选择设备类型', trigger: 'change' } { required: true, message: '请选择设备类型', trigger: 'change' }
], ],
selectedOptions: [ selectedOptions: [
// { required: true, message: '请选择服务地点', trigger: 'blur' } { required: true, message: '请选择服务地点', trigger: 'blur' },
{ required: true, validator: this.validaddress, trigger: 'blur' } { type: 'number', validator: this.validaddress, trigger: 'change' }
], ],
// addressCode: [ // addressCode: [
// { required: true, message: '请选择服务地点', trigger: 'change,blur' } // { required: true, message: '请选择服务地点', trigger: 'change,blur' }
...@@ -723,7 +725,7 @@ export default { ...@@ -723,7 +725,7 @@ export default {
{ required: true, message: '请输入服务地址', trigger: 'blur' } { required: true, message: '请输入服务地址', trigger: 'blur' }
], ],
'useTime.ams': [ 'useTime.ams': [
{ required: true, validator: this.validateMorningStart, trigger: 'change' } { required: true, validator: this.validateMorningStart, trigger: 'blur' }
], ],
'useTime.ame': [ 'useTime.ame': [
{ required: true, validator: this.validateMorningEnd, trigger: 'blur' } { required: true, validator: this.validateMorningEnd, trigger: 'blur' }
...@@ -752,10 +754,12 @@ export default { ...@@ -752,10 +754,12 @@ export default {
{ min: 2, max: 200, message: '备注长度必须介于2~200之间', trigger: 'blur' } { min: 2, max: 200, message: '备注长度必须介于2~200之间', trigger: 'blur' }
], ],
serviceArea: [ serviceArea: [
{ required: true, message: '请选择支持服务地区', trigger: 'blur' } { required: true, message: '请选择支持服务地区', trigger: 'blur' },
{ type: 'number', validator: this.validserviceArea, trigger: 'change' }
], ],
checkType: [ checkType: [
{ required: true, message: '请选择支持检查类型', trigger: 'blur' } { required: true, message: '请选择支持检查类型', trigger: 'blur' },
{ type: 'number', validator: this.validcheckType, trigger: 'change' }
] ]
}, },
// 是否平台自有设备 // 是否平台自有设备
...@@ -899,6 +903,7 @@ export default { ...@@ -899,6 +903,7 @@ export default {
callback(new Error('单位时段服务数不能为0')) callback(new Error('单位时段服务数不能为0'))
} }
}, },
// 服务地点表单校验
validaddress(rule, value, callback) { validaddress(rule, value, callback) {
console.log('validaddress', this.form.selectedOptions) console.log('validaddress', this.form.selectedOptions)
if (this.form.selectedOptions.length > 0) { if (this.form.selectedOptions.length > 0) {
...@@ -907,6 +912,24 @@ export default { ...@@ -907,6 +912,24 @@ export default {
callback(new Error('请选择服务地点')) callback(new Error('请选择服务地点'))
} }
}, },
// 支持服务地区表单校验
validserviceArea(rule, value, callback) {
console.log('validaddress', this.form.serviceArea)
if (this.form.serviceArea.length > 0) {
callback()
} else {
callback(new Error('请选择支持检查项目'))
}
},
// 支持检查类型表单校验
validcheckType(rule, value, callback) {
console.log('validaddress', this.form.checkType)
if (this.form.checkType.length > 0) {
callback()
} else {
callback(new Error('请选择支持服务地区'))
}
},
// 四个时间的表单校验 // 四个时间的表单校验
validateMorningStart(rule, value, callback) { validateMorningStart(rule, value, callback) {
// // TODO: please clear this log // // TODO: please clear this log
...@@ -921,7 +944,7 @@ export default { ...@@ -921,7 +944,7 @@ export default {
console.log('上午开始时间第一层报错') console.log('上午开始时间第一层报错')
callback(new Error('请选择上午开始时间')) callback(new Error('请选择上午开始时间'))
} else { } else {
if (isEmpty(value) && isEmpty(morningEnd)) { if (isEmpty(value) && isEmpty(!morningEnd)) {
console.log('上午开始时间第二层报错') console.log('上午开始时间第二层报错')
callback(new Error('请选择上午开始时间')) callback(new Error('请选择上午开始时间'))
} else { } else {
...@@ -935,7 +958,7 @@ export default { ...@@ -935,7 +958,7 @@ export default {
console.log('上午结束时间第一层报错') console.log('上午结束时间第一层报错')
callback(new Error('请选择上午结束时间')) callback(new Error('请选择上午结束时间'))
} else { } else {
if (isEmpty(value) && isEmpty(morningStart)) { if (isEmpty(value) && isEmpty(!morningStart)) {
console.log('上午结束时间第一层报错') console.log('上午结束时间第一层报错')
callback(new Error('请选择上午结束时间')) callback(new Error('请选择上午结束时间'))
} else { } else {
...@@ -949,7 +972,7 @@ export default { ...@@ -949,7 +972,7 @@ export default {
console.log(' 下午开始时间第一层报错') console.log(' 下午开始时间第一层报错')
callback(new Error('请选择下午开始时间')) callback(new Error('请选择下午开始时间'))
} else { } else {
if (isEmpty(value) && isEmpty(afternoonEnd)) { if (isEmpty(value) && isEmpty(!afternoonEnd)) {
console.log('下午开始时间开始第二层报错') console.log('下午开始时间开始第二层报错')
callback(new Error('请选择下午开始时间')) callback(new Error('请选择下午开始时间'))
} else { } else {
...@@ -963,7 +986,7 @@ export default { ...@@ -963,7 +986,7 @@ export default {
console.log('下午结束时间结束第一层报错') console.log('下午结束时间结束第一层报错')
callback(new Error('请选择下午结束时间')) callback(new Error('请选择下午结束时间'))
} else { } else {
if (isEmpty(value) && isEmpty(afternoonStart)) { if (isEmpty(value) && isEmpty(!afternoonStart)) {
console.log('下午结束时间结束第二层报错') console.log('下午结束时间结束第二层报错')
callback(new Error('请选择下午结束时间')) callback(new Error('请选择下午结束时间'))
} else { } else {
......
...@@ -515,6 +515,7 @@ export default { ...@@ -515,6 +515,7 @@ export default {
}, },
/** 查询设备列表 */ /** 查询设备列表 */
getList() { getList() {
this.loading = true
if (this.daterangeCreateTime !== '') { if (this.daterangeCreateTime !== '') {
this.queryParams.beginCheckTime = this.daterangeCreateTime + ' 00:00:00' this.queryParams.beginCheckTime = this.daterangeCreateTime + ' 00:00:00'
this.queryParams.endCheckTime = this.daterangeCreateTime + ' 23:59:59' this.queryParams.endCheckTime = this.daterangeCreateTime + ' 23:59:59'
......
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