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