Просмотр исходного кода

feat(广西ai自助):完成前端配置

Zhenghanjv 1 год назад
Родитель
Сommit
961d36d69a

+ 1 - 0
ai-fueling/src/main/java/com/tokheim/aifueling/AiFuelingApplication.java

@@ -3,6 +3,7 @@ package com.tokheim.aifueling;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 
+
 @SpringBootApplication
 public class AiFuelingApplication {
 

+ 0 - 1
ai-fueling/src/main/java/com/tokheim/aifueling/controller/MachineController.java

@@ -12,7 +12,6 @@ import java.util.List;
 @RestController
 
 @RequestMapping("/machine")
-//@CrossOrigin
 public class MachineController {
     @Autowired
     private MachineServices machineService;

+ 33 - 0
ai-fueling/src/main/java/com/tokheim/aifueling/controller/NozzleController.java

@@ -0,0 +1,33 @@
+package com.tokheim.aifueling.controller;
+
+import com.tokheim.aifueling.domain.Nozzle;
+import com.tokheim.aifueling.service.nozzle.NozzleServices;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.repository.query.Param;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/nozzle")
+public class NozzleController {
+
+    @Autowired
+    private NozzleServices nozzleServices;
+
+    @GetMapping("/findAllNozzle/{machineId}")
+    public List<Nozzle> findAllNozzle(@PathVariable Long machineId) {
+        List<Nozzle> allNozzle = nozzleServices.findAllNozzle(machineId);
+        return allNozzle;
+    }
+
+    @PostMapping("/uploadNozzle")
+    public Nozzle uploadNozzle(@RequestBody Nozzle nozzle) {
+        return nozzleServices.uploadNozzle(nozzle);
+    }
+
+    @PostMapping("/deleteNozzle/{nozzleId}")
+    public void deleteNozzle(@PathVariable Long nozzleId) {
+        nozzleServices.deleteNozzle(nozzleId);
+    }
+}

+ 13 - 4
ai-fueling/src/main/java/com/tokheim/aifueling/domain/Machine.java

@@ -2,6 +2,7 @@ package com.tokheim.aifueling.domain;
 
 import lombok.Data;
 import org.hibernate.annotations.Comment;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import javax.persistence.*;
 import java.util.Date;
@@ -15,19 +16,27 @@ public class Machine {
     @Comment("id")
     private Long id;
 
-    @Column
+    @Column(name = "name")
     @Comment("加油机名称")
     private String name;
 
-    @Column
+    @Column(name = "ip")
     @Comment("加油机ip")
     private String ip;
 
-    @Column
+    @Column(name = "aiId")
+    @Comment("ai id")
+    private String aiId;
+
+    @Column(name = "geLinId")
+    @Comment("格林id")
+    private String geLinId;
+
+    @Column(name = "created")
     @Comment("创建时间")
     private Date createTime;
 
-    @Column
+    @Column(name = "updated")
     @Comment("更新时间")
     private Date updateTime;
 }

+ 40 - 0
ai-fueling/src/main/java/com/tokheim/aifueling/domain/Nozzle.java

@@ -0,0 +1,40 @@
+package com.tokheim.aifueling.domain;
+
+import io.swagger.models.auth.In;
+import lombok.Data;
+import org.hibernate.annotations.Comment;
+
+import javax.persistence.*;
+
+@Entity(name = "nozzle")
+@Data
+public class Nozzle {
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long nozzleId;
+
+    @Column(name = "machineId")
+    @Comment("油机id")
+    private Long machineId;
+
+    @Column(name = "logicalId")
+    @Comment("加油点")
+    private Integer logicalId;
+
+    @Column(name = "internalId")
+    @Comment("内部枪号")
+    private Integer internalId;
+
+    @Column(name = "physicalId")
+    @Comment("物理枪号")
+    private Integer physicalId;
+
+    @Column(name = "oilName")
+    @Comment("油品名")
+    private String oilName;
+
+    @Column(name = "oilCode")
+    @Comment("油品码")
+    private String oilCode;
+
+}

+ 3 - 1
ai-fueling/src/main/java/com/tokheim/aifueling/repository/MachineRepository.java

@@ -2,8 +2,10 @@ package com.tokheim.aifueling.repository;
 
 import com.tokheim.aifueling.domain.Machine;
 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+
+import java.util.List;
 
-//@Component
 public interface MachineRepository extends JpaRepository<Machine, Long> {
 
 }

+ 16 - 0
ai-fueling/src/main/java/com/tokheim/aifueling/repository/NozzleRepository.java

@@ -0,0 +1,16 @@
+package com.tokheim.aifueling.repository;
+
+import com.tokheim.aifueling.domain.Nozzle;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+
+import java.util.List;
+
+public interface NozzleRepository extends JpaRepository<Nozzle, Long> {
+
+//    @Query(value = "select n from nozzle n where n.machineId = :machineId")
+//    List<Nozzle> findAllByMachineId(@Param("machineId") Long machineId);
+
+    List<Nozzle> findAllByMachineId(Long machineId);
+}

+ 1 - 1
ai-fueling/src/main/java/com/tokheim/aifueling/service/machine/MachineServices.java

@@ -25,7 +25,7 @@ public interface MachineServices {
      * 添加/更新油机
      * @param machine 添加/更新的内容
      */
-    void uploadMachine(Machine machine);
+    Machine uploadMachine(Machine machine);
 
     /**
      * 删除油机

+ 10 - 8
ai-fueling/src/main/java/com/tokheim/aifueling/service/machine/MachineServicesImpl.java

@@ -7,7 +7,6 @@ import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageRequest;
 import org.springframework.stereotype.Service;
 
-import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 
@@ -28,20 +27,21 @@ public class MachineServicesImpl implements MachineServices {
     }
 
     @Override
-    public void uploadMachine(Machine machine) {
+    public Machine uploadMachine(Machine machine) {
         if (machine.getId() == null) {
-            saveMachine(machine);
-            return;
+            return saveMachine(machine);
         }
 
         Machine currentMachine = machineRepository.findById(machine.getId()).orElse(null);
         if (currentMachine != null) {
             currentMachine.setName(machine.getName());
             currentMachine.setIp(machine.getIp());
+            currentMachine.setAiId(machine.getAiId());
+            currentMachine.setGeLinId(machine.getGeLinId());
             currentMachine.setUpdateTime(new Date());
-            machineRepository.save(currentMachine);
+            return machineRepository.save(currentMachine);
         } else {
-            saveMachine(machine);
+            return saveMachine(machine);
         }
 
     }
@@ -52,12 +52,14 @@ public class MachineServicesImpl implements MachineServices {
     }
 
     //添加油机
-    private void saveMachine(Machine machine) {
+    private Machine saveMachine(Machine machine) {
         Machine newMachine = new Machine();
         newMachine.setName(machine.getName());
         newMachine.setIp(machine.getIp());
+        newMachine.setAiId(machine.getAiId());
+        newMachine.setGeLinId(machine.getGeLinId());
         newMachine.setCreateTime(new Date());
         newMachine.setUpdateTime(new Date());
-        machineRepository.save(newMachine);
+        return machineRepository.save(newMachine);
     }
 }

+ 28 - 0
ai-fueling/src/main/java/com/tokheim/aifueling/service/nozzle/NozzleServices.java

@@ -0,0 +1,28 @@
+package com.tokheim.aifueling.service.nozzle;
+
+import com.tokheim.aifueling.domain.Nozzle;
+
+import java.util.List;
+
+public interface NozzleServices {
+
+    /**
+     * 查找油机下所属油枪信息
+     * @param machineId 油机 ip
+     * @return 油枪信息
+     */
+    List<Nozzle> findAllNozzle(Long machineId);
+
+    /**
+     * 添加/更新 油枪信息
+     * @param nozzle 油枪信息
+     * @return 更新的油枪信息
+     */
+    Nozzle uploadNozzle(Nozzle nozzle);
+
+    /**
+     * 删除油枪
+     * @param nozzleId 要删除的油枪对应 id
+     */
+    void deleteNozzle(Long nozzleId);
+}

+ 41 - 0
ai-fueling/src/main/java/com/tokheim/aifueling/service/nozzle/NozzleServicesImpl.java

@@ -0,0 +1,41 @@
+package com.tokheim.aifueling.service.nozzle;
+
+import com.tokheim.aifueling.domain.Nozzle;
+import com.tokheim.aifueling.repository.NozzleRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Collections;
+import java.util.List;
+
+@Service
+public class NozzleServicesImpl implements NozzleServices {
+    @Autowired
+    private NozzleRepository nozzleRepository;
+
+    @Override
+    public List<Nozzle> findAllNozzle(Long machineId) {
+        return nozzleRepository.findAllByMachineId(machineId);
+    }
+
+    @Override
+    public Nozzle uploadNozzle(Nozzle nozzle) {
+        if (nozzle.getNozzleId() == null) return nozzleRepository.save(nozzle);
+
+        Nozzle currentNozzle = nozzleRepository.findById(nozzle.getNozzleId()).orElse(null);
+        if (currentNozzle == null) return nozzleRepository.save(nozzle);
+
+        currentNozzle.setLogicalId(nozzle.getLogicalId());
+        currentNozzle.setInternalId(nozzle.getInternalId());
+        currentNozzle.setPhysicalId(nozzle.getPhysicalId());
+        currentNozzle.setOilName(nozzle.getOilName());
+        currentNozzle.setOilCode(nozzle.getOilCode());
+
+        return nozzleRepository.save(currentNozzle);
+    }
+
+    @Override
+    public void deleteNozzle(Long nozzleId) {
+        nozzleRepository.deleteById(nozzleId);
+    }
+}

+ 6 - 0
ai-fueling/src/main/resources/application-dev.yml

@@ -23,11 +23,17 @@ nettyInfo:
 
 # springboot 相关配置
 spring:
+  # 日期格式化
+  jackson:
+    date-format: yyyy-MM-dd HH:mm:ss
+    time-zone: Asia/Shanghai
+  # 数据库配置
   datasource:
     url: jdbc:mariadb://localhost:3306/ai-fueling?characterEncoding=utf-8
     username: root
     password: 123456
     driver-class-name: org.mariadb.jdbc.Driver
+  # jpa 配置
   jpa:
     hibernate:
       ddl-auto: update

+ 15 - 0
ai-fueling/src/main/web/src/api/index.js

@@ -46,6 +46,21 @@ export async function deleteMachine(id) {
   return await request.post(aiFueling(`machine/deleteMachine/${id}`))
 }
 
+//查找某油机下所属油枪
+export async function findAllNozzle(machineId) {
+  return await request.get(aiFueling(`nozzle/findAllNozzle/${machineId}`))
+}
+
+//添加/更新油机
+export async function uploadNozzle(params) {
+  return await request.post(aiFueling(`nozzle/uploadNozzle`),params)
+}
+
+//删除油枪
+export async function deleteNozzle(nozzleId) {
+  return await request.post(aiFueling(`nozzle/deleteNozzle/${nozzleId}`))
+}
+
 // //调用第三方接口
 // const otherBaseServer = api => `/tms-base${api}`;
 

+ 6 - 7
ai-fueling/src/main/web/src/components/common/Sidebar.vue

@@ -7,7 +7,6 @@
 </template>
 
 <script>
-import { queryMenus,findAllMenus,findAllMenu,formatMenus } from '@/api'
 import SidebarItem from './SidebarItem'
 
     export default {
@@ -22,13 +21,13 @@ import SidebarItem from './SidebarItem'
                     icon: "station",
                     menuItems:[],
                     action:"/station/machine"
-                  },
-                  {
-                    title: "后台配置",
-                    icon: "backstage",
-                    menuItems:[],
-                    action:"/station/data"
                   }
+                  // {
+                  //   title: "后台配置",
+                  //   icon: "backstage",
+                  //   menuItems:[],
+                  //   action:"/station/data"
+                  // }
                 ]
             }
         },

