|
|
@@ -7,7 +7,7 @@ import { Search,Download,Tools,Plus,Check,Close } from "@element-plus/icons-vue"
|
|
|
let searchkey=ref('')
|
|
|
let isauto=ref('')
|
|
|
let viewType=ref(1)
|
|
|
-import { apisystemdzbcArealist,apisystemdzbcAreaexport,apisystemdzbcAreaDel,apisystemdzbcAreaAdd,apisystemdzbcAreaUpdate } from '../../request/api.js'
|
|
|
+import { apisystemdzbcPathSchedulinglist,apisystemdzbcPathSchedulingexport,apisystemdzbcPathSchedulingDel,apisystemdzbcPathSchedulingAdd,apisystemdzbcPathSchedulingUpdate } from '../../request/api.js'
|
|
|
import type { ComponentSize, FormInstance, FormRules } from 'element-plus'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
interface RuleForm {
|
|
|
@@ -55,7 +55,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
if (valid) {
|
|
|
if(ruleForm.id){
|
|
|
|
|
|
- apisystemdzbcAreaUpdate(ruleForm).then((res:any)=>{
|
|
|
+ apisystemdzbcPathSchedulingUpdate(ruleForm).then((res:any)=>{
|
|
|
getTableData()
|
|
|
ElMessage({
|
|
|
message: '操作成功',
|
|
|
@@ -67,7 +67,8 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
console.log(err)
|
|
|
})
|
|
|
}else{
|
|
|
- apisystemdzbcAreaAdd(ruleForm).then((res:any)=>{
|
|
|
+ apisystemdzbcPathSchedulingAdd(ruleForm).then((res:any)=>{
|
|
|
+ if(res.code==200){
|
|
|
getTableData()
|
|
|
ElMessage({
|
|
|
message: '操作成功',
|
|
|
@@ -75,6 +76,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
duration: 3 * 1000
|
|
|
});
|
|
|
dialogVisible.value=false
|
|
|
+ }
|
|
|
}).catch((err:any)=>{
|
|
|
console.log(err)
|
|
|
})
|
|
|
@@ -95,7 +97,7 @@ let searchWord=ref('')
|
|
|
let total=ref(0)
|
|
|
let pageNum=ref(1)
|
|
|
let dialogVisible=ref(false)
|
|
|
-let logtitle=ref('新增定制班车-区域')
|
|
|
+let logtitle=ref('新增定制班车-路线排班')
|
|
|
let loading=ref(true)
|
|
|
let excellloading=ref(false)
|
|
|
const tableData = ref([])
|
|
|
@@ -107,18 +109,18 @@ const addItem=data=>{
|
|
|
for(let key in data){
|
|
|
ruleForm[key]=data[key]
|
|
|
}
|
|
|
- logtitle.value='编辑定制班车-区域'
|
|
|
+ logtitle.value='编辑定制班车-路线排班'
|
|
|
}else{
|
|
|
for(let key in initData){
|
|
|
ruleForm[key]=initData[key]
|
|
|
}
|
|
|
- logtitle.value='新增定制班车-区域'
|
|
|
+ logtitle.value='新增定制班车-路线排班'
|
|
|
}
|
|
|
dialogVisible.value=true
|
|
|
}
|
|
|
const downExcell=()=>{
|
|
|
excellloading.value=true
|
|
|
- apisystemdzbcAreaexport({}).then((res:any)=>{
|
|
|
+ apisystemdzbcPathSchedulingexport({}).then((res:any)=>{
|
|
|
|
|
|
// 这里 data 是返回来的二进制数据
|
|
|
let blob = new Blob([res], {
|
|
|
@@ -141,7 +143,7 @@ const downExcell=()=>{
|
|
|
})
|
|
|
}
|
|
|
const getTableData=()=>{
|
|
|
- apisystemdzbcArealist({
|
|
|
+ apisystemdzbcPathSchedulinglist({
|
|
|
|
|
|
}).then(res=>{
|
|
|
if(res.code==200){
|
|
|
@@ -156,7 +158,7 @@ const getTableData=()=>{
|
|
|
}
|
|
|
//
|
|
|
const deleteItem=(id)=>{
|
|
|
- apisystemdzbcAreaDel({id}).then((res:any)=>{
|
|
|
+ apisystemdzbcPathSchedulingDel({id}).then((res:any)=>{
|
|
|
getTableData()
|
|
|
ElMessage({
|
|
|
message: '操作成功',
|
|
|
@@ -277,6 +279,7 @@ onMounted(()=>{
|
|
|
<div>深圳湾线 - 排班表</div>
|
|
|
<el-switch style="margin:0 6px" v-model="isauto" />
|
|
|
<div style="color: #4B5563;font-size:14px;font-weight: 400;">自动续排</div>
|
|
|
+ <el-button v-if="viewType==2" style="margin-left:6px" type="primary" :icon="Plus" @click="addItem({})">添加排班 </el-button>
|
|
|
</div>
|
|
|
<div class="title-right">
|
|
|
<el-button @click="viewType=1">月视图 </el-button>
|
|
|
@@ -284,7 +287,14 @@ onMounted(()=>{
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="common-chart-wrap" id="caruse-wrap">
|
|
|
- <el-calendar v-if="viewType==1" :range="[new Date(2019, 2, 4), new Date(2019, 2, 24)]" />
|
|
|
+ <el-calendar v-if="viewType==1" :range="[new Date(2019, 2, 4), new Date(2019, 2, 24)]">
|
|
|
+ <template #date-cell="{ data }">
|
|
|
+ <p :class="data.isSelected ? 'is-selected' : ''">
|
|
|
+ {{ data.day.split('-').slice(1).join('-') }}
|
|
|
+ {{ data.isSelected ? '✔️' : '' }}
|
|
|
+ </p>
|
|
|
+ </template>
|
|
|
+ </el-calendar>
|
|
|
<el-table v-if="viewType==2" element-loading-text='加载中' header-row-class-name="reset-gray-head" :data="tableData" style="width: 100%" v-loading="loading">
|
|
|
<el-table-column prop="name" label="路线">
|
|
|
|
|
|
@@ -392,6 +402,75 @@ onMounted(()=>{
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialogVisible"
|
|
|
+ :title="logtitle"
|
|
|
+ width="600"
|
|
|
+ >
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <el-form
|
|
|
+ ref="ruleFormRef"
|
|
|
+ :model="ruleForm"
|
|
|
+ label-position="top"
|
|
|
+ :rules="rules"
|
|
|
+ label-width="auto"
|
|
|
+ :size="formSize"
|
|
|
+ status-icon
|
|
|
+ >
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="路线" prop="pathId">
|
|
|
+ <el-input v-model="ruleForm.pathId" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="车辆">
|
|
|
+ <el-input v-model="ruleForm.carId" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="排班日期">
|
|
|
+ <el-input v-model="ruleForm.mdate" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="开始时间">
|
|
|
+ <el-input v-model="ruleForm.mtime" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="备注">
|
|
|
+ <el-input v-model="ruleForm.remark" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false" :icon="Close">取消</el-button>
|
|
|
+ <el-button type="primary" :icon="Check" @click="submitForm(ruleFormRef)">
|
|
|
+ 确认创建
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|