parent
cc2394588b
commit
e34e032aeb
|
@ -602,79 +602,79 @@ export default {
|
||||||
//生产需替换
|
//生产需替换
|
||||||
//互动管理菜单 - 每8秒检查一个功能下是否有未处理信息 单个重复检测时间为60秒
|
//互动管理菜单 - 每8秒检查一个功能下是否有未处理信息 单个重复检测时间为60秒
|
||||||
//紧急求助
|
//紧急求助
|
||||||
// this.chatNumJjqz = setInterval(() => {
|
this.chatNumJjqz = setInterval(() => {
|
||||||
// this.dataSelectJjqz()
|
this.dataSelectJjqz()
|
||||||
// }, 60000)
|
}, 60000)
|
||||||
// //视频圈
|
// //视频圈
|
||||||
// setTimeout(() => {
|
setTimeout(() => {
|
||||||
// this.chatNumSpq = setInterval(() => {
|
this.chatNumSpq = setInterval(() => {
|
||||||
// this.dataSelectSpq()
|
this.dataSelectSpq()
|
||||||
// }, 60000)
|
}, 60000)
|
||||||
// }, 8000);
|
}, 8000);
|
||||||
// //投诉中心
|
// //投诉中心
|
||||||
// setTimeout(() => {
|
setTimeout(() => {
|
||||||
// this.chatNumQy = setInterval(() => {
|
this.chatNumQy = setInterval(() => {
|
||||||
// this.dataSelectPy()
|
this.dataSelectPy()
|
||||||
// }, 60000)
|
}, 60000)
|
||||||
// }, 16000);
|
}, 16000);
|
||||||
// //聊天室
|
// //聊天室
|
||||||
// setTimeout(() => {
|
setTimeout(() => {
|
||||||
// this.chatNumLts = setInterval(() => {
|
this.chatNumLts = setInterval(() => {
|
||||||
// this.dataSelectLts()
|
this.dataSelectLts()
|
||||||
// }, 60000)
|
}, 60000)
|
||||||
// }, 24000);
|
}, 24000);
|
||||||
// //消息中心
|
// //消息中心
|
||||||
// setTimeout(() => {
|
setTimeout(() => {
|
||||||
// this.chatNumXxzx = setInterval(() => {
|
this.chatNumXxzx = setInterval(() => {
|
||||||
// this.dataSelectXxzx()
|
this.dataSelectXxzx()
|
||||||
// }, 60000)
|
}, 60000)
|
||||||
// }, 32000);
|
}, 32000);
|
||||||
// // 新用户注册
|
// // 新用户注册
|
||||||
// setTimeout(() => {
|
setTimeout(() => {
|
||||||
// this.chatNumXyhzc = setInterval(() => {
|
this.chatNumXyhzc = setInterval(() => {
|
||||||
// this.dataSelectXyhzc()
|
this.dataSelectXyhzc()
|
||||||
// }, 60000)
|
}, 60000)
|
||||||
// }, 40000);
|
}, 40000);
|
||||||
// //实名认证
|
// //实名认证
|
||||||
// this.chatNumJl = setInterval(() => {
|
this.chatNumJl = setInterval(() => {
|
||||||
// this.dataSelect()
|
this.dataSelect()
|
||||||
// }, 6000)
|
}, 6000)
|
||||||
// this.chatNumYh = setInterval(() => {
|
this.chatNumYh = setInterval(() => {
|
||||||
// this.dataSelectYh()
|
this.dataSelectYh()
|
||||||
// }, 6000)
|
}, 6000)
|
||||||
// // 目前的逻辑是只有客服账号才有订单相关(新订单、警告订单、超时订单)的提示
|
// // 目前的逻辑是只有客服账号才有订单相关(新订单、警告订单、超时订单)的提示
|
||||||
// if ((this.userId && this.ringOrderId) && (this.userId == this.ringOrderId)) {
|
if ((this.userId && this.ringOrderId) && (this.userId == this.ringOrderId)) {
|
||||||
// this.chatNumJg = setInterval(() => {
|
this.chatNumJg = setInterval(() => {
|
||||||
// this.dataSelectJg()
|
this.dataSelectJg()
|
||||||
// }, 6000)
|
}, 6000)
|
||||||
// this.chatNumCs = setInterval(() => {
|
this.chatNumCs = setInterval(() => {
|
||||||
// this.dataSelectCs()
|
this.dataSelectCs()
|
||||||
// }, 6000)
|
}, 6000)
|
||||||
// this.chatNumXdd = setInterval(() => {
|
this.chatNumXdd = setInterval(() => {
|
||||||
// this.dataSelectXdd()
|
this.dataSelectXdd()
|
||||||
// }, 3000)
|
}, 3000)
|
||||||
// }
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
//生产需替换
|
//生产需替换
|
||||||
//紧急求助定时任务
|
//紧急求助定时任务
|
||||||
// clearInterval(this.chatNumJjqz);
|
clearInterval(this.chatNumJjqz);
|
||||||
// //视频圈定时任务
|
// //视频圈定时任务
|
||||||
// clearInterval(this.chatNumSpq);
|
clearInterval(this.chatNumSpq);
|
||||||
// //投诉中心定时任务
|
// //投诉中心定时任务
|
||||||
// clearInterval(this.chatNumQy);
|
clearInterval(this.chatNumQy);
|
||||||
// //聊天室定时任务
|
// //聊天室定时任务
|
||||||
// clearInterval(this.chatNumLts);
|
clearInterval(this.chatNumLts);
|
||||||
// //消息中心定时任务
|
// //消息中心定时任务
|
||||||
// clearInterval(this.chatNumXxzx);
|
clearInterval(this.chatNumXxzx);
|
||||||
// //新用户注册定时任务
|
// //新用户注册定时任务
|
||||||
// clearInterval(this.chatNumXyhzc);
|
clearInterval(this.chatNumXyhzc);
|
||||||
// clearInterval(this.chatNum)
|
clearInterval(this.chatNum)
|
||||||
// clearInterval(this.chatNumJl);
|
clearInterval(this.chatNumJl);
|
||||||
// clearInterval(this.chatNumYh);
|
clearInterval(this.chatNumYh);
|
||||||
// clearInterval(this.chatNumJg);
|
clearInterval(this.chatNumJg);
|
||||||
// clearInterval(this.chatNumCs);
|
clearInterval(this.chatNumCs);
|
||||||
// clearInterval(this.chatNumXdd);
|
clearInterval(this.chatNumXdd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,175 +1,207 @@
|
||||||
<template>
|
<template>
|
||||||
<el-dialog :title="!dataForm.id ? '出行新增' : '出行修改'" :close-on-click-modal="false" :visible.sync="visible">
|
<el-dialog
|
||||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="140px">
|
:title="!dataForm.id ? '出行新增' : '出行修改'"
|
||||||
<el-row>
|
:close-on-click-modal="false"
|
||||||
<el-col :span="12">
|
:visible.sync="visible"
|
||||||
<el-form-item label="切换时间点1" prop="time1">
|
>
|
||||||
<el-time-picker
|
<el-form
|
||||||
v-model="dataForm.time1"
|
:model="dataForm"
|
||||||
placeholder="选择时间">
|
:rules="dataRule"
|
||||||
</el-time-picker>
|
ref="dataForm"
|
||||||
</el-form-item>
|
@keyup.enter.native="dataFormSubmit()"
|
||||||
</el-col>
|
label-width="140px"
|
||||||
<el-col :span="12">
|
>
|
||||||
<el-form-item label="切换时间点2" prop="time2">
|
<el-row>
|
||||||
<el-time-picker
|
<!-- 时间选择器添加 type="time" 属性 -->
|
||||||
v-model="dataForm.time2"
|
<el-col :span="12">
|
||||||
placeholder="选择时间">
|
<el-form-item
|
||||||
</el-time-picker>
|
label="切换时间点1"
|
||||||
</el-form-item>
|
prop="time1"
|
||||||
</el-col>
|
>
|
||||||
<el-col :span="12">
|
<el-time-picker
|
||||||
<el-form-item label="出行方式1" prop="travelType1">
|
v-model="dataForm.time1"
|
||||||
<el-radio-group v-model="dataForm.travelType1">
|
placeholder="选择时间"
|
||||||
<el-radio :label="1">公交</el-radio>
|
type="time"
|
||||||
<el-radio :label="2">出租</el-radio>
|
></el-time-picker>
|
||||||
<el-radio :label="3">免费</el-radio>
|
</el-form-item>
|
||||||
</el-radio-group>
|
</el-col>
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
<el-col :span="12">
|
||||||
<el-col :span="12">
|
<el-form-item
|
||||||
<el-form-item label="出行方式2" prop="travelType2">
|
label="切换时间点2"
|
||||||
<el-radio-group v-model="dataForm.travelType2">
|
prop="time2"
|
||||||
<el-radio :label="1">公交</el-radio>
|
>
|
||||||
<el-radio :label="2">出租</el-radio>
|
<el-time-picker
|
||||||
<el-radio :label="3">免费</el-radio>
|
v-model="dataForm.time2"
|
||||||
</el-radio-group>
|
placeholder="选择时间"
|
||||||
</el-form-item>
|
type="time"
|
||||||
</el-col>
|
></el-time-picker>
|
||||||
<el-col :span="12">
|
</el-form-item>
|
||||||
<el-form-item label="免费公里数1" prop="travelNum1">
|
</el-col>
|
||||||
<el-input-number v-model="dataForm.travelNum1" controls-position="right" :precision="2" :min="0" :step="1"/>
|
|
||||||
</el-form-item>
|
<!-- 其余表单项保持不变 -->
|
||||||
</el-col>
|
<el-col :span="12">
|
||||||
<el-col :span="12">
|
<el-form-item label="出行方式1" prop="travelType1">
|
||||||
<el-form-item label="免费公里数2" prop="travelNum2">
|
<el-radio-group v-model="dataForm.travelType1">
|
||||||
<el-input-number v-model="dataForm.travelNum2" controls-position="right" :precision="2" :min="0" :step="1"/>
|
<el-radio :label="1">公交</el-radio>
|
||||||
</el-form-item>
|
<el-radio :label="2">出租</el-radio>
|
||||||
</el-col>
|
<el-radio :label="3">免费</el-radio>
|
||||||
</el-row>
|
</el-radio-group>
|
||||||
</el-form>
|
</el-form-item>
|
||||||
<span slot="footer" class="dialog-footer">
|
</el-col>
|
||||||
<el-button @click="visible = false">取消</el-button>
|
<el-col :span="12">
|
||||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
<el-form-item label="出行方式2" prop="travelType2">
|
||||||
</span>
|
<el-radio-group v-model="dataForm.travelType2">
|
||||||
|
<el-radio :label="1">公交</el-radio>
|
||||||
|
<el-radio :label="2">出租</el-radio>
|
||||||
|
<el-radio :label="3">免费</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="免费公里数1" prop="travelNum1">
|
||||||
|
<el-input-number
|
||||||
|
v-model="dataForm.travelNum1"
|
||||||
|
controls-position="right"
|
||||||
|
:precision="2"
|
||||||
|
:min="0"
|
||||||
|
:step="1"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="免费公里数2" prop="travelNum2">
|
||||||
|
<el-input-number
|
||||||
|
v-model="dataForm.travelNum2"
|
||||||
|
controls-position="right"
|
||||||
|
:precision="2"
|
||||||
|
:min="0"
|
||||||
|
:step="1"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||||
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
let defReqRule = (message = '不能为空') => { return { required: true, message, trigger: 'blur' } };
|
let defReqRule = (message = '不能为空') => ({
|
||||||
|
required: true,
|
||||||
export default {
|
message,
|
||||||
data() {
|
trigger: 'blur'
|
||||||
return {
|
});
|
||||||
visible: false,
|
|
||||||
dataForm: {
|
export default {
|
||||||
id: '',
|
data() {
|
||||||
updateTime: '',
|
return {
|
||||||
time1: new Date(1970, 1, 1, 6, 0, 0),
|
visible: false,
|
||||||
time2: new Date(1970, 1, 1, 18, 0, 0),
|
dataForm: {
|
||||||
pointTime1: '',
|
id: '',
|
||||||
pointTime2: '',
|
updateTime: '',
|
||||||
travelType1: '',
|
// **初始化为 null 而非默认日期**
|
||||||
travelType2: '',
|
time1: null,
|
||||||
travelNum1: '',
|
time2: null,
|
||||||
travelNum2: '',
|
pointTime1: '',
|
||||||
},
|
pointTime2: '',
|
||||||
dataRule: {
|
travelType1: '',
|
||||||
pointTime1: [ defReqRule('请选择切换时间点1') ],
|
travelType2: '',
|
||||||
pointTime2: [ defReqRule('请选择切换时间点2') ],
|
travelNum1: '',
|
||||||
travelType1: [ defReqRule('请选择出行方式1') ],
|
travelNum2: '',
|
||||||
travelType2: [ defReqRule('请选择出行方式2') ],
|
|
||||||
travelNum1: [ defReqRule('请输入免费公里数1') ],
|
|
||||||
travelNum2: [ defReqRule('请输入免费公里数2') ],
|
|
||||||
},
|
|
||||||
index: 0
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
dataRule: {
|
||||||
isEdit() {
|
// **校验字段同步为 time1/time2**
|
||||||
return !(this.dataForm || {}).id;
|
time1: [defReqRule('请选择切换时间点1')],
|
||||||
},
|
time2: [defReqRule('请选择切换时间点2')],
|
||||||
isDisabled() {
|
travelType1: [defReqRule('请选择出行方式1')],
|
||||||
return !this.isEdit;
|
travelType2: [defReqRule('请选择出行方式2')],
|
||||||
},
|
travelNum1: [defReqRule('请输入免费公里数1')],
|
||||||
|
travelNum2: [defReqRule('请输入免费公里数2')],
|
||||||
},
|
},
|
||||||
methods: {
|
index: 0
|
||||||
init(index, id) {
|
};
|
||||||
this.index = index
|
},
|
||||||
this.dataForm.id = id
|
computed: {
|
||||||
this.visible = true
|
isEdit() {
|
||||||
this.$nextTick(() => {
|
return !!this.dataForm.id;
|
||||||
this.$refs['dataForm'].resetFields()
|
}
|
||||||
if (this.dataForm.id) {
|
},
|
||||||
this.$http({
|
methods: {
|
||||||
url: this.$http.adornUrl(`travelAdjust/info/${this.dataForm.id}`),
|
init(index, id) {
|
||||||
method: 'get',
|
this.index = index;
|
||||||
params: this.$http.adornParams()
|
this.dataForm.id = id;
|
||||||
}).then(({ data }) => {
|
this.visible = true;
|
||||||
if (data && data.code === 0) {
|
this.$nextTick(() => {
|
||||||
this.dataForm = data.data
|
this.$refs['dataForm'].resetFields();
|
||||||
this.dataForm.time1 = new Date("1970-01-01 "+this.dataForm.pointTime1);
|
if (this.dataForm.id) {
|
||||||
this.dataForm.time2 = new Date("1970-01-01 "+this.dataForm.pointTime2);
|
this.$http({
|
||||||
}
|
url: this.$http.adornUrl(`travelAdjust/info/${this.dataForm.id}`),
|
||||||
})
|
method: 'get',
|
||||||
|
params: this.$http.adornParams()
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
// **使用 ISO 格式转换时间**
|
||||||
|
this.dataForm.time1 = new Date(`1970-01-01T${data.data.pointTime1}`);
|
||||||
|
this.dataForm.time2 = new Date(`1970-01-01T${data.data.pointTime2}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// **显式重置时间字段**
|
||||||
|
this.dataForm.time1 = null;
|
||||||
|
this.dataForm.time2 = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
padZero(num) {
|
||||||
|
return num > 9 ? num : `0${num}`;
|
||||||
|
},
|
||||||
|
formatTime(time) { // **时间格式转换方法**
|
||||||
|
if (!time) return '';
|
||||||
|
const date = new Date(time);
|
||||||
|
return `${this.padZero(date.getHours())}:${this.padZero(date.getMinutes())}:${this.padZero(date.getSeconds())}`;
|
||||||
|
},
|
||||||
|
dataFormSubmit() {
|
||||||
|
this.$refs['dataForm'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
const saveData = { ...this.dataForm };
|
||||||
|
// **转换时间为字符串格式**
|
||||||
|
saveData.pointTime1 = this.formatTime(saveData.time1);
|
||||||
|
saveData.pointTime2 = this.formatTime(saveData.time2);
|
||||||
|
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl(`${!saveData.id ? 'travelAdjust/add' : 'travelAdjust/update'}`),
|
||||||
|
method: 'post',
|
||||||
|
data: this.$http.adornData({
|
||||||
|
...saveData,
|
||||||
|
id: saveData.id || undefined
|
||||||
|
})
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.$message({
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.visible = false;
|
||||||
|
if (this.index === 1) {
|
||||||
|
this.$emit('refreshDataList');
|
||||||
} else {
|
} else {
|
||||||
//重置表单
|
this.$emit('refreshDataLister');
|
||||||
Object.keys(this.dataForm).forEach(x => {
|
|
||||||
this.dataForm[x] = '';
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
},
|
});
|
||||||
padZero(num) {
|
} else {
|
||||||
return num > 9 ? num : `0${num}`;
|
this.$message.error(data.msg);
|
||||||
},
|
}
|
||||||
formateTime(timeStr) {
|
});
|
||||||
const date = new Date(timeStr);
|
}
|
||||||
const hour = this.padZero(date.getHours());
|
});
|
||||||
const min = this.padZero(date.getMinutes());
|
}
|
||||||
const second = this.padZero(date.getSeconds());
|
|
||||||
return `${hour}:${min}:${second}`;
|
|
||||||
},
|
|
||||||
// 表单提交
|
|
||||||
dataFormSubmit() {
|
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
let saveData = Object.assign({}, this.dataForm);
|
|
||||||
this.dataForm.pointTime1 = this.formateTime(this.dataForm.time1);
|
|
||||||
this.dataForm.pointTime2 = this.formateTime(this.dataForm.time2);
|
|
||||||
this.$http({
|
|
||||||
url: this.$http.adornUrl(`travelAdjust/${!saveData.id ? 'add' : 'update'}`),
|
|
||||||
method: 'post',
|
|
||||||
data: this.$http.adornData({
|
|
||||||
...saveData,
|
|
||||||
'id': saveData.id || undefined,
|
|
||||||
})
|
|
||||||
}).then(({
|
|
||||||
data
|
|
||||||
}) => {
|
|
||||||
if (data && data.code === 0) {
|
|
||||||
this.$message({
|
|
||||||
message: '操作成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 1500,
|
|
||||||
onClose: () => {
|
|
||||||
this.visible = false
|
|
||||||
console.log('this.index', this.index)
|
|
||||||
if (this.index == 1) {
|
|
||||||
this.$emit('refreshDataList')
|
|
||||||
} else {
|
|
||||||
this.$emit('refreshDataLister')
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$message.error(data.msg)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
};
|
||||||
|
</script>
|
Loading…
Reference in New Issue