Browse Source

接口优化

wsp 1 năm trước cách đây
mục cha
commit
43186ee9d1

+ 2 - 0
components.d.ts

@@ -28,9 +28,11 @@ declare module 'vue' {
     ElMain: typeof import('element-plus/es')['ElMain']
     ElMenu: typeof import('element-plus/es')['ElMenu']
     ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
+    ElOption: typeof import('element-plus/es')['ElOption']
     ElPagination: typeof import('element-plus/es')['ElPagination']
     ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
     ElRow: typeof import('element-plus/es')['ElRow']
+    ElSelect: typeof import('element-plus/es')['ElSelect']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
     ElTable: typeof import('element-plus/es')['ElTable']
     ElTableColumn: typeof import('element-plus/es')['ElTableColumn']

+ 50 - 0
src/request/api.js

@@ -336,4 +336,54 @@ export const apisystemdzbcBannerUpdate = query => {
         method: 'PUT',
         data:query
     });
+};
+
+
+
+
+
+//查询定制班车-路线排班列表https://khy.xiaole.vip/api/system/dzbcPathScheduling/list
+
+export const  apisystemdzbcPathSchedulinglist = query => {
+    return service({
+        url: '/api/system/dzbcPathScheduling/list',
+        method: 'GET',
+		data:query
+    });
+};
+
+//导出定制班车-路线排班列表https://khy.xiaole.vip/api/system/dzbcPathScheduling/export
+export const  apisystemdzbcPathSchedulingexport = query => {
+    return service({
+        url: '/api/system/dzbcPathScheduling/export',
+        method: 'POST',
+		data:query,
+        responseType: 'blob'
+    });
+};
+
+//新增定制班车-路线排班https://khy.xiaole.vip/api/system/dzbcPathScheduling
+export const  apisystemdzbcPathSchedulingAdd = query => {
+    return service({
+        url: `/api/system/dzbcPathScheduling`,
+        method: 'POST',
+        data:query
+    });
+};
+
+//删除定制班车-路线排班https://khy.xiaole.vip/api/system/dzbcPathScheduling/{ids}
+export const  apisystemdzbcPathSchedulingDel = query => {
+    return service({
+        url: `/api/system/dzbcPathScheduling/${query.id}`,
+        method: 'DELETE'
+    });
+};
+
+//修改定制班车-路线排班https://khy.xiaole.vip/api/system/dzbcPathScheduling
+export const apisystemdzbcPathSchedulingUpdate = query => {
+    return service({
+        url: `/api/system/dzbcPathScheduling`,
+        method: 'PUT',
+        data:query
+    });
 };

+ 21 - 3
src/views/areaman/index.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { apisystemdzbcArealist,apisystemdzbcAreaexport,apisystemdzbcAreaDel,apisystemdzbcAreaAdd,apisystemdzbcAreaUpdate } from '../../request/api.js'
+import { apisystemdzbcKyzlist,apisystemdzbcArealist,apisystemdzbcAreaexport,apisystemdzbcAreaDel,apisystemdzbcAreaAdd,apisystemdzbcAreaUpdate } from '../../request/api.js'
 import type { ComponentSize, FormInstance, FormRules } from 'element-plus'
 import { ElMessage } from 'element-plus'
 interface RuleForm {
@@ -161,9 +161,14 @@ const deleteItem=(id)=>{
     console.log(err)
   })
 }
-
+let passengerstation=ref([])
 onMounted(()=>{
   getTableData()
+  apisystemdzbcKyzlist({}).then((res:any)=>{
+    passengerstation.value=res.rows
+  }).catch((err:any)=>{
+    console.log(err)
+  })
 })
 
 
