2023-10-11 18:34:24 +08:00
|
|
|
<template>
|
|
|
|
<div class="app-container">
|
|
|
|
<el-card style="margin-bottom: 20px">
|
|
|
|
<div slot="header" class="clearfix">
|
|
|
|
<span>油价配置</span>
|
|
|
|
</div>
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-button type="primary" @click="dialogFormVisible = true,oilTypeMethods()">新增油号</el-button>
|
2023-10-11 18:34:24 +08:00
|
|
|
<div class="top-box">
|
|
|
|
<!-- 循环-->
|
2023-10-12 18:44:46 +08:00
|
|
|
<div class="oil-box" v-for="(item,index) in oilNumberList " :key="index" >
|
2023-10-13 18:14:19 +08:00
|
|
|
<div v-if="item.state == '启用'" class="top-icon">
|
|
|
|
<div>{{item.state}}</div>
|
2023-10-11 18:34:24 +08:00
|
|
|
</div>
|
2023-10-13 18:14:19 +08:00
|
|
|
<div v-if="item.state == '禁用'" class="top-icon2">
|
|
|
|
<div>{{item.state}}</div>
|
|
|
|
</div>
|
|
|
|
<div class="box-icon"><i class="el-icon-edit" style="color:#409EFF" @click="dialogFormNumberEdit = true,oilTypeMethods(),openOilNumberEdit(item)"></i></div>
|
|
|
|
<div class="box-title"> {{item.allOil}} </div>
|
2023-10-11 18:34:24 +08:00
|
|
|
<div class="between-box">
|
|
|
|
<div>油站价:</div>
|
2023-10-13 18:14:19 +08:00
|
|
|
<div><span class="jiacu">{{ item.oilPrice }}</span>元/{{item.unit}}</div>
|
2023-10-11 18:34:24 +08:00
|
|
|
</div>
|
|
|
|
<div class="between-box">
|
|
|
|
<div>国标价:</div>
|
2023-10-13 18:14:19 +08:00
|
|
|
<div> <span class="jiacu">{{ item.gbPrice }}</span>元/{{item.unit}}</div>
|
2023-10-11 18:34:24 +08:00
|
|
|
</div>
|
|
|
|
<div class="between-box">
|
|
|
|
<div>最后更新时间:</div>
|
2023-10-12 18:44:46 +08:00
|
|
|
<div> {{item.updateTime}} </div>
|
2023-10-11 18:34:24 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-card>
|
|
|
|
<el-card style="margin-bottom: 20px">
|
|
|
|
<div slot="header" class="clearfix">
|
|
|
|
<span>预设油价记录</span>
|
|
|
|
</div>
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-button type="success" @click = "dialogFormPricesAdd = true, addOilPresePrices()">新增预设油价</el-button>
|
2023-10-11 18:34:24 +08:00
|
|
|
<div class="table-box">
|
|
|
|
<el-table
|
2023-10-12 18:44:46 +08:00
|
|
|
:data="oilPresetPricesList"
|
2023-10-11 18:34:24 +08:00
|
|
|
style="width: auto">
|
|
|
|
<el-table-column
|
2023-10-12 18:44:46 +08:00
|
|
|
prop="presetId"
|
|
|
|
label="任务id"
|
|
|
|
width="100">
|
|
|
|
</el-table-column>
|
2023-10-13 18:14:19 +08:00
|
|
|
<!-- prop="presetGbPrice"-->
|
|
|
|
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-table-column
|
2023-10-13 18:14:19 +08:00
|
|
|
prop="oilNameT"
|
2023-10-12 18:44:46 +08:00
|
|
|
label="预设油号"
|
|
|
|
>
|
2023-10-11 18:34:24 +08:00
|
|
|
</el-table-column>
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-table-column label="当前数据" style="width: 100%">
|
2023-10-11 18:34:24 +08:00
|
|
|
<el-table-column
|
2023-10-12 18:44:46 +08:00
|
|
|
prop="currentPetrolPrices"
|
|
|
|
label="油站价"
|
|
|
|
>
|
2023-10-11 18:34:24 +08:00
|
|
|
</el-table-column>
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-table-column
|
|
|
|
prop="presetOilPrices"
|
|
|
|
label="国标价"
|
|
|
|
>
|
2023-10-11 18:34:24 +08:00
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-table-column label="预设新数据" style="width: 100%">
|
|
|
|
<el-table-column
|
|
|
|
prop="currentPetrolPrices"
|
|
|
|
label="油站价"
|
|
|
|
>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
|
|
prop="presetGbPrice"
|
|
|
|
label="国标价"
|
|
|
|
>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
|
|
prop="effectiveTime"
|
|
|
|
label="预设时间"
|
|
|
|
>
|
|
|
|
</el-table-column>
|
2023-10-13 18:14:19 +08:00
|
|
|
<!-- <el-table-column-->
|
|
|
|
<!-- prop="state"-->
|
|
|
|
<!-- label="处理状态"-->
|
|
|
|
<!-- >-->
|
|
|
|
|
|
|
|
<el-table-column label="状态">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
{{ getStatusText(scope.row.state) }}
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-table-column
|
|
|
|
prop="createTime"
|
|
|
|
label="创建时间"
|
|
|
|
>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
|
|
fixed="right"
|
|
|
|
label="操作"
|
|
|
|
width="120">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<el-button
|
2023-10-13 18:14:19 +08:00
|
|
|
@click.native.prevent="deleteRow(scope.$index, oilPresetPricesList)"
|
2023-10-12 18:44:46 +08:00
|
|
|
type="text"
|
|
|
|
size="small">
|
2023-10-13 18:14:19 +08:00
|
|
|
停止
|
2023-10-12 18:44:46 +08:00
|
|
|
</el-button>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
|
2023-10-11 18:34:24 +08:00
|
|
|
</el-table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-card>
|
2023-10-12 18:44:46 +08:00
|
|
|
|
2023-10-11 18:34:24 +08:00
|
|
|
<el-dialog title="添加" :visible.sync="dialogFormVisible">
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-form :model="oilNumber">
|
2023-10-11 18:34:24 +08:00
|
|
|
<el-form-item label="油品类型">
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-radio-group v-model="oilNumber.oilType" @change="oilTypeClick()">
|
|
|
|
<el-radio v-for="option in oilTypeList" :key="option.dictValue" :label="option.dictValue">
|
|
|
|
{{ option.dictLabel }}
|
|
|
|
</el-radio>
|
2023-10-11 18:34:24 +08:00
|
|
|
</el-radio-group>
|
|
|
|
</el-form-item>
|
2023-10-13 18:14:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-11 18:34:24 +08:00
|
|
|
<el-row :gutter="24">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="油品名称">
|
2023-10-13 18:14:19 +08:00
|
|
|
<el-select v-model="oilNumber.oilName" style="width: 217px" placeholder="请选择油品名称">
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-option
|
|
|
|
v-for="option in oilNameList"
|
2023-10-13 18:14:19 +08:00
|
|
|
:key="option.id"
|
|
|
|
:label="option.oilName"
|
|
|
|
:value="option.id"
|
2023-10-12 18:44:46 +08:00
|
|
|
></el-option>
|
2023-10-11 18:34:24 +08:00
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="计价单位">
|
2023-10-13 18:14:19 +08:00
|
|
|
<el-select v-model="oilNumber.unit" style="width: 217px"
|
|
|
|
placeholder="请选择活动区域">
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-option
|
|
|
|
v-for="option in receivingUnitList"
|
2023-10-13 18:14:19 +08:00
|
|
|
:key="option.value"
|
|
|
|
:label="option.label"
|
|
|
|
:value="option.label"
|
|
|
|
:disabled="option.dis"
|
2023-10-12 18:44:46 +08:00
|
|
|
></el-option>
|
2023-10-11 18:34:24 +08:00
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<!-- -->
|
|
|
|
<el-row :gutter="24">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="油品单价">
|
2023-10-13 18:14:19 +08:00
|
|
|
<el-input v-model="oilNumber.oilPrice" style="width: 217px"
|
|
|
|
></el-input>
|
2023-10-11 18:34:24 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="国际价格">
|
2023-10-13 18:14:19 +08:00
|
|
|
<el-input v-model="oilNumber.gbPrice" style="width: 217px"></el-input>
|
2023-10-11 18:34:24 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
2023-10-13 18:14:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-11 18:34:24 +08:00
|
|
|
<el-form-item label="收款单位">
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-radio-group v-model="oilNumber.receivingUnits">
|
2023-10-13 18:14:19 +08:00
|
|
|
<el-radio label="元" ></el-radio>
|
2023-10-11 18:34:24 +08:00
|
|
|
<el-radio label="计价单位"></el-radio>
|
|
|
|
</el-radio-group>
|
|
|
|
</el-form-item>
|
|
|
|
<div class="hui-seiz">点击油品输入的计算单位、可默认元或计价单位(L/m³/kg),页面也可自行切换</div>
|
|
|
|
<el-form-item label="状态">
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-radio-group v-model="oilNumber.state">
|
2023-10-13 18:14:19 +08:00
|
|
|
<el-radio label="启用" value="0"></el-radio>
|
|
|
|
<el-radio label="禁用" value="1"></el-radio>
|
2023-10-11 18:34:24 +08:00
|
|
|
</el-radio-group>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="排序">
|
2023-10-13 18:14:19 +08:00
|
|
|
<el-input-number v-model="oilNumber.sort" controls-position="right" @change="handleChange" :min="1" :max="10"></el-input-number>
|
2023-10-11 18:34:24 +08:00
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="备注">
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-input type="textarea" v-model="oilNumber.remark"></el-input>
|
2023-10-11 18:34:24 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-button type="primary" @click="dialogFormVisible = false,insertOilNumberin()">确 定</el-button>
|
2023-10-11 18:34:24 +08:00
|
|
|
</div>
|
|
|
|
</el-dialog>
|
2023-10-12 18:44:46 +08:00
|
|
|
|
|
|
|
<el-dialog title="修改" :visible.sync="dialogFormNumberEdit">
|
|
|
|
<el-form :model="oilNumber">
|
|
|
|
<el-form-item label="油品类型">
|
|
|
|
<el-radio-group v-model="oilNumber.oilType" @change="oilTypeClick()">
|
|
|
|
<el-radio v-for="option in oilTypeList" :key="option.dictValue" :label="option.dictValue">
|
|
|
|
{{ option.dictLabel }}
|
|
|
|
</el-radio>
|
|
|
|
</el-radio-group>
|
|
|
|
</el-form-item>
|
|
|
|
<el-row :gutter="24">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="油品名称">
|
2023-10-13 18:14:19 +08:00
|
|
|
<el-select v-model="oilNumber.oilName" style="width: 217px" placeholder="请选择油品名称">
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-option
|
|
|
|
v-for="option in oilNameList"
|
2023-10-13 18:14:19 +08:00
|
|
|
:key="option.id"
|
|
|
|
:label="option.oilName"
|
|
|
|
:value="option.id"
|
2023-10-12 18:44:46 +08:00
|
|
|
></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="计价单位">
|
2023-10-13 18:14:19 +08:00
|
|
|
<el-select v-model="oilNumber.unit" style="width: 217px" placeholder="请选择活动区域">
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-option
|
|
|
|
v-for="option in receivingUnitList"
|
2023-10-13 18:14:19 +08:00
|
|
|
:key="option.value"
|
|
|
|
:label="option.label"
|
|
|
|
:value="option.label"
|
|
|
|
:disabled="option.dis"
|
2023-10-12 18:44:46 +08:00
|
|
|
></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<!-- -->
|
|
|
|
<el-row :gutter="24">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="油品单价">
|
2023-10-13 18:14:19 +08:00
|
|
|
<el-input v-model="oilNumber.oilPrice" style="width: 217px"></el-input>
|
2023-10-12 18:44:46 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="国际价格">
|
2023-10-13 18:14:19 +08:00
|
|
|
<el-input v-model="oilNumber.gbPrice" style="width: 217px"></el-input>
|
2023-10-12 18:44:46 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-form-item label="收款单位">
|
|
|
|
<el-radio-group v-model="oilNumber.receivingUnits">
|
|
|
|
<el-radio label="元"></el-radio>
|
|
|
|
<el-radio label="计价单位"></el-radio>
|
|
|
|
</el-radio-group>
|
|
|
|
</el-form-item>
|
|
|
|
<div class="hui-seiz">点击油品输入的计算单位、可默认元或计价单位(L/m³/kg),页面也可自行切换</div>
|
|
|
|
<el-form-item label="状态">
|
|
|
|
<el-radio-group v-model="oilNumber.state">
|
|
|
|
<el-radio label="启用"></el-radio>
|
|
|
|
<el-radio label="禁用"></el-radio>
|
|
|
|
</el-radio-group>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="排序">
|
2023-10-13 18:14:19 +08:00
|
|
|
<el-input-number v-model="oilNumber.sort" controls-position="right" @change="handleChange" :min="1" :max="10"></el-input-number>
|
2023-10-12 18:44:46 +08:00
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="备注">
|
|
|
|
<el-input type="textarea" v-model="oilNumber.remark"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<el-button @click="dialogFormNumberEdit = false">取 消</el-button>
|
2023-10-13 18:14:19 +08:00
|
|
|
<el-button type="primary" @click="dialogFormNumberEdit = false,updateOilNumberin()">确 定</el-button>
|
2023-10-12 18:44:46 +08:00
|
|
|
</div>
|
|
|
|
</el-dialog>
|
|
|
|
|
2023-10-13 18:14:19 +08:00
|
|
|
<el-dialog title="添加预设" :visible.sync="dialogFormPricesAdd" width="450px">
|
2023-10-12 18:44:46 +08:00
|
|
|
<el-form :model="oilPresetPrices" label-width="100px">
|
|
|
|
<el-form-item label="预设油号">
|
|
|
|
<el-select v-model="oilPresetPrices.oilType" placeholder="请选择油号" @change="oilTypeClickByPrice()">
|
|
|
|
<el-option
|
|
|
|
v-for="option in selectOilTypeByPrice"
|
|
|
|
:key="option.numberId"
|
2023-10-13 18:14:19 +08:00
|
|
|
:label="option.oilType +' '+option.oilName"
|
|
|
|
:value="option.numberId"
|
2023-10-12 18:44:46 +08:00
|
|
|
|
|
|
|
></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="当前油站价">
|
|
|
|
<el-input v-model="oilPresetPrices.currentGbPrice" style="width: 217px" readonly></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="预设油站价">
|
|
|
|
<el-input v-model="oilPresetPrices.presetOilPrices" style="width: 217px"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="当前国标价">
|
2023-10-13 18:14:19 +08:00
|
|
|
<el-input v-model="oilPresetPrices.currentPetrolPrices" style="width: 217px" readonly></el-input>
|
2023-10-12 18:44:46 +08:00
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="预设国标价">
|
|
|
|
<el-input v-model="oilPresetPrices.presetGbPrice" style="width: 217px"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="活动时间">
|
|
|
|
<el-date-picker
|
2023-10-13 18:14:19 +08:00
|
|
|
v-model="oilPresetPrices.effectiveTime"
|
2023-10-12 18:44:46 +08:00
|
|
|
type="datetime"
|
|
|
|
placeholder="选择日期时间"
|
2023-10-13 18:14:19 +08:00
|
|
|
style="width: 217px">
|
2023-10-12 18:44:46 +08:00
|
|
|
</el-date-picker>
|
|
|
|
</el-form-item>
|
2023-10-13 18:14:19 +08:00
|
|
|
<div class="hui-seiz">如生效时间与当前时间间隔小于1分钟,当前油价将立即生效</div>
|
2023-10-12 18:44:46 +08:00
|
|
|
</el-form>
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<el-button @click="dialogFormPricesAdd = false">取 消</el-button>
|
2023-10-13 18:14:19 +08:00
|
|
|
<el-button type="primary" @click="dialogFormPricesAdd = false,insertOilPresePrices()">确 定</el-button>
|
2023-10-12 18:44:46 +08:00
|
|
|
</div>
|
|
|
|
</el-dialog>
|
|
|
|
|
2023-10-11 18:34:24 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2023-10-12 18:44:46 +08:00
|
|
|
|
2023-10-11 18:34:24 +08:00
|
|
|
<script>
|
2023-10-12 18:44:46 +08:00
|
|
|
|
2023-10-13 18:14:19 +08:00
|
|
|
import {
|
|
|
|
getOilNumberList,
|
|
|
|
dictSelect,
|
|
|
|
insertOilNumber,
|
|
|
|
updateOilNumber,
|
|
|
|
getOilPresetList,
|
|
|
|
getOilNameApi,
|
|
|
|
getAllOilListApi,
|
|
|
|
getOilNameListApi, insertOilPresePricesApi
|
|
|
|
|
|
|
|
} from "@/api/oilPrice";
|
2023-10-12 18:44:46 +08:00
|
|
|
|
2023-10-11 18:34:24 +08:00
|
|
|
export default {
|
|
|
|
name: 'index',
|
|
|
|
data() {
|
|
|
|
return {
|
2023-10-12 18:44:46 +08:00
|
|
|
oilNumberList: [],
|
2023-10-13 18:14:19 +08:00
|
|
|
oilNumberList2: [],
|
2023-10-12 18:44:46 +08:00
|
|
|
|
2023-10-11 18:34:24 +08:00
|
|
|
num: 1,
|
2023-10-12 18:44:46 +08:00
|
|
|
dialogFormVisible: false, // 新增油价配置
|
|
|
|
dialogFormNumberEdit: false, // 修改油价配置
|
|
|
|
|
|
|
|
dialogFormPricesAdd: false, // 新增油价趋势
|
|
|
|
|
|
|
|
oilTypeList: [], // 油品类型
|
|
|
|
oilNameList: [], // 油品名称
|
|
|
|
receivingUnitList: [], // 计价单位
|
|
|
|
|
2023-10-13 18:14:19 +08:00
|
|
|
receivingUnitCN: [],
|
|
|
|
receivingUnitEN: [],
|
2023-10-12 18:44:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
oilNumber:{
|
|
|
|
oilType: '',
|
|
|
|
oilName: '',
|
|
|
|
oilPrice: '',
|
|
|
|
gbPrice: '',
|
|
|
|
receivingUnits: '',
|
|
|
|
createTime: '',
|
|
|
|
updateTime: '',
|
|
|
|
state: '',
|
|
|
|
sort: '',
|
|
|
|
remark: '',
|
|
|
|
ifDelete: '',
|
2023-10-13 18:14:19 +08:00
|
|
|
allOil:'',
|
|
|
|
oilTypeT: '',
|
|
|
|
oilNameT: '',
|
|
|
|
unit:'', // 计价单位
|
2023-10-12 18:44:46 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
oilPresetPricesList:[],
|
2023-10-13 18:14:19 +08:00
|
|
|
AllOilList:[],
|
2023-10-12 18:44:46 +08:00
|
|
|
|
|
|
|
selectOilTypeByPrice: [],
|
|
|
|
oilPresetPrices: {
|
|
|
|
oilType:'',
|
|
|
|
currentPetrolPrices:'',
|
|
|
|
presetOilPrices:'',
|
|
|
|
currentGbPrice:'',
|
|
|
|
presetGbPrice:'',
|
|
|
|
createTime:'',
|
2023-10-13 18:14:19 +08:00
|
|
|
updateTime:'',
|
2023-10-12 18:44:46 +08:00
|
|
|
effectiveTime:'',
|
|
|
|
ifDelete:'',
|
|
|
|
},
|
|
|
|
|
2023-10-11 18:34:24 +08:00
|
|
|
form: {
|
|
|
|
name: '',
|
|
|
|
region: '',
|
|
|
|
date1: '',
|
|
|
|
date2: '',
|
|
|
|
delivery: false,
|
|
|
|
type: [],
|
|
|
|
resource: '',
|
|
|
|
desc: ''
|
|
|
|
},
|
|
|
|
formLabelWidth: '100px'
|
|
|
|
}
|
|
|
|
},
|
2023-10-13 18:14:19 +08:00
|
|
|
async created() {
|
|
|
|
try {
|
|
|
|
await this.getList();
|
|
|
|
await this.getAllOilList();
|
|
|
|
await this.getOilPresetListin();
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error);
|
|
|
|
}
|
2023-10-11 18:34:24 +08:00
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
},
|
|
|
|
methods:{
|
2023-10-13 18:14:19 +08:00
|
|
|
getStatusText(data) {
|
|
|
|
if (data == 1) {
|
|
|
|
return "停止"
|
|
|
|
} else {
|
|
|
|
return "启用"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2023-10-11 18:34:24 +08:00
|
|
|
handleChange(value) {
|
|
|
|
console.log(value);
|
2023-10-12 18:44:46 +08:00
|
|
|
},
|
2023-10-13 18:14:19 +08:00
|
|
|
// 获取数据
|
2023-10-12 18:44:46 +08:00
|
|
|
getList() {
|
2023-10-13 18:14:19 +08:00
|
|
|
return new Promise(async (resolve, reject) => {
|
|
|
|
try {
|
|
|
|
const response = await getOilNumberList();
|
|
|
|
this.oilNumberList2 = response.data.records;
|
|
|
|
await this.getAllOilList();
|
|
|
|
resolve();
|
|
|
|
} catch (error) {
|
|
|
|
reject(error);
|
|
|
|
}
|
2023-10-12 18:44:46 +08:00
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2023-10-13 18:14:19 +08:00
|
|
|
async getAllOilList() {
|
|
|
|
try {
|
|
|
|
const response = await getAllOilListApi();
|
|
|
|
const oilList = response.data;
|
|
|
|
this.AllOilList = oilList
|
|
|
|
this.oilNumberList = this.oilNumberList2
|
|
|
|
this.oilNumberList.forEach(oilNumber => {
|
|
|
|
oilList.forEach(oil => {
|
|
|
|
if (parseInt(oilNumber.oilName) === oil.id) {
|
|
|
|
oilNumber.allOil = oil.oilType + " " + oil.oilName;
|
|
|
|
oilNumber.oilTypeT = oil.oilType;
|
|
|
|
oilNumber.oilNameT = oil.oilName;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
// Handle error here if needed
|
|
|
|
}
|
|
|
|
},
|
2023-10-12 18:44:46 +08:00
|
|
|
|
2023-10-13 18:14:19 +08:00
|
|
|
// 编辑时使用
|
|
|
|
async oilTypeMethods() {
|
|
|
|
try {
|
|
|
|
await Promise.all([
|
|
|
|
this.getOilTypeList("oil_type"),
|
|
|
|
this.getOilTypeList("pricingUnitCN"),
|
|
|
|
this.getOilTypeList("pricingUnitEN"),
|
|
|
|
]);
|
|
|
|
this.receivingUnitList = [];
|
|
|
|
var cla1 = {
|
|
|
|
label : "英文简称",
|
|
|
|
value : -1,
|
|
|
|
dis : true
|
|
|
|
}
|
|
|
|
this.receivingUnitList.push(cla1);
|
|
|
|
|
|
|
|
// 遍历 this.receivingUnitCN 对象的属性并添加到 receivingUnitList
|
|
|
|
for (const argumentsKey in this.receivingUnitCN) {
|
|
|
|
const value = this.receivingUnitCN[argumentsKey];
|
|
|
|
var cla = {
|
|
|
|
label : value.dictLabel,
|
|
|
|
value : value.dictValue,
|
|
|
|
dis : false
|
|
|
|
}
|
|
|
|
this.receivingUnitList.push(cla);
|
|
|
|
}
|
|
|
|
var cla2 = {
|
|
|
|
label : "中文简称",
|
|
|
|
value : -2,
|
|
|
|
dis : true
|
|
|
|
}
|
|
|
|
cla2 = {
|
|
|
|
label : "中文简称",
|
|
|
|
value : -3,
|
|
|
|
dis : true
|
|
|
|
}
|
|
|
|
this.receivingUnitList.push(cla2);
|
|
|
|
|
|
|
|
for (const argumentsKey in this.receivingUnitEN) {
|
|
|
|
const value = this.receivingUnitEN[argumentsKey];
|
|
|
|
var cla = {
|
|
|
|
label : value.dictLabel,
|
|
|
|
value : value.dictValue,
|
|
|
|
dis : false
|
|
|
|
}
|
|
|
|
this.receivingUnitList.push(cla);
|
|
|
|
}
|
2023-10-12 18:44:46 +08:00
|
|
|
|
2023-10-13 18:14:19 +08:00
|
|
|
console.log("this.receivingUnitList",this.receivingUnitList)
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error);
|
|
|
|
}
|
2023-10-12 18:44:46 +08:00
|
|
|
},
|
2023-10-13 18:14:19 +08:00
|
|
|
// 选择油品类型之后触发
|
2023-10-12 18:44:46 +08:00
|
|
|
oilTypeClick() {
|
|
|
|
const selectedValue = this.oilNumber.oilType;
|
2023-10-13 18:14:19 +08:00
|
|
|
// this.getOilTypeList(selectedValue)
|
|
|
|
this.getOilName(selectedValue)
|
2023-10-12 18:44:46 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
// 打开修改窗口
|
|
|
|
openOilNumberEdit(item) {
|
|
|
|
this.oilNumber = item
|
|
|
|
},
|
|
|
|
|
|
|
|
// 添加
|
2023-10-13 18:14:19 +08:00
|
|
|
async insertOilNumberin(){
|
2023-10-12 18:44:46 +08:00
|
|
|
insertOilNumber(this.oilNumber).then( response => {
|
|
|
|
var list = response.data
|
|
|
|
console.log("updateOilNumber",list)
|
|
|
|
});
|
2023-10-13 18:14:19 +08:00
|
|
|
await this.getList();
|
2023-10-12 18:44:46 +08:00
|
|
|
},
|
2023-10-13 18:14:19 +08:00
|
|
|
|
2023-10-12 18:44:46 +08:00
|
|
|
// 修改
|
2023-10-13 18:14:19 +08:00
|
|
|
async updateOilNumberin(){
|
2023-10-12 18:44:46 +08:00
|
|
|
updateOilNumber(data).then( response => {
|
|
|
|
var list = response.data
|
|
|
|
|
|
|
|
console.log("updateOilNumber",list)
|
|
|
|
});
|
2023-10-13 18:14:19 +08:00
|
|
|
await this.getList();
|
2023-10-12 18:44:46 +08:00
|
|
|
},
|
|
|
|
|
2023-10-13 18:14:19 +08:00
|
|
|
// 查询数组字典类型
|
|
|
|
async getOilTypeList(data) {
|
2023-10-12 18:44:46 +08:00
|
|
|
var this_ = this
|
2023-10-13 18:14:19 +08:00
|
|
|
await dictSelect(data).then( response => {
|
2023-10-12 18:44:46 +08:00
|
|
|
var list = response.data
|
|
|
|
if (data == "oil_type") {
|
|
|
|
this_.oilTypeList = list;
|
2023-10-13 18:14:19 +08:00
|
|
|
}else if (data == "pricingUnitCN"){ //获取几家单位
|
|
|
|
this_.receivingUnitCN = list;
|
|
|
|
}else if (data == "pricingUnitEN"){ //获取几家单位
|
|
|
|
this_.receivingUnitEN = list;
|
2023-10-12 18:44:46 +08:00
|
|
|
}else {
|
|
|
|
this_.oilNameList = list;
|
|
|
|
}
|
|
|
|
console.log("this_.oilTypeList",this_.oilTypeList)
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2023-10-13 18:14:19 +08:00
|
|
|
// 根据数据字典查询油类名称
|
|
|
|
getOilName(data) {
|
|
|
|
var OilNumber = {
|
|
|
|
oilType: data
|
|
|
|
}
|
|
|
|
var this_ = this
|
|
|
|
getOilNameApi(OilNumber).then( response => {
|
|
|
|
var list = response.data
|
|
|
|
this_.oilNameList = list;
|
|
|
|
});
|
|
|
|
},
|
2023-10-12 18:44:46 +08:00
|
|
|
|
2023-10-13 18:14:19 +08:00
|
|
|
/**
|
|
|
|
* 油价预设
|
|
|
|
*/
|
|
|
|
// 查询预设油号
|
2023-10-12 18:44:46 +08:00
|
|
|
getOilPresetListin() {
|
2023-10-13 18:14:19 +08:00
|
|
|
|
2023-10-12 18:44:46 +08:00
|
|
|
var this_=this
|
|
|
|
getOilPresetList().then( response => {
|
2023-10-13 18:14:19 +08:00
|
|
|
this.oilPresetPricesList = response.data.records
|
|
|
|
|
|
|
|
this.oilPresetPricesList.forEach(oilNumber => {
|
|
|
|
this.AllOilList.forEach(oil => {
|
|
|
|
if (parseInt(oilNumber.oilType) === oil.id) {
|
|
|
|
oilNumber.oilNameT = oil.oilName;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
console.log("111111111111111111111111111111",this.oilPresetPricesList)
|
|
|
|
console.log("111111111111111111111111111111",)
|
|
|
|
console.log("111111111111111111111111111111")
|
|
|
|
});
|
|
|
|
},
|
|
|
|
// 油价预设查询列表
|
|
|
|
getOilNameList() {
|
|
|
|
var this_=this
|
|
|
|
getOilNameListApi().then( response => {
|
|
|
|
var list = response.data
|
|
|
|
this_.selectOilTypeByPrice = list
|
2023-10-12 18:44:46 +08:00
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 新增油价预设
|
|
|
|
addOilPresePrices() {
|
2023-10-13 18:14:19 +08:00
|
|
|
// this.selectOilTypeByPrice = this.oilNumberList;
|
|
|
|
// 油价预设查询列表
|
|
|
|
this.getOilNameList();
|
|
|
|
},
|
|
|
|
|
|
|
|
// 添加youjia1 yusheeeeeeeeeeeeeeeeeee
|
|
|
|
insertOilPresePrices(){
|
|
|
|
insertOilPresePricesApi(this.oilPresetPrices).then( response => {
|
|
|
|
var list = response.data
|
|
|
|
console.log("updateOilNumber",list)
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
// 更改状态
|
|
|
|
deleteRow(data1, data2) {
|
|
|
|
console.log("data1",data1);
|
|
|
|
console.log("data2",data2);
|
|
|
|
|
|
|
|
|
2023-10-12 18:44:46 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
// 新增油价预设
|
|
|
|
oilTypeClickByPrice() {
|
2023-10-13 18:14:19 +08:00
|
|
|
var count = this.oilPresetPrices.oilType;
|
|
|
|
|
|
|
|
this.selectOilTypeByPrice.forEach((oil) => {
|
|
|
|
if (oil.numberId == parseInt(count)) {
|
|
|
|
this.oilPresetPrices.currentPetrolPrices = oil.oilPrice;
|
|
|
|
this.oilPresetPrices.currentGbPrice = oil.gbPrice;
|
|
|
|
}
|
|
|
|
});
|
2023-10-11 18:34:24 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.app-container{
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
background: #f6f8f9;
|
|
|
|
}
|
|
|
|
.top-box{
|
|
|
|
width: 100%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
}
|
|
|
|
.clearfix:before,
|
|
|
|
.clearfix:after {
|
|
|
|
display: table;
|
|
|
|
content: "";
|
|
|
|
}
|
|
|
|
.clearfix:after {
|
|
|
|
clear: both
|
|
|
|
}
|
|
|
|
.oil-box{
|
|
|
|
width: 24%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 15px;
|
|
|
|
background: #f9f9f9;
|
|
|
|
border-radius: 8px;
|
|
|
|
margin-right: 15px;
|
|
|
|
margin-top: 10px;
|
|
|
|
font-size: 14px;
|
|
|
|
position: relative;
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
}
|
|
|
|
.between-box{
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
margin: 10px auto;
|
|
|
|
}
|
|
|
|
.box-icon{
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: flex-end;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
.box-title{
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
font-size: 18px;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
.jiacu{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
.top-icon{
|
|
|
|
position: absolute;
|
|
|
|
top: 0px;
|
|
|
|
left: 0px;
|
|
|
|
background-color: #e1ecfc;
|
|
|
|
padding: 3px 7px;
|
|
|
|
color: #409eff;
|
|
|
|
font-size: 13px;
|
|
|
|
border-bottom-right-radius: 6px;
|
|
|
|
}
|
2023-10-13 18:14:19 +08:00
|
|
|
|
|
|
|
.top-icon2{
|
|
|
|
position: absolute;
|
|
|
|
top: 0px;
|
|
|
|
left: 0px;
|
|
|
|
background-color: #3f3f3f;
|
|
|
|
padding: 3px 7px;
|
|
|
|
color: #d9d9d9;
|
|
|
|
font-size: 13px;
|
|
|
|
border-bottom-right-radius: 6px;
|
|
|
|
}
|
2023-10-11 18:34:24 +08:00
|
|
|
.table-box{
|
|
|
|
width: 100%;
|
|
|
|
margin: 20px auto;
|
|
|
|
}
|
|
|
|
.hui-seiz{
|
|
|
|
margin-left:60px;
|
|
|
|
}
|
|
|
|
</style>
|