出行调整

This commit is contained in:
曹磊 2025-03-17 15:36:26 +08:00
parent cef9f18921
commit 36394d5de8
4 changed files with 304 additions and 2 deletions

View File

@ -135,6 +135,7 @@ const mainRoutes = {
{ path: '/packageOrder', component: _import('bl/order/packageOrder'), name: 'packageOrder', meta: { title: '服务包订单', isTab: true } },
{ path: '/dlssqjl', component: _import('dlssqjl/dlssqjl'), name: 'dlssqjl', meta: { title: '代理商申请', isTab: true } },
{ path: '/travelConf', component: _import('travelConf/index'), name: 'travelConf', meta: { title: '出行配置', isTab: true } },
{ path: '/travelAdjust', component: _import('travelAdjust/index'), name: 'travelAdjust', meta: { title: '出行调整', isTab: true } },
{ path: '/fxyConfig', component: _import('bl/commission/fxy/fxyConfig'), name: 'fxyConfig', meta: { title: '分销员设置', isTab: true } },
{ path: '/fxyApply', component: _import('bl/commission/fxy/fxyApply'), name: 'fxyApply', meta: { title: '分销员审核', isTab: true } },
{ path: '/fxyData', component: _import('bl/commission/fxy/fxyData'), name: 'fxyData', meta: { title: '分销员数据', isTab: true } },

View File

@ -737,8 +737,6 @@
xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.open('POST', "https://admin.sjajk.com/sqx_fast/alioss/upload");//
// xhr.open('POST', "https://sausers.blxinchuang.com/sqx_fast/alioss/upload");
// xhr.open('POST', "http://localhost:8187/sqx_fast/alioss/upload");
xhr.onload = function() {
var json;

View File

@ -0,0 +1,175 @@
<template>
<el-dialog :title="!dataForm.id ? '出行新增' : '出行修改'" :close-on-click-modal="false" :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="140px">
<el-row>
<el-col :span="12">
<el-form-item label="切换时间点1" prop="time1">
<el-time-picker
v-model="dataForm.time1"
placeholder="选择时间">
</el-time-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="切换时间点2" prop="time2">
<el-time-picker
v-model="dataForm.time2"
placeholder="选择时间">
</el-time-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出行方式1" prop="travelType1">
<el-radio-group v-model="dataForm.travelType1">
<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="出行方式2" prop="travelType2">
<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>
</template>
<script>
let defReqRule = (message = '不能为空') => { return { required: true, message, trigger: 'blur' } };
export default {
data() {
return {
visible: false,
dataForm: {
id: '',
updateTime: '',
time1: new Date(1970, 1, 1, 6, 0, 0),
time2: new Date(1970, 1, 1, 18, 0, 0),
pointTime1: '',
pointTime2: '',
travelType1: '',
travelType2: '',
travelNum1: '',
travelNum2: '',
},
dataRule: {
pointTime1: [ defReqRule('请选择切换时间点1') ],
pointTime2: [ defReqRule('请选择切换时间点2') ],
travelType1: [ defReqRule('请选择出行方式1') ],
travelType2: [ defReqRule('请选择出行方式2') ],
travelNum1: [ defReqRule('请输入免费公里数1') ],
travelNum2: [ defReqRule('请输入免费公里数2') ],
},
index: 0
}
},
computed: {
isEdit() {
return !(this.dataForm || {}).id;
},
isDisabled() {
return !this.isEdit;
},
},
methods: {
init(index, id) {
this.index = index
this.dataForm.id = id
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`travelAdjust/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataForm = data.data
this.dataForm.time1 = new Date("1970-01-01 "+this.dataForm.pointTime1);
this.dataForm.time2 = new Date("1970-01-01 "+this.dataForm.pointTime2);
}
})
} else {
//
Object.keys(this.dataForm).forEach(x => {
this.dataForm[x] = '';
})
}
})
},
padZero(num) {
return num > 9 ? num : `0${num}`;
},
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>

View File

@ -0,0 +1,128 @@
<template>
<div class="mod-dict">
<div style="margin:6px 0;">
<span style="color: red;font-size: 12px;">技师出行方式不可自行调整时按照如下规则自动调整时间点1之后使用方式1出行时间点2之后使用方式2出行</span>
</div>
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
</el-form-item>
</el-form>
<el-table :data="dataList" border v-loading="dataListLoading" style="width: 100%;">
<el-table-column prop="updateTime" header-align="center" align="center" width="180" label="修改时间"/>
<el-table-column prop="pricingType" header-align="center" align="center" label="切换时间点1">
<template slot-scope="scope">
<span>{{ scope.row.pointTime1 }}</span>
</template>
</el-table-column>
<el-table-column prop="travelType" header-align="center" align="center" label="出行方式1">
<template slot-scope="scope">
<span v-if="scope.row.travelType1 == 1" class="people">公交</span>
<span v-if="scope.row.travelType1 == 2" class="people">出租</span>
<span v-if="scope.row.travelType1 == 3" class="people">免费</span>
</template>
</el-table-column>
<el-table-column prop="travelType" header-align="center" align="center" label="免费公里数1">
<template slot-scope="scope">
<span>{{ scope.row.travelNum1 }}</span>
</template>
</el-table-column>
<el-table-column prop="seasonsType" header-align="center" align="center" label="切换时间点2">
<template slot-scope="scope">
<span>{{ scope.row.pointTime2 }}</span>
</template>
</el-table-column>
<el-table-column prop="travelType" header-align="center" align="center" label="出行方式2">
<template slot-scope="scope">
<span v-if="scope.row.travelType2 == 1" class="people">公交</span>
<span v-if="scope.row.travelType2 == 2" class="people">出租</span>
<span v-if="scope.row.travelType2 == 3" class="people">免费</span>
</template>
</el-table-column>
<el-table-column prop="travelType" header-align="center" align="center" label="免费公里数2">
<template slot-scope="scope">
<span>{{ scope.row.travelNum2 }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="120" label="操作">
<template slot-scope="scope">
<el-button v-if="isAuth('travelConf:main:update')" type="text" size="small" @click="addOrUpdateHandle(1,scope.row.id)">修改</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex" :page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage" layout="total, sizes, prev, pager, next, jumper"/>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"/>
</div>
</template>
<script>
import AddOrUpdate from './add-or-update'
export default {
data() {
return {
dataForm: {
name: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated() {
this.getDataList()
},
methods: {
//
getDataList() {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('travelAdjust/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
...this.dataForm,
})
}).then(({ data: rdata }) => {
console.log(rdata);
let { code, data } = rdata || {};
let { records, total } = data || {};
if(code === 0){
this.dataList = records;
this.totalPage = total;
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
},
// /
addOrUpdateHandle(index,id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(index,id)
})
},
}
}
</script>