+ 18 - 4
ai-fueling/src/main/web/src/pages/station/Machine.vue

@@ -15,6 +15,8 @@
       <el-table :data="machineList" border stripe :highlight-current-row="false" style="width: 100%;">
         <el-table-column prop="name" label="名称"  min-width="100" align="center"/>
         <el-table-column prop="ip" label="ip地址"  min-width="100" align="center"/>
+        <el-table-column prop="aiId" label="ai ID"  min-width="100" align="center"/>
+        <el-table-column prop="geLinId" label="格林 ID"  min-width="100" align="center"/>
         <el-table-column prop="createTime" label="创建时间"  min-width="100" align="center"/>
         <el-table-column prop="updateTime" label="更新时间"  min-width="100" align="center"/>
 
@@ -33,8 +35,14 @@
         <el-form-item label="名称" prop="machineName">
           <el-input class="solid-input" v-model="machine.name"/>
         </el-form-item>
-        <el-form-item label="ip地址" prop="machineIp">
-          <el-input class="solid-input" v-model="machine.ip" :disabled="dicChildFormType === 'edit'"/>
+        <el-form-item label="ip地址" prop="ip">
+          <el-input class="solid-input" v-model="machine.ip"/>
+        </el-form-item>
+        <el-form-item label="ai ID" prop="aiId">
+          <el-input class="solid-input" v-model="machine.aiId"/>
+        </el-form-item>
+        <el-form-item label="格林 ID" prop="geLinId">
+          <el-input class="solid-input" v-model="machine.geLinId"/>
         </el-form-item>
       </el-form>
 