@@ -287,7 +292,20 @@ onMounted(()=>{
             </el-col>
             <el-col :span="12">
               <el-form-item label="所属客运站">
-                <el-input placeholder="所属客运站" v-model="ruleForm.kyzId" />
+                <el-select
+                  v-model="ruleForm.kyzId"
+                  placeholder="所属客运站"
+                  size="large"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="item in passengerstation"
+                    :key="item.value"
+                    :label="item.name"
+                    :value="item.id"
+                  />
+                </el-select>
+               
               </el-form-item>
             </el-col>
             <el-col :span="12">

+ 3 - 3
src/views/bannerman/index.vue

@@ -178,9 +178,9 @@ onMounted(()=>{
           <div class="title">
             小程序宣传图管理
           </div>
-          <!-- <div class="sub-title">
-            管理系统中的所有车辆信息
-          </div> -->
+          <div class="sub-title">
+           
+          </div>
         </div>
         <div class="right-part">
           <el-button type="primary" :icon="Plus" @click="addItem({})">上传宣传图   </el-button>

+ 89 - 10
src/views/carplanman/index.vue

@@ -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>
 

+ 3 - 3
src/views/passengerstation/index.vue

@@ -185,9 +185,9 @@ onMounted(()=>{
           <div class="title">
             客运站管理
           </div>
-          <!-- <div class="sub-title">
-            管理系统中的所有车辆信息
-          </div> -->
+          <div class="sub-title">
+            
+          </div>
         </div>
         <div class="right-part">
           <el-button type="primary" :icon="Plus" @click="addItem({})">新增客运站  </el-button>

+ 36 - 3
src/views/routeman/index.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { apisystemdzbcPathlist,apisystemdzbcPathexport,apisystemdzbcPathDel,apisystemdzbcPathAdd,apisystemdzbcPathUpdate } from '../../request/api.js'
+import { apisystemdzbcArealist,apisystemdzbcPathlist,apisystemdzbcPathexport,apisystemdzbcPathDel,apisystemdzbcPathAdd,apisystemdzbcPathUpdate } from '../../request/api.js'
 import type { ComponentSize, FormInstance, FormRules } from 'element-plus'
 import { ElMessage } from 'element-plus'
 interface RuleForm {
@@ -167,8 +167,15 @@ const deleteItem=(id)=>{
   })
 }
 
+let areaList=ref([])
+
 onMounted(()=>{
   getTableData()
+  apisystemdzbcArealist({}).then((res:any)=>{
+    areaList.value=res.rows
+  }).catch((err:any)=>{
+    console.log(err)
+  })
 })
 
 
@@ -295,12 +302,38 @@ onMounted(()=>{
             </el-col>
             <el-col :span="12">
               <el-form-item label="出发区域">
-                <el-input v-model="ruleForm.startArea" />
+               
+                <el-select
+                  v-model="ruleForm.startArea"
+                  placeholder="出发区域"
+                  size="large"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="item in areaList"
+                    :key="item.value"
+                    :label="item.name"
+                    :value="item.id"
+                  />
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="12">
               <el-form-item label="结束区域">
-                <el-input v-model="ruleForm.endArea" />
+               
+                <el-select
+                  v-model="ruleForm.endArea"
+                  placeholder="结束区域"
+                  size="large"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="item in areaList"
+                    :key="item.value"
+                    :label="item.name"
+                    :value="item.id"
+                  />
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="12">

+ 22 - 3
src/views/stationman/index.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { apisystemdzbcSiteUpdate,apisystemdzbcSiteAdd,apisystemdzbcSiteDel,apisystemdzbcSiteexport,apisystemdzbcSitelist } from '../../request/api.js'
+import { apisystemdzbcArealist,apisystemdzbcSiteUpdate,apisystemdzbcSiteAdd,apisystemdzbcSiteDel,apisystemdzbcSiteexport,apisystemdzbcSitelist } from '../../request/api.js'
 import type { ComponentSize, FormInstance, FormRules } from 'element-plus'
 import { ElMessage } from 'element-plus'
 interface RuleForm {
@@ -162,9 +162,14 @@ const deleteItem=(id)=>{
     console.log(err)
   })
 }
-
+let areaList=ref([])
 onMounted(()=>{
   getTableData()
+  apisystemdzbcArealist({}).then((res:any)=>{
+    areaList.value=res.rows
+  }).catch((err:any)=>{
+    console.log(err)
+  })
 })
 
 
@@ -289,7 +294,21 @@ onMounted(()=>{
             </el-col>
             <el-col :span="12">
               <el-form-item label="区域">
-                <el-input placeholder="区域" v-model="ruleForm.areaId" />
+                <el-select
+                  v-model="ruleForm.areaId"
+                  placeholder="区域"
+                  size="large"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="item in areaList"
+                    :key="item.value"
+                    :label="item.name"
+                    :value="item.id"
+                  />
+                </el-select>
+               
+               
               </el-form-item>
             </el-col>
             <el-col :span="12">