@@ -57,6 +65,8 @@
               id: null,
               name: "",
               ip: "",
+              aiId:"",
+              geLinId:"",
               createTime: "",
               updateTime: ""
             },
@@ -65,7 +75,9 @@
             dicChildFormType: 'add',
             dicChildFormVisible: false,
             machineForm: {
-                ip: [{ required: true, message: '请输入油机ip地址' }]
+                ip: [{ required: true, message: '请输入油机ip地址' }],
+                aiId: [{ required: true, message: '请输入ai id' }],
+                geLinId: [{ required: true, message: '请输入格林设备id' }],
             }
         }
     },
@@ -80,6 +92,8 @@
               id: null,
               name: "",
               ip: "",
+              aiId:"",
+              geLinId:"",
               createTime: "",
               updateTime: ""
             }
@@ -140,7 +154,7 @@
                 }}).catch(e => e)
         },
         configDicItemData (machine) {
-            this.$router.push(`/station/nozzle/${machine.machineName}?stationId=${this.stationId}&machineIp=${machine.machineIp}`)
+            this.$router.push(`/station/nozzle/${machine.id}/${machine.name}/${machine.ip}/${machine.aiId}/${machine.geLinId}`)
         }
     },
     mounted () {

+ 58 - 185
ai-fueling/src/main/web/src/pages/station/Nozzle.vue

@@ -2,16 +2,28 @@
   <div class="main-management-dictionary-config">
     <!-- panel -->
     <el-card>
-      <h2 slot="header" class="font-20">支付参数配置</h2>
+      <h2 slot="header" class="font-20">油枪配置</h2>
       <div>
-        <label class="inline-block m-t-10 one-line m-r-20">
+        <div>
+          <label class="inline-block m-t-10 one-line m-r-20">
           <span class="m-r-10">油机名称:</span>
-          <el-input style="width: 240px;" :value="machineName" disabled/>
+          <el-input style="width: 240px;" :value="machine.machineName" disabled/>
         </label>
         <label class="inline-block m-t-10 one-line m-r-20">
           <span class="m-r-10">油机ip:</span>
-          <el-input style="width: 180px;" :value="machineIp" disabled/>
+          <el-input style="width: 180px;" :value="machine.machineIp" disabled/>
+        </label>
+        </div>
+        <div>
+          <label class="inline-block m-t-10 one-line m-r-20">
+          <span class="m-r-10">AI ID:</span>
+          <el-input style="width: 240px;" :value="machine.machineAiId" disabled/>
         </label>
+        <label class="inline-block m-t-10 one-line m-r-20">
+          <span class="m-r-10">格林 ID:</span>
+          <el-input style="width: 180px;" :value="machine.machineGeLinId" disabled/>
+        </label>
+        </div>
         <div class="m-t-10 inline-block one-line">
           <el-button type="primary" @click="showAddForm">新增</el-button>
           <el-button @click="() => this.$router.go(-1)">返回</el-button>
@@ -21,46 +33,11 @@
     <!-- table -->
     <el-card class="m-t-10">
       <el-table :data="nozzleList" border stripe :highlight-current-row="false" style="width: 100%;">
-<!--        <el-table-column prop="index"  label="序号"  min-width="50" align="center"/>-->
-        <el-table-column prop="physicalId" label="物理枪号"  min-width="100" align="center"/>
-        <el-table-column prop="internalId" label="内部枪号"  min-width="100" align="center"/>
         <el-table-column prop="logicalId" label="加油点"  min-width="100" align="center"/>
+        <el-table-column prop="internalId" label="内部枪号"  min-width="100" align="center"/>
+        <el-table-column prop="physicalId" label="物理枪号"  min-width="100" align="center"/>
         <el-table-column prop="oilName"  label="油品名称"  min-width="100" align="center"/>
-        <el-table-column prop="oilGrade" label="油品等级"  min-width="100" align="center"/>
-        <el-table-column prop="payType" label="加油卡类型"  min-width="100" align="center">
-          <template slot-scope="scope">
-            <!--<span v-if="scope.row.payType === '0'" >验泵卡</span>
-            <span v-if="scope.row.payType === '1'" >员工卡</span>
-            <span v-if="scope.row.payType === '2'" >维修卡</span>
-            <span v-if="scope.row.payType === '3'" >用户卡</span>-->
-
-            <span v-for="item of payTypeList" v-if="scope.row.payType === item.id">
-              {{item.name}}
-            </span>
-
-          </template>
-        </el-table-column>
-        <el-table-column prop="payShop" label="支付类型"  min-width="100" align="center">
-          <template slot-scope="scope">
-            <!--<span v-if="scope.row.payShop === '1'" >公众号支付</span>
-            <span v-if="scope.row.payShop === '2'" >微信支付</span>
-            <span v-if="scope.row.payShop === '3'" >支付宝支付</span>
-            <span v-if="scope.row.payShop === '4'" >银联支付</span>
-            <span v-if="scope.row.payShop === '5'" >现金支付</span>
-            <span v-if="scope.row.payShop === '6'" >加油卡支付</span>-->
-            <span v-for="item of payShopList" v-if="scope.row.payShop === item.id">
-              {{item.name}}
-            </span>
-          </template>
-        </el-table-column>
-        <el-table-column prop="appIp" label="多媒体屏Ip"  min-width="100" align="center"/>
-        <el-table-column prop="appPort" label="多媒体屏Port"  min-width="100" align="center"/>
-        <el-table-column prop="status" label="是否上传ITouch"  min-width="110" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.status === '1'" class="c-green" >是</span>
-            <span v-else class="c-red">否</span>
-          </template>
-        </el-table-column>
+        <el-table-column prop="oilCode" label="油品码"  min-width="100" align="center"/>
 
         <el-table-column label="操作" min-width="160" align="center">
           <template slot-scope="scope">
@@ -73,55 +50,20 @@
     <!-- 字典项条目表单 -->
     <el-dialog :title="dicChildFormType === 'add' ? '新增' : '编辑'" :visible.sync="dicChildFormVisible" width="640px" :close-on-click-modal="false">
       <el-form :model="nozzle" :rules="nozzleFormRules" ref="nozzleForm" label-width="100px">
-       <!-- <el-form-item label="油枪编号" prop="nozzleId">
-          <el-input class="solid-input" v-model="nozzle.nozzleId"/>
-        </el-form-item>-->
-        <el-form-item label="物理枪号" prop="physicalId">
-          <el-input class="solid-input" v-model="nozzle.physicalId"/>
+        <el-form-item label="加油点" prop="logicalId">
+          <el-input class="solid-input" v-model="nozzle.logicalId"/>
         </el-form-item>
         <el-form-item label="内部枪号" prop="internalId">
           <el-input class="solid-input" v-model="nozzle.internalId"/>
         </el-form-item>
-        <el-form-item label="加油点" prop="logicalId">
-          <el-input class="solid-input" v-model="nozzle.logicalId"/>
+        <el-form-item label="物理枪号" prop="physicalId">
+          <el-input class="solid-input" v-model="nozzle.physicalId"/>
         </el-form-item>
         <el-form-item label="油品名称" prop="oilName">
           <el-input class="solid-input" v-model="nozzle.oilName"/>
         </el-form-item>
-        <el-form-item label="油品等级" prop="oilGrade">
-          <el-input class="solid-input" v-model="nozzle.oilGrade"/>
-        </el-form-item>
-        <el-form-item label="加油卡类型" prop="payType">
-          <el-select class="solid-input" v-model="nozzle.payType">
-            <!--<el-option label="验泵卡" value="0" />
-            <el-option label="员工卡" value="1" />
-            <el-option label="维修卡" value="2" />
-            <el-option label="用户卡" value="3" />-->
-            <el-option v-for="item of payTypeList" :key="item.id" :label="item.name" :value="item.id"/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="支付方式" prop="payShop">
-          <el-select class="solid-input" v-model="nozzle.payShop">
-            <!--<el-option label="公众号支付" value="1" />
-            <el-option label="微信支付" value="2" />
-            <el-option label="支付宝支付" value="3" />
-            <el-option label="银联支付" value="4" />
-            <el-option label="现金支付" value="5" />
-            <el-option label="加油卡支付" value="6" />-->
-            <el-option v-for="item of payShopList" :key="item.id" :label="item.name" :value="item.id"/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="多媒体屏Ip" prop="appIp">
-          <el-input class="solid-input" v-model="nozzle.appIp"/>
-        </el-form-item>
-        <el-form-item label="端口" prop="appPort">
-          <el-input class="solid-input" v-model="nozzle.appPort"/>
-        </el-form-item>
-        <el-form-item label="是否上传" prop="status">
-          <el-select class="solid-input" v-model="nozzle.status">
-            <el-option label="是" value="1" />
-            <el-option label="否" value="0" />
-          </el-select>
+        <el-form-item label="油品码" prop="oilCode">
+          <el-input class="solid-input" v-model="nozzle.oilCode"/>
         </el-form-item>
       </el-form>
 
@@ -134,126 +76,72 @@
 </template>
 
 <script>
-    import {findAllNozzle,saveNozzle,updateNozzle,deleteNozzle,getAllDictionaryChild} from '@/api'
+    import {findAllNozzle,uploadNozzle,deleteNozzle} from '@/api'
 
     export default {
         name: "Nozzle",
         data () {
             return {
                 nozzle: {
-                    "nid": "",
+                    "nozzleId": "",
                     "physicalId": "",
                     "internalId": "",
                     "logicalId": "",
                     "oilName": "",
-                    "oilGrade": "",
-                    "payType": "",
-                    "payShop": "",
-                    "appIp": "",
-                    "appPort": "",
-                    "status": "",
-                    "machineIp": "",
-                    "stationId": "",
-                    "created": "",
-                    "updated": ""
+                    "oilCode": "",
+                    "machineId": ""
                 },
                 nozzleList: [],
-                ids: [],
 
-                machineName: '', // 所属字典项编码
-                machineIp: '', // 油机编号
-                stationId: '', // 油站编号
-                dictChildList: [], // 字典项的所有值条目
+                machine: {
+                  machineId: '',
+                  machineName: '',
+                  machineIp: '',
+                  machineAiId: '',
+                  machineGeLinId: ''
+                },
+                
+
                 dicChildFormType: 'add',
                 dicChildFormVisible: false,
-                dicChildForm: {
-                    dictChidCode: '',
-                    text: '',
-                    state: '1',
-                    isDefault: '1',
-                    order: '',
-                    memo: ''
-                },
+
                 nozzleFormRules: {
-                   // nozzleId: [{ required: true, message: '请输入油枪号' }],
                     physicalId: [{ required: true, message: '请输入物理枪号' }],
                     internalId: [{ required: true, message: '请输入内部枪号' }],
-                    logicalId: [{ required: true, message: '请输入加油点' }],
-                    oilName: [{ required: true, message: '请输入油品名称' }],
-                    oilGrade: [{ required: true, message: '请输入油品等级' }],
-                    payType: [{ required: true, message: '请输入加油卡类型' }],
-                    payShop: [{ required: true, message: '请输入支付类型' }],
-                    appIp: [{ required: true, message: '请输入多媒体屏Ip' }],
-                    appPort: [{ required: true, message: '请输入多媒体屏端口' }],
-                    status: [{ required: true, message: '请选择是否上传' }]
-                },
-                payTypeList:[],
-                payShopList:[],
+                    logicalId: [{ required: true, message: '请输入加油点' }]
+                }
             }
         },
         methods: {
             async findAllNozzle () {
-                // this.dicItem.dic_code = this.dictCode;
-
-                const result = await findAllNozzle(this.stationId,this.machineIp);
-                console.log(JSON.stringify(result));
-                if (result.status == 200) {
-                    this.nozzleList=  result.obj.map((item,index) =>{
-                        return{
-                            ///index:index + 1,
-                            nid:item.nid,
-                            nozzleId:item.nozzleId,
-                            physicalId:item.physicalId,
-                            internalId:item.internalId,
-                            logicalId:item.logicalId,
-                            oilGrade:item.oilGrade,
-                            oilName:item.oilName,
-                            payType:String(item.payType),
-                            payShop:String(item.payShop),
-                            appIp:item.appIp,
-                            appPort:item.appPort,
-                            status:String(item.status),
-                            machineIp:item.machineIp,
-                            created:item.created,
-                            updated:item.updated
-                        }
-                    })
-                }
+                const result = await findAllNozzle(this.machine.machineId);
+                this.nozzleList = result
             },
             emptyNozzle() {
                 this.nozzle = {
-                    "nid": "",
                     "nozzleId": "",
                     "physicalId": "",
-                    "internalId":"",
+                    "internalId": "",
                     "logicalId": "",
-                    "payType": "",
-                    "payShop": "",
-                    "appIp": "",
-                    "appPort": "",
-                    "status": "",
-                    "machineIp": "",
-                    "stationId": "",
-                    "created": "",
-                    "updated": ""
+                    "oilName": "",
+                    "oilCode": "",
+                    "machineId": this.machine.machineId
                 }
             },
             checkSubmit () {
                 this.$refs.nozzleForm && this.$refs.nozzleForm.validate(async ok => {
                     if (ok) {
-                        this.nozzle.machineIp = this.machineIp;
-                        this.nozzle.stationId = this.stationId;
                         if (this.dicChildFormType === 'add') {
-                            const result = await saveNozzle(this.nozzle);
-                            if (result.status == 200) {
+                            const result = await uploadNozzle(this.nozzle);
+                            if (result) {
                                 this.dicChildFormVisible = false;
                                 this.$message.success('添加成功');
                                 this.emptyNozzle();
                                 this.findAllNozzle()
                             } else this.$message.error('添加失败')
                         } else {
-                            const result = await updateNozzle(this.nozzle);
-                            if (result.status == 200) {
+                            const result = await uploadNozzle(this.nozzle);
+                            if (result) {
                                 this.dicChildFormVisible = false;
                                 this.$message.success('修改成功');
                                 this.emptyNozzle();
@@ -295,32 +183,17 @@
                         });
                         this.findAllNozzle()
                     }}).catch(e => e)
-            },
-           async getPayTypeList(){
-                const param = await getAllDictionaryChild("PAY_TYPE_TYPE");
-                param['obj'].map(item =>{
-                    this.nozzle.payType = item.item_name;
-                    this.payTypeList.push({id:item.item_code,name:item.item_name})
-                });
-
-
-            },
-            async getPayShopList(){
-                const param = await getAllDictionaryChild("PAY_SHOP_TYPE");
-                param['obj'].map(item =>{
-                    this.nozzle.payShop = item.item_name;
-                    this.payShopList.push({id:item.item_code,name:item.item_name})
-                });
-            },
+            }
 
         },
         mounted () {
-            this.machineName = this.$route.params.machineName;
-            this.machineIp = this.$route.query.machineIp;
-            this.stationId = this.$route.query.stationId;
+            this.machine.machineId = this.$route.params.machineId
+            this.machine.machineName = this.$route.params.machineName;
+            this.machine.machineIp = this.$route.params.machineIp;
+            this.machine.machineAiId = this.$route.params.machineAiId;
+            this.machine.machineGeLinId = this.$route.params.machineGeLinId;
+            console.log(this.machine)
             this.findAllNozzle();
-            this.getPayTypeList();
-            this.getPayShopList();
         }
     }
 </script>

+ 2 - 2
ai-fueling/src/main/web/src/router/index.js

@@ -22,7 +22,7 @@ import MainWrapper from "../components/common/MainWrapper";
 // import NotAuthorized from "../pages/other/NotAuthorized";
 // import Station from "../pages/station/Station";
 import Machine from "../pages/station/Machine";
-// import Nozzle from "../pages/station/Nozzle";
+import Nozzle from "../pages/station/Nozzle";
 // import Data from "../pages/station/Data";
 
 Vue.use(Router);
@@ -38,7 +38,7 @@ const router = new Router({
       children: [
         {path: '/station/machine',name: 'machine',component: Machine},
         // {path: '/station/data',name: 'data',component: Data},
-        // {path: '/station/nozzle/:machineName',name: 'nozzle',component: Nozzle}
+        {path: '/station/nozzle/:machineId/:machineName/:machineIp/:machineAiId/:machineGeLinId',name: 'nozzle',component: Nozzle}
         // {path: '404', name: '404', component: Page404},
 
       ]