油站管理相关
This commit is contained in:
parent
9c09b83fc0
commit
d075c6bcfd
473
fuintAdmin/src/views/oilConfig/oilGun/list1.vue
Normal file
473
fuintAdmin/src/views/oilConfig/oilGun/list1.vue
Normal file
@ -0,0 +1,473 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="bor-bai" v-for="(item,index) in gunList" :key="index">
|
||||
<div class="box-top">
|
||||
<div class="title_">{{item.oilType}} {{item.oilName}}</div>
|
||||
<div>
|
||||
<el-button
|
||||
type="primary"
|
||||
style="background: linear-gradient( 229deg, #FF8646 0%, #FFA360 100%);"
|
||||
icon="el-icon-plus"
|
||||
@click="gunAdd(item.numberId)"
|
||||
v-hasPermi="['oilConfig:oilGun:list:add']"
|
||||
|
||||
>新增油枪</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="conten-bottom">
|
||||
<div class="cardbox" :class="{ 'act-cardbox': item.status == '启用' ,'boxborder': item.status == '启用' }" v-for="(item,index) in item.oilGunList" :key="index">
|
||||
<div class="cardbox-top" :class="{ 'actcolor':item.status == '启用' }">
|
||||
<div>{{item.tankName}}</div>
|
||||
<div style="cursor: pointer" ><i class="el-icon-edit-outline"
|
||||
v-hasPermi="['oilConfig:oilGun:list:update']"
|
||||
@click="gunEdit(item)"></i>
|
||||
<i class="el-icon-delete"
|
||||
v-hasPermi="['oilConfig:oilGun:list:del']"
|
||||
@click="delGun(item.id)"></i></div>
|
||||
</div>
|
||||
|
||||
<img v-if="item.status == '启用'" class="cardbox-rd" src="./imgs/r-img.png" alt="">
|
||||
|
||||
<div class="cardbox-title">
|
||||
<div class="cardbox-gunName">{{item.gunName}}</div>
|
||||
</div>
|
||||
<div class="cardbox-bottom" :class="{ 'actcolor':item.status == '启用' }">
|
||||
<!-- <div>ID:{{ item.id }}</div>-->
|
||||
</div>
|
||||
<template v-if="item.status == '启用'">
|
||||
<div class="cardboxb" v-if="item.oilMachineGunNumber != null ">
|
||||
<div >{{item.oilMachineGunNumber}}</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
:before-close="handleClose"
|
||||
:close-on-click-modal="false">
|
||||
<el-form :model="gunForm" :rules="rules" ref="gunForm" label-width="100px" class="demo-ruleForm">
|
||||
<el-form-item label="油枪名称" prop="gunName">
|
||||
|
||||
<el-input placeholder="请输入内容" v-model="gunForm.gunName" class="input-with-select">
|
||||
<el-select v-model="gunForm.select" slot="append" placeholder="选择油枪" @change="chooseName">
|
||||
<el-option
|
||||
v-for="option in 50"
|
||||
:key="option"
|
||||
:label="option + '号枪'"
|
||||
:value="option + '号枪'"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="油机编号" prop="name">
|
||||
<el-input v-model="gunForm.oilMachineGunNumber"></el-input>
|
||||
<div style="font-size: 12px;color: #999999">油机连接模式下 绑定油机系统中的枪号信息与当前枪号绑定</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属油罐" prop="tankId">
|
||||
<el-select v-model="gunForm.tankId" placeholder="请选择所属油罐">
|
||||
<el-option
|
||||
v-for="option in tankList"
|
||||
:key="option.id"
|
||||
:label="option.tankName"
|
||||
:value="option.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="gunForm.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
@change="handleIsopenSelect"
|
||||
/>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<!--/* <el-button v-if="judgement" type="danger" @click="delGun()" style="float: left;">删除</el-button>*/-->
|
||||
<el-button @click="dialogVisible = false,getList()">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm()">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getGunApi, insertGunApi, updateGunApi,selectTankByNumberApi,delGunApi} from "@/api/oilConfig/oilGuns";
|
||||
import {cleanTankApi} from "@/api/oilConfig/oilTank";
|
||||
|
||||
export default {
|
||||
name: 'oilqiang',
|
||||
dicts: ['zhzt'],
|
||||
|
||||
data(){
|
||||
return{
|
||||
title:"",
|
||||
dialogVisible: false,
|
||||
list:[
|
||||
{type:1,xb:'you'},
|
||||
{type:1,xb:'meiyou'},
|
||||
{type:1,xb:'you'},
|
||||
{type:1,xb:'you'},
|
||||
{type:2,xb:'you'},
|
||||
{type:1,xb:'you'},
|
||||
{type:1,xb:'you'},
|
||||
{type:1,xb:'you'},
|
||||
],
|
||||
// 判断当前窗口是新增还是修改该
|
||||
judgement:false,
|
||||
tankList: [],
|
||||
gunList: [],
|
||||
c:'',
|
||||
gunForm: {
|
||||
id: '',
|
||||
gunName: '',
|
||||
tankId: '',
|
||||
status: '',
|
||||
storeId: '',
|
||||
createTime: '',
|
||||
updateTime: '',
|
||||
createBy: '',
|
||||
updateBy: '',
|
||||
numberId: '',
|
||||
oilMachineGunNumber: '',
|
||||
select: ''
|
||||
},
|
||||
statusOut:'',
|
||||
ruleForm: {
|
||||
name: '',
|
||||
region: '',
|
||||
date1: '',
|
||||
date2: '',
|
||||
delivery: false,
|
||||
type: [],
|
||||
select:'请选择',
|
||||
resource: '',
|
||||
desc: ''
|
||||
},
|
||||
rules: {
|
||||
gunName: [
|
||||
{ required: true, message: '请输入油枪名称', trigger: 'blur' },
|
||||
],
|
||||
|
||||
tankId: [
|
||||
{ required: true, message: '请选择所属油罐', trigger: 'change' }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
async created() {
|
||||
let this_ = this
|
||||
await this_.getList()
|
||||
},
|
||||
watch: {
|
||||
dialogVisible: function (newValue, oldValue) {
|
||||
if (oldValue) {
|
||||
this.$refs["gunForm"].resetFields();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
handleIsopenSelect() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
getList() {
|
||||
this.gunList = []
|
||||
getGunApi().then(response => {
|
||||
this.gunList = response.data;
|
||||
})
|
||||
},
|
||||
// 添加油枪
|
||||
gunAdd(numberId){
|
||||
// this.$refs["gunForm"].validate
|
||||
// 假设 formRules 是你的验证规则对象
|
||||
// this.$refs.gunForm.clearValidate(); // 清空验证状态
|
||||
// this.$set(this, 'formRules', {}); // 设置为空对象
|
||||
|
||||
let this_ = this;
|
||||
this_.dialogVisible = true;
|
||||
this_.judgement = false;
|
||||
this_.gunForm = {} // 清空数据
|
||||
this_.gunForm.status = '启用'
|
||||
this_.title = '添加油枪'
|
||||
this_.selectTankByNumber(numberId)
|
||||
},
|
||||
gunEdit(data) {
|
||||
let this_ = this;
|
||||
this_.dialogVisible = true;
|
||||
this_.judgement = true;
|
||||
this_.gunForm = data;
|
||||
this_.statusOut = data.status;
|
||||
this_.title = '修改油枪'
|
||||
|
||||
this_.selectTankByNumber(data.numberId)
|
||||
},
|
||||
delGun(id) {
|
||||
this.$confirm('此操作将删除油枪信息,请谨慎操作!是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let fil = {
|
||||
id: id
|
||||
}
|
||||
delGunApi(fil).then(response => {
|
||||
this.dialogVisible = false;
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消'
|
||||
});
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["gunForm"].validate((valid) => {
|
||||
if (valid) {
|
||||
// 查询numberId
|
||||
for (let tankListKey in this.tankList) {
|
||||
if (parseInt(this.gunForm.tankId) === parseInt(this.tankList[tankListKey].id)) {
|
||||
this.gunForm.numberId = parseInt(this.tankList[tankListKey].numberId);
|
||||
}
|
||||
}
|
||||
if (!this.gunForm.id) {
|
||||
insertGunApi(this.gunForm).then(response => {
|
||||
console.log("response",response)
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.dialogVisible = false;
|
||||
this.getList();
|
||||
|
||||
}else {
|
||||
|
||||
}
|
||||
}).catch(reason => {
|
||||
});
|
||||
} else {
|
||||
updateGunApi(this.gunForm).then(response => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.dialogVisible = false;
|
||||
this.getList();
|
||||
this.dialogVisible = false
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
// this.getList();
|
||||
},
|
||||
chooseName() {
|
||||
var this_ = this
|
||||
this_.gunForm.gunName = this_.gunForm.select
|
||||
},
|
||||
handleClose(){
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
|
||||
// 查询油罐信息
|
||||
selectTankByNumber(data) {
|
||||
let numberId = data
|
||||
selectTankByNumberApi(numberId).then(response => {
|
||||
this.tankList = response.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.app-container{
|
||||
height: 100%;
|
||||
}
|
||||
.bor-bai{
|
||||
width: 100%;
|
||||
border-radius: 10px ;
|
||||
box-sizing: border-box;
|
||||
padding: 20px;
|
||||
background: #fff;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
|
||||
margin-bottom: 20px;
|
||||
|
||||
|
||||
}
|
||||
.title_{
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
color: #333333;
|
||||
}
|
||||
.wrap-box{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.oil-box{
|
||||
|
||||
}
|
||||
|
||||
.clearfix:before,
|
||||
.clearfix:after {
|
||||
display: table;
|
||||
content: "";
|
||||
}
|
||||
.clearfix:after {
|
||||
clear: both
|
||||
}
|
||||
|
||||
.box-card {
|
||||
width: 100%;
|
||||
}
|
||||
.conten-box{
|
||||
width: 100%;
|
||||
border: 1px solid #ebeef5;
|
||||
margin: 20px 0px;
|
||||
}
|
||||
.conten-top{
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
box-sizing: border-box;
|
||||
padding: 18px 20px;
|
||||
}
|
||||
.conten-bottom{
|
||||
box-sizing: border-box;
|
||||
padding: 20px 20px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.cardbox{
|
||||
height: 87px;
|
||||
width: 278px;
|
||||
margin-right: 35px;
|
||||
margin-bottom: 35px;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
//width: 19%;
|
||||
|
||||
background-size:40% 70%;
|
||||
background-color: #f9f9f9;
|
||||
position: relative;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.boxborder {
|
||||
border-color: #FF9655;
|
||||
border:1px solid;
|
||||
}
|
||||
.cardbox-rd{
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
bottom: 0px;
|
||||
width:50px;
|
||||
height: 50px;
|
||||
|
||||
}
|
||||
.act-cardbox{
|
||||
margin-right: 35px;
|
||||
height: 87px;
|
||||
width: 278px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
//margin-right: 10px;
|
||||
margin-bottom: 35px;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
//width: 19%;
|
||||
//background: url(../../../assets/images/jybjj.png) center no-repeat;
|
||||
background-size:40% 70%;
|
||||
background-color: #fff9f5;
|
||||
color: #FF9655 !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.cardboxb{
|
||||
position: absolute;
|
||||
/*width: 50px;*/
|
||||
width: auto;
|
||||
height: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: white;
|
||||
font-size: 12px;
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
padding: 5px 10px;
|
||||
background: linear-gradient( 312deg, #FF8646 0%, #FFA360 100%);
|
||||
border-radius: 0px 10px 0px 10px;
|
||||
}
|
||||
|
||||
.actcolor{
|
||||
color: #FF9655 !important;
|
||||
}
|
||||
.cardbox-top{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
color: #5b5e62;
|
||||
font-size: 12px;
|
||||
|
||||
font-family: Source Han Sans CN;
|
||||
//font-weight: 400;
|
||||
}
|
||||
.cardbox-title{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
font-size: 28px;
|
||||
//margin: 15px 0px;
|
||||
|
||||
|
||||
}
|
||||
.cardbox-gunName{
|
||||
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
|
||||
font-weight: 400;
|
||||
font-size: 28px;
|
||||
//color: #FF9655;
|
||||
//line-height: 0px;
|
||||
//text-align: center;
|
||||
//font-style: normal;
|
||||
//text-transform: none;
|
||||
}
|
||||
.cardbox-bottom{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
width: 100%;
|
||||
color: #5b5e62;
|
||||
font-size: 14px;
|
||||
}
|
||||
.input-box{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.box-top{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
933
fuintAdmin/src/views/oilConfig/oilPrice/index1.vue
Normal file
933
fuintAdmin/src/views/oilConfig/oilPrice/index1.vue
Normal file
@ -0,0 +1,933 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>油价配置</span>
|
||||
</div>
|
||||
<el-button type="primary" @click="oilTypeMethods(1)"
|
||||
v-hasPermi="['oilConfig:oilPrice:index:addoil']"
|
||||
>新增油号</el-button>
|
||||
<div class="top-box">
|
||||
<!-- 循环-->
|
||||
<div class="oil-box" :style=" 'background:'+ colorList[index] " v-for="(item,index) in oilNumberList " :key="index" >
|
||||
<div v-if="item.state == '启用'" class="top-icon">
|
||||
<div>{{item.state}}</div>
|
||||
</div>
|
||||
<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>
|
||||
<div class="between-box">
|
||||
<div>油站价:</div>
|
||||
<div><span class="jiacu">{{ item.oilPrice }}</span>元/{{item.unit}}</div>
|
||||
</div>
|
||||
<div class="between-box">
|
||||
<div>国标价:</div>
|
||||
<div> <span class="jiacu">{{ item.gbPrice }}</span>元/{{item.unit}}</div>
|
||||
</div>
|
||||
<div class="between-box">
|
||||
<div>最后更新时间:</div>
|
||||
<div> {{item.updateTime}} </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>预设油价记录</span>
|
||||
</div>
|
||||
<el-button type="success" @click = "dialogFormPricesAdd = true, addOilPresePrices()" v-hasPermi="['oilConfig:oilPrice:index:addp']"
|
||||
>新增预设油价</el-button>
|
||||
<div class="table-box">
|
||||
<el-table
|
||||
:data="oilPresetPricesList"
|
||||
style="width: auto">
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
align="center"
|
||||
width="100">
|
||||
</el-table-column>
|
||||
<!-- prop="presetGbPrice"-->
|
||||
|
||||
<el-table-column
|
||||
prop="oilNameT"
|
||||
align="center"
|
||||
label="预设油号"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前数据" style="width: 100%" align="center"
|
||||
>
|
||||
<el-table-column
|
||||
prop="currentPetrolPrices"
|
||||
align="center"
|
||||
label="油站价"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="currentGbPrice"
|
||||
align="center"
|
||||
label="国标价"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="预设新数据" style="width: 100%" align="center"
|
||||
>
|
||||
<el-table-column
|
||||
prop="presetOilPrices"
|
||||
align="center"
|
||||
label="油站价"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="presetGbPrice"
|
||||
align="center"
|
||||
label="国标价"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="effectiveTime"
|
||||
align="center"
|
||||
label="预设时间"
|
||||
>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="state"-->
|
||||
<!-- label="处理状态"-->
|
||||
<!-- >-->
|
||||
|
||||
<el-table-column label="状态" align="center">
|
||||
<template slot-scope="scope">
|
||||
<!-- <dict-tag :options="dict.type.jobState" :value="scope.row.state"/>-->
|
||||
<el-tag v-if="scope.row.state == 'occur'" type="success">已生效</el-tag>
|
||||
<el-tag v-else-if="scope.row.state == 'wait'">等待中</el-tag>
|
||||
<el-tag v-else type="info">已失效</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
align="center"
|
||||
label="创建时间"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
align="center"
|
||||
label="操作"
|
||||
width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.state == 'wait'"
|
||||
@click.native.prevent="deleteRow(scope.$index, scope.row)"
|
||||
type="text"
|
||||
size="small">
|
||||
停止
|
||||
</el-button>
|
||||
<span v-else> -- </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-dialog title="添加" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
|
||||
<el-form ref="oilNumberF" :model="oilNumber" :rules="rules">
|
||||
<el-form-item label="油品类型" prop="oilType" label-width="130px">
|
||||
<el-radio-group v-model="oilNumber.oilType" @change="oilTypeClick(oilNumber),oilTypeClick2()">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.oil_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- <el-radio v-for="option in oilTypeList" :key="option.dictValue" :label="option.dictValue">-->
|
||||
<!-- {{ option.dictLabel }}-->
|
||||
<!-- </el-radio>-->
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="油品名称" prop="oilName" label-width="130px">
|
||||
<el-select v-model="oilNumber.oilName" style="width: 217px" placeholder="请选择油品名称" @change="getSecondName()">
|
||||
<el-option
|
||||
v-for="option in oilNameList"
|
||||
:key="option.id"
|
||||
:label="option.oilName"
|
||||
:value="option.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计价单位" prop="unit" label-width="130px">
|
||||
<el-select v-model="oilNumber.unit" style="width: 217px"
|
||||
placeholder="请选择计价单位">
|
||||
<el-option
|
||||
v-for="option in receivingUnitList"
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.label"
|
||||
:disabled="option.dis"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="当前油品售出价" prop="oilPrice" label-width="130px">
|
||||
<el-input v-model="oilNumber.oilPrice" pattern="^\d+(\.\d+)?$" style="width: 217px">
|
||||
<template slot="append">元{{oilNumber.unit?"/"+oilNumber.unit:''}}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="当前国标价格" prop="gbPrice" label-width="130px">
|
||||
<el-input v-model="oilNumber.gbPrice" pattern="^\d+(\.\d+)?$" style="width: 217px">
|
||||
<template slot="append">元{{oilNumber.unit?"/"+oilNumber.unit:''}}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-form-item label="收款单位" prop="receivingUnits">-->
|
||||
<!-- <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="状态" prop="state" label-width="130px">
|
||||
<el-radio-group v-model="oilNumber.state">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" label-width="130px">
|
||||
<el-input-number v-model="oilNumber.sort" controls-position="right" @change="handleChange" :min="1" :max="10"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" label-width="130px">
|
||||
<el-input type="textarea" v-model="oilNumber.remark"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="insertOilNumberin()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="修改" :visible.sync="dialogFormNumberEdit" :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="oilNumber" :rules="rules">
|
||||
<el-form-item label="油品类型" prop="oilType">
|
||||
<el-radio-group v-model="oilNumber.oilType" @change="oilTypeClick(oilNumber.oilType),oilTypeClick2()">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.oil_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="油品名称" prop="oilName">
|
||||
<el-select v-model="oilNumber.oilNameT" style="width: 217px" placeholder="请选择油品名称" @change="changeOilName">
|
||||
<el-option
|
||||
v-for="option in oilNameList"
|
||||
:key="option.id"
|
||||
:label="option.oilName"
|
||||
:value="option.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计价单位" prop="unit">
|
||||
<el-select v-model="oilNumber.unit" style="width: 217px" placeholder="请选择活动区域">
|
||||
<el-option
|
||||
v-for="option in receivingUnitList"
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.label"
|
||||
:disabled="option.dis"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- -->
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="当前油品售出价" prop="oilPrice">
|
||||
<el-input v-model="oilNumber.oilPrice" pattern="^\d+(\.\d+)?$" style="width: 217px">
|
||||
<template slot="append">元{{oilNumber.unit?"/"+oilNumber.unit:''}}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="当前国标价" prop="gbPrice">
|
||||
<el-input v-model="oilNumber.gbPrice" pattern="^\d+(\.\d+)?$" style="width: 217px">
|
||||
<template slot="append">元{{oilNumber.unit?"/"+oilNumber.unit:''}}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-form-item label="收款单位" prop="receivingUnits">-->
|
||||
<!-- <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-row :gutter="24">
|
||||
|
||||
<el-col :span="12">
|
||||
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-radio-group v-model="oilNumber.state">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
<!-- <el-radio label="启用"></el-radio>-->
|
||||
<!-- <el-radio label="禁用"></el-radio>-->
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="24">
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="排序">
|
||||
<el-input-number v-model="oilNumber.sort" controls-position="right" @change="handleChange" :min="1" :max="10" style="width: 217px"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<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>
|
||||
<el-button type="primary" @click=" updateOilNumberin()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="添加预设" :visible.sync="dialogFormPricesAdd" width="500px" :close-on-click-modal="false">
|
||||
<el-form ref="priForm" :model="oilPresetPrices" label-width="100px" :rules="oilPresetPricesRules">
|
||||
<el-form-item label="预设油号" prop="numberId" label-width="120px">
|
||||
<el-select v-model="oilPresetPrices.numberId" placeholder="请选择油号" @change="oilTypeClickByPrice()">
|
||||
<el-option
|
||||
v-for="option in selectOilTypeByPrice"
|
||||
:key="option.numberId"
|
||||
:label="option.oilType +' '+option.oilName"
|
||||
:value="option.numberId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="当前油品售出价" label-width="120px">
|
||||
<el-input v-model="oilPresetPrices.currentPetrolPrices " style="width: 217px" readonly disabled>
|
||||
<template slot="append">元{{oilPresetPrices.unit?"/"+oilPresetPrices.unit:oilPresetPrices.unit}}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="预设油站售出价" prop="presetOilPrices" label-width="120px">
|
||||
<el-input v-model="oilPresetPrices.presetOilPrices" pattern="^\d+(\.\d+)?$" style="width: 217px">
|
||||
<template slot="append">元{{oilPresetPrices.unit?"/"+oilPresetPrices.unit:oilPresetPrices.unit}}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="当前国标价" label-width="120px">
|
||||
<el-input v-model="oilPresetPrices.currentGbPrice" style="width: 217px" readonly disabled>
|
||||
<template slot="append">元{{oilPresetPrices.unit?"/"+oilPresetPrices.unit:oilPresetPrices.unit}}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="预设国标价" prop="presetGbPrice" label-width="120px">
|
||||
<el-input v-model="oilPresetPrices.presetGbPrice" pattern="^\d+(\.\d+)?$" style="width: 217px">
|
||||
<template slot="append">元{{oilPresetPrices.unit?"/"+oilPresetPrices.unit:oilPresetPrices.unit}}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动时间" prop="effectiveTime" label-width="120px">
|
||||
<el-date-picker
|
||||
v-model="oilPresetPrices.effectiveTime"
|
||||
type="datetime"
|
||||
placeholder="选择日期时间"
|
||||
style="width: 217px"
|
||||
:default-value="defaultDateTime"
|
||||
:picker-options="pickerOptions"
|
||||
value-format="yyyy-MM-dd HH:mm:ss">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<!-- <div class="hui-seiz">如生效时间与当前时间间隔小于1分钟,当前油价将立即生效</div>-->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormPricesAdd = false">取 消</el-button>
|
||||
<el-button type="primary" @click="insertOilPresePrices()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
getOilNumberList,
|
||||
dictSelect,
|
||||
insertOilNumber,
|
||||
updateOilNumber,
|
||||
getOilPresetList,
|
||||
getOilNameApi,
|
||||
getAllOilListApi,
|
||||
getOilNameListApi, insertOilPresePricesApi, stopJobApi
|
||||
|
||||
} from "@/api/oilPrice";
|
||||
export default {
|
||||
name: 'oilPrice',
|
||||
dicts: ['jobState','oil_type','zhzt'],
|
||||
data() {
|
||||
var valiNumberPass = (rule, value, callback) => {//包含小数的数字
|
||||
let reg = /^[+-]?(0|([1-9]\d*))(\.\d{1,2})?$/;
|
||||
if (value === '') {
|
||||
callback(new Error('请输入内容'));
|
||||
} else if (!reg.test(value)) {
|
||||
callback(new Error('请输入数字,最多保留两位小数'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
defaultDateTime: new Date(), // 默认时间
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
// 限制选择范围为当前时间之后
|
||||
return time.getTime() < Date.now();
|
||||
},
|
||||
},
|
||||
oilPresetPricesRules: {
|
||||
numberId:[
|
||||
{ required: true, message: '请选择油品类型', trigger: 'change' }
|
||||
],
|
||||
presetOilPrices: [
|
||||
{ required: true, validator:valiNumberPass, trigger: "blur" }
|
||||
],
|
||||
presetGbPrice: [
|
||||
{ required: true, validator:valiNumberPass, trigger: "blur" }
|
||||
],
|
||||
effectiveTime:[
|
||||
{ required: true, message: '请选择日期', trigger: 'change' }
|
||||
],
|
||||
},
|
||||
rules: {
|
||||
oilType:[
|
||||
{ required: true, message: '请选择油品类型', trigger: 'change' }
|
||||
],
|
||||
unit:[
|
||||
{ required: true, message: '请选择单位', trigger: 'change' }
|
||||
],
|
||||
oilName: [
|
||||
{ required: true, message: '请选择油品名称', trigger: 'change' }
|
||||
],
|
||||
oilPrice: [
|
||||
{ required: true, validator:valiNumberPass, trigger: "blur" }
|
||||
],
|
||||
gbPrice: [
|
||||
{ required: true, validator:valiNumberPass, trigger: "blur" }
|
||||
],
|
||||
state: [
|
||||
{ required: true, message: '请选择状态', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
oilNumberList: [],
|
||||
oilNumberList2: [],
|
||||
num: 1,
|
||||
dialogFormVisible: false, // 新增油价配置
|
||||
dialogFormNumberEdit: false, // 修改油价配置
|
||||
dialogFormPricesAdd: false, // 新增油价趋势
|
||||
oilTypeList: [], // 油品类型
|
||||
oilNameList: [], // 油品名称
|
||||
receivingUnitList: [], // 计价单位
|
||||
receivingUnitCN: [],
|
||||
receivingUnitEN: [],
|
||||
colorList:["#EAF9F6","#FFF1E8","#EDF3FF","#FFF8E6"],
|
||||
oilNumber:{
|
||||
oilType: '汽油',
|
||||
oilName: '',
|
||||
numberId: '',
|
||||
oilPrice: '',
|
||||
gbPrice: '',
|
||||
receivingUnits: '元',
|
||||
createTime: '',
|
||||
updateTime: '',
|
||||
state: '启用',
|
||||
sort: '',
|
||||
remark: '',
|
||||
ifDelete: '',
|
||||
allOil:'',
|
||||
oilTypeT: '',
|
||||
oilNameT: '',
|
||||
unit:'', // 计价单位
|
||||
},
|
||||
oilPresetPricesList:[],
|
||||
AllOilList:[],
|
||||
selectOilTypeByPrice: [],
|
||||
oilPresetPrices: {
|
||||
oilType:'',
|
||||
currentPetrolPrices:null ,
|
||||
presetOilPrices:null ,
|
||||
currentGbPrice:null ,
|
||||
presetGbPrice:null ,
|
||||
createTime:'',
|
||||
updateTime:'',
|
||||
// effectiveTime:new date(),
|
||||
effectiveTime:'',
|
||||
ifDelete:'',
|
||||
numberId:'',
|
||||
},
|
||||
form: {
|
||||
name: '',
|
||||
region: '',
|
||||
date1: '',
|
||||
date2: '',
|
||||
delivery: false,
|
||||
type: [],
|
||||
resource: '',
|
||||
desc: ''
|
||||
},
|
||||
formLabelWidth: '100px'
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
try {
|
||||
await this.getList();
|
||||
await this.getAllOilList();
|
||||
await this.getOilPresetListin();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
getStatusText(data) {
|
||||
if (data == 1) {
|
||||
return "停止"
|
||||
} else {
|
||||
return "启用"
|
||||
}
|
||||
},
|
||||
|
||||
handleChange(value) {
|
||||
console.log("this.oilNumber", this.oilNumber);
|
||||
console.log(value);
|
||||
},
|
||||
// 获取数据
|
||||
getList() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
const response = await getOilNumberList();
|
||||
this.oilNumberList2 = response.data.records;
|
||||
await this.getAllOilList();
|
||||
resolve();
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
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
|
||||
}
|
||||
},
|
||||
res() {
|
||||
this.oilNumber = {
|
||||
oilType: '汽油',
|
||||
oilName: '',
|
||||
oilPrice: '',
|
||||
gbPrice: '',
|
||||
receivingUnits: '元',
|
||||
createTime: '',
|
||||
updateTime: '',
|
||||
state: '启用',
|
||||
sort: '',
|
||||
remark: '',
|
||||
ifDelete: '',
|
||||
allOil: '',
|
||||
oilTypeT: '',
|
||||
oilNameT: '',
|
||||
unit: '', // 计价单位
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 编辑时使用
|
||||
async oilTypeMethods(data) {
|
||||
if (data === 1) {
|
||||
// this.oilNumber = {}
|
||||
this.dialogFormVisible = true
|
||||
this.res()
|
||||
this.getOilName('汽油')
|
||||
|
||||
// this.$refs.oilNumberF.rules = null;
|
||||
// this.$refs.oilNumberF.resetFields();
|
||||
// this.$refs.oilNumberF.resetFields();
|
||||
// this.$refs.form.resetFields();
|
||||
}
|
||||
|
||||
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) {
|
||||
// console.log("argumentsKey",argumentsKey)
|
||||
// const value = this.receivingUnitEN[argumentsKey];
|
||||
// var cla = {
|
||||
// label: value.dictLabel,
|
||||
// value: value.dictValue,
|
||||
// dis: false
|
||||
// }
|
||||
// this.receivingUnitList.push(cla);
|
||||
// }
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// 选择油品类型之后触发
|
||||
oilTypeClick(data) {
|
||||
// 清除油品名称
|
||||
// this.oilNumber.oilName = ''
|
||||
// this.oilNumber.oilNameT = ''
|
||||
|
||||
const selectedValue = this.oilNumber.oilType;
|
||||
this.$forceUpdate();
|
||||
// this.getOilTypeList(selectedValue)
|
||||
this.getOilName(selectedValue)
|
||||
},
|
||||
|
||||
oilTypeClick2() {
|
||||
this.oilNumber.oilName = ''
|
||||
this.oilNumber.oilNameT = ''
|
||||
},
|
||||
|
||||
|
||||
// 打开修改窗口
|
||||
openOilNumberEdit(item) {
|
||||
this.oilNumber = {};
|
||||
|
||||
let oil = item.allOil.split(' ');
|
||||
console.log("oilNameT", item)
|
||||
// item.oilNameT = oil[1];
|
||||
// item.oilName = oil[1];
|
||||
|
||||
this.oilNumber = item;
|
||||
this.$set(this.oilNumber, 'oilNameT', oil[1])
|
||||
|
||||
this.oilTypeClick(item);
|
||||
},
|
||||
|
||||
// 添加
|
||||
insertOilNumberin() {
|
||||
this.$refs["oilNumberF"].validate(valid => {
|
||||
if (valid) {
|
||||
insertOilNumber(this.oilNumber).then(response => {
|
||||
var list = response.data
|
||||
if (list < 0) {
|
||||
this.getList();
|
||||
this.$modal.msgWarning("有重复油号");
|
||||
} else if (list > 0) {
|
||||
this.$modal.msgSuccess("新增油号成功");
|
||||
this.dialogFormVisible = false,
|
||||
this.getList();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
|
||||
// 修改
|
||||
async updateOilNumberin() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
var this_ = this
|
||||
updateOilNumber(this_.oilNumber).then(response => {
|
||||
var list = response.data
|
||||
if (list < 0) {
|
||||
this.getList();
|
||||
this.$modal.msgWarning("油品重复");
|
||||
} else {
|
||||
this.getList();
|
||||
this.dialogFormNumberEdit = false
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
}
|
||||
|
||||
}).catch(res => {
|
||||
this.$modal.msgError("修改失败");
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 查询数组字典类型
|
||||
async getOilTypeList(data) {
|
||||
|
||||
var this_ = this
|
||||
await dictSelect(data).then(response => {
|
||||
var list = response.data
|
||||
if (data == "oil_type") {
|
||||
this_.oilTypeList = list;
|
||||
} else if (data == "pricingUnitCN") { //获取几家单位
|
||||
this_.receivingUnitCN = list;
|
||||
console.log("receivingUnitCN1",list)
|
||||
} else if (data == "pricingUnitEN") { //获取几家单位
|
||||
this_.receivingUnitEN = list;
|
||||
console.log("receivingUnitCN2",list)
|
||||
} else {
|
||||
this_.oilNameList = list;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 根据数据字典查询油类名称
|
||||
getOilName(data) {
|
||||
var OilNumber = {
|
||||
oilType: data
|
||||
}
|
||||
var this_ = this
|
||||
getOilNameApi(OilNumber).then(response => {
|
||||
var list = response.data
|
||||
this_.oilNameList = list;
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 油价预设
|
||||
*/
|
||||
// 查询预设油号
|
||||
getOilPresetListin() {
|
||||
var this_ = this
|
||||
getOilPresetList().then(response => {
|
||||
this.oilPresetPricesList = response.data.records
|
||||
|
||||
this.oilPresetPricesList.forEach(oilNumber => {
|
||||
this.AllOilList.forEach(oil => {
|
||||
if (parseInt(oilNumber.oilType) == oil.id) {
|
||||
oilNumber.oilNameT = oil.oilType + ' ' + oil.oilName;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
// 油价预设查询列表
|
||||
getOilNameList() {
|
||||
var this_ = this
|
||||
getOilNameListApi().then(response => {
|
||||
var list = response.data
|
||||
this_.selectOilTypeByPrice = list
|
||||
});
|
||||
},
|
||||
// 新增油价预设
|
||||
addOilPresePrices() {
|
||||
this.oilPresetPrices = {}
|
||||
// this.selectOilTypeByPrice = this.oilNumberList;
|
||||
// 油价预设查询列表
|
||||
this.getOilNameList();
|
||||
},
|
||||
|
||||
// 添加youjia1
|
||||
insertOilPresePrices() {
|
||||
this.$refs["priForm"].validate(valid => {
|
||||
if (valid) {
|
||||
this.dialogFormPricesAdd = false
|
||||
insertOilPresePricesApi(this.oilPresetPrices).then(response => {
|
||||
var list = response.data
|
||||
this.getOilNameList();
|
||||
this.getAllOilList();
|
||||
this.getOilPresetListin();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 更改状态
|
||||
deleteRow(data1, data2) {
|
||||
stopJobApi(data2).then(response => {
|
||||
this.$modal.msgSuccess("停止成功");
|
||||
this.getOilPresetListin();
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
// 新增油价预设
|
||||
oilTypeClickByPrice() {
|
||||
var count = this.oilPresetPrices.numberId;
|
||||
this.selectOilTypeByPrice.forEach((oil) => {
|
||||
if (oil.numberId == parseInt(count)) {
|
||||
this.oilPresetPrices.currentPetrolPrices = oil.oilPrice;
|
||||
this.oilPresetPrices.currentGbPrice = oil.gbPrice;
|
||||
this.oilPresetPrices.numberId = oil.numberId;
|
||||
this.oilPresetPrices.oilType = oil.id;
|
||||
this.oilPresetPrices.unit = oil.unit;
|
||||
}
|
||||
});
|
||||
},
|
||||
changeOilName() {
|
||||
this.oilNumber.oilName = this.oilNumber.oilNameT
|
||||
},
|
||||
|
||||
getSecondName() {
|
||||
this.$forceUpdate();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.app-container{
|
||||
width: 100%;
|
||||
height: 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;
|
||||
}
|
||||
|
||||
.top-icon2{
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
background-color: #3f3f3f;
|
||||
padding: 3px 7px;
|
||||
color: #d9d9d9;
|
||||
font-size: 13px;
|
||||
border-bottom-right-radius: 6px;
|
||||
}
|
||||
.table-box{
|
||||
width: 100%;
|
||||
margin: 20px auto;
|
||||
}
|
||||
.hui-seiz{
|
||||
margin-left:60px;
|
||||
}
|
||||
</style>
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card >
|
||||
<div class="card-change" >
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="" prop="supplierName">
|
||||
<el-select v-model="queryParams.supplierId" placeholder="供应商名称" style="width:100%" clearable
|
||||
@ -40,16 +40,9 @@
|
||||
<!-- </el-date-picker>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<el-form-item style="float: right">
|
||||
<el-form-item style="float: right;margin-right: 0px">
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-top: 20px" >
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@ -57,21 +50,18 @@
|
||||
v-hasPermi="['oilConfig:oilPurchase:list:add']"
|
||||
|
||||
>添加采购</el-button>
|
||||
</el-col>
|
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table ref="tables"
|
||||
v-loading="loading"
|
||||
:data="purchaseList"
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column label="业务单号" align="center" prop="purchaseNo"/>
|
||||
<el-table-column label="单据详情" align="center">
|
||||
<el-table-column label="供应商" align="center" prop="supplierss"/>
|
||||
<el-table-column label="油品" align="center" prop="oils"/>
|
||||
<el-table-column label="入库油罐" align="center" prop="tanks"/>
|
||||
<el-table-column label="单据金额" align="center" prop="theDocumentAmount"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="进货单号" align="center" prop="purchaseNo"/>
|
||||
<el-table-column label="供应商" align="center" prop="supplierss"/>
|
||||
<el-table-column label="油品-油号" align="center" prop="oils"/>
|
||||
<el-table-column label="入库油罐" align="center" prop="tanks"/>
|
||||
<el-table-column label="单据金额" align="center" prop="theDocumentAmount"/>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
@ -82,11 +72,20 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作人员" align="center">
|
||||
<el-table-column label="制单人" align="center" prop="creatorName"/>
|
||||
<el-table-column label="审核人" align="center" prop="reviewerName"/>
|
||||
<el-table-column label="制单人" align="center" prop="creatorName"/>
|
||||
<el-table-column label="审核人" align="center" prop="reviewerName"/>
|
||||
<el-table-column label="入库人" align="center" prop="reviewerName"/>
|
||||
<el-table-column label="制单时间" align="center" prop="createdAt" width="200">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createdAt) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="制单日期" align="center" prop="createdAt" width="200">
|
||||
<el-table-column label="审核时间" align="center" prop="createdAt" width="200">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createdAt) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入库时间" align="center" prop="createdAt" width="200">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createdAt) }}</span>
|
||||
</template>
|
||||
@ -117,7 +116,7 @@
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -78,7 +78,7 @@
|
||||
v-loading="loading"
|
||||
:data="orderList"
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column label="油品名称" align="center" prop="numberName"/>
|
||||
<el-table-column label="油品油号" align="center" prop="numberName"/>
|
||||
<el-table-column label="入库油罐" align="center" prop="tankName"/>
|
||||
<el-table-column label="供应商" align="center" prop="supplierName" />
|
||||
<el-table-column label="当前库存" align="center" prop="storedQuantity"/>
|
||||
@ -105,7 +105,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购升数(L)" align="center" prop="purchaseVolume"/>
|
||||
<el-table-column label="折和单价(元/升)" align="center" prop="discountedPrice"/>
|
||||
<el-table-column label="成本价(元/升)" align="center" prop="discountedPrice"/>
|
||||
<el-table-column v-if="state =='await'" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -38,39 +38,28 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item style="float: right">
|
||||
<el-form-item style="float: right;margin-right: 0px">
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" @click="exportExcelTank()"
|
||||
v-hasPermi="['oilConfig:oilStatistics:list:ex']"
|
||||
>导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 列表-->
|
||||
<el-card style="margin-top: 20px" >
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col :span="1.5">
|
||||
<h3>油罐列表</h3>
|
||||
</el-col> -->
|
||||
<!-- <el-button @click="exportExcelTank()">导出</el-button>-->
|
||||
<div style="display: flex;justify-content: space-between">
|
||||
<div style="font-size: 18px">油罐列表</div>
|
||||
<el-button type="primary" @click="exportExcelTank()"
|
||||
v-hasPermi="['oilConfig:oilStatistics:list:ex']"
|
||||
>导出</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
|
||||
<el-table key="2" ref="tables"
|
||||
v-loading="loading"
|
||||
:data="statisticsList"
|
||||
border
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column align="center" type="index" label="序号"></el-table-column>
|
||||
<el-table-column label="油罐名称" align="center" prop="tankName"/>
|
||||
<el-table-column label="油品名称" align="center" prop="oilNumber" />
|
||||
<el-table-column label="油罐容量" align="center" prop="tankVolume" />
|
||||
<el-table-column label="油罐容量L" align="center" prop="tankVolume" />
|
||||
<el-table-column label="油品密度(g/ml)" align="center" prop="oilDensity" />
|
||||
<el-table-column label="当前剩余升数" align="center" prop="storedQuantity" />
|
||||
<el-table-column label="当前成本价" align="center" prop="discountedPrice" />
|
||||
<el-table-column label="成本金额" align="center" prop="totalPrice" />
|
||||
<el-table-column label="当前剩余油量(L)" align="center" prop="storedQuantity" />
|
||||
<el-table-column label="当前成本价(元/L)" align="center" prop="discountedPrice" />
|
||||
<el-table-column label="成本金额(元)" align="center" prop="totalPrice" />
|
||||
<el-table-column label="状态" align="center" prop="inventoryStatistics">
|
||||
<template slot-scope="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
@ -78,6 +67,17 @@
|
||||
<el-tag v-if ="scope.row.inventoryStatistics == '禁用'" type="danger" size="medium">禁用</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-switch-->
|
||||
<!-- v-model="scope.row.status"-->
|
||||
<!-- active-value="启用"-->
|
||||
<!-- inactive-value="禁用"-->
|
||||
<!-- @change="changeStatus(scope.row)"-->
|
||||
<!-- active-color="#13ce66"-->
|
||||
<!-- inactive-color="#ff4949">-->
|
||||
<!-- </el-switch>-->
|
||||
|
||||
<!-- </template>-->
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" width="200">
|
||||
<template slot-scope="scope">
|
||||
@ -91,7 +91,7 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="trace(scope.row)"
|
||||
>库存跟踪</el-button>
|
||||
>库存跟踪记录</el-button>
|
||||
<!-- v-hasPermi="['']"-->
|
||||
|
||||
</template>
|
||||
@ -108,56 +108,36 @@
|
||||
|
||||
|
||||
<el-drawer
|
||||
title="库存跟踪"
|
||||
title="库存跟踪记录"
|
||||
:visible.sync="drawer"
|
||||
direction="rtl"
|
||||
size="50%"
|
||||
size="40%"
|
||||
:before-close="handleClose">
|
||||
|
||||
<div style="display: grid; place-items: center;">
|
||||
<el-card class="box-card" style="background-color: #f5f5f5">
|
||||
<div slot="header" class="clearfix">
|
||||
<div style="position: relative;">
|
||||
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
|
||||
<h2>{{statisticsForm.tankName}}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<span>油品名称:</span>
|
||||
<span>{{ statisticsForm.oilNumber }}</span>
|
||||
</div>
|
||||
<div class="box-card" style="">
|
||||
<div style="display: flex; justify-content: space-between;margin-bottom: 10px">
|
||||
<span>油罐名称:{{statisticsForm.tankName}}</span>
|
||||
<span>油品油号:{{ statisticsForm.oilNumber }}</span>
|
||||
<span>库存数量:{{statisticsForm.storedQuantity}}{{statisticsForm.unit}}</span>
|
||||
<span>更新时间:{{ statisticsForm.updateTime }}</span>
|
||||
</div>
|
||||
<div >
|
||||
<div style="margin-top:-5px;display: flex; justify-content: space-between;">
|
||||
<h3>库存数量</h3>
|
||||
<h3>{{statisticsForm.storedQuantity}}{{statisticsForm.unit}}</h3>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<span>更新时间</span>
|
||||
<span>{{ statisticsForm.updateTime }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card" style="margin-top: 15px">
|
||||
<el-table ref="tables"
|
||||
v-loading="loading"
|
||||
:data="trackList"
|
||||
:default-sort="defaultSort"
|
||||
border
|
||||
key="1">
|
||||
<el-table-column
|
||||
lable="#"
|
||||
type="index"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" type="index" label="序号"></el-table-column>
|
||||
<el-table-column label="单据" align="center" prop="document" />
|
||||
<el-table-column label="单号" align="center" prop="orderNumber" />
|
||||
<el-table-column label="变动数量(L)" align="center" prop="quantityChange" />
|
||||
|
||||
<el-table-column label="库存更新时间" align="center" prop="updateTime" width="200">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.updateTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据" align="center" prop="document" />
|
||||
<el-table-column label="单号" align="center" prop="orderNumber" />
|
||||
<el-table-column label="变动数量" align="center" prop="quantityChange" />
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total2>0"
|
||||
@ -166,7 +146,7 @@
|
||||
:limit.sync="queryParams2.pageSize"
|
||||
@pagination="getTrackingList"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-card >
|
||||
<div class="card-change" >
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="" prop="supplierName">
|
||||
<el-input
|
||||
@ -32,28 +32,20 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item style="float: right">
|
||||
<el-form-item style="float: right;margin-right: 0px">
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<!-- 列表-->
|
||||
<el-card style="margin-top: 20px" >
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="suppliersAdd"
|
||||
v-hasPermi="['oilConfig:oilSuppliers:list:add']"
|
||||
>新增供应商</el-button>
|
||||
</el-col>
|
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table ref="tables"
|
||||
v-loading="loading"
|
||||
:data="suppliersList"
|
||||
border
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column label="序号" align="center" type="index"/>
|
||||
<el-table-column label="供应商名称" align="center" prop="supplierName"/>
|
||||
@ -61,6 +53,7 @@
|
||||
<el-table-column label="联系方式" align="center" prop="contactPhone"/>
|
||||
<el-table-column label="联系地址" align="center" prop="contactAddress"/>
|
||||
<el-table-column label="备注信息" align="center" prop="remarks"/>
|
||||
<el-table-column label="创建人" align="center" prop="createName"/>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
@ -84,44 +77,31 @@
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 新增/修改-->
|
||||
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body :close-on-click-modal="false">
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="suppliersForm" :rules="rules" label-width="120px">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="供应商" prop="supplierName">
|
||||
<el-input v-model="suppliersForm.supplierName" placeholder="供应商名称" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="联系人" prop="contactPerson">
|
||||
<el-input v-model="suppliersForm.contactPerson" placeholder="联系人名称" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="联系电话" prop="contactPhone">
|
||||
<el-input v-model="suppliersForm.contactPhone" placeholder="联系电话" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="联系地址" prop="contactAddress">
|
||||
<el-input v-model="suppliersForm.contactAddress" placeholder="联系地址" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="备注信息" prop="remarks">
|
||||
<el-input type="textarea" v-model="suppliersForm.remarks" placeholder="备注信息" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="供应商" prop="supplierName">
|
||||
<el-input v-model="suppliersForm.supplierName" style="width: 300px" placeholder="供应商名称" maxlength="30"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="联系人" prop="contactPerson">
|
||||
<el-input v-model="suppliersForm.contactPerson" style="width: 300px" placeholder="联系人名称" maxlength="30"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="联系电话" prop="contactPhone">
|
||||
<el-input v-model="suppliersForm.contactPhone" style="width: 300px" placeholder="联系电话" maxlength="30"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="联系地址" prop="contactAddress">
|
||||
<el-input v-model="suppliersForm.contactAddress" style="width: 300px" placeholder="联系地址" maxlength="30"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注信息" prop="remarks">
|
||||
<el-input type="textarea" v-model="suppliersForm.remarks" style="width: 300px" placeholder="备注信息" maxlength="30"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
</el-form>
|
||||
@ -269,7 +249,7 @@ export default {
|
||||
background: #f6f8f9;
|
||||
}
|
||||
.el-form--inline .el-form-item {
|
||||
margin-right: 44px;
|
||||
//margin-right: 20px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -38,6 +38,7 @@
|
||||
<el-table ref="tables"
|
||||
v-loading="loading"
|
||||
:data="tankList"
|
||||
border
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column align="center" type="index" label="序号"></el-table-column>
|
||||
<el-table-column label="油罐名称" align="center" prop="tankName"/>
|
||||
@ -50,19 +51,20 @@
|
||||
<el-table-column label="存油数量" align="center" prop="storedQuantity"/>
|
||||
<el-table-column label="存油总价(元)" align="center" prop="totalPrice"/>
|
||||
<el-table-column label="成本价(元/升)" align="center" prop="discountedPrice"/>
|
||||
<el-table-column label="成本价(元/升)" align="center" prop="discountedPrice">
|
||||
<el-table-column label="油罐状态" align="center" prop="discountedPrice">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
active-value="qy"
|
||||
inactive-value="jy"
|
||||
active-value="启用"
|
||||
inactive-value="禁用"
|
||||
@change="changeStatus(scope.row)"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作人" align="center" prop="totalPrice"/>
|
||||
<el-table-column label="操作人" align="center" prop="createName"/>
|
||||
|
||||
<el-table-column label="操作时间" align="center" prop="updateTime" width="200">
|
||||
<template slot-scope="scope">
|
||||
@ -101,110 +103,79 @@
|
||||
</div>
|
||||
|
||||
<!-- 新增/修改-->
|
||||
<el-dialog :title="title" :visible.sync="open" width="60%" append-to-body :close-on-click-modal="false">
|
||||
<el-dialog :title="title" :visible.sync="open" width="30%" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="tankForm" :rules="rules" label-width="120px">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="16">
|
||||
<el-form-item label="油罐名称" prop="tankName">
|
||||
<el-input v-model="tankForm.tankName" placeholder="请输入油罐名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="油品号" prop="oilNumber">
|
||||
<el-select v-model="tankForm.numberId" placeholder="请选择油品号" style="width:100%" @change="chooseOilNumber()" :disabled="disableInput">
|
||||
<el-option
|
||||
v-for="option in selectOilTypeByPrice"
|
||||
:key="option.numberId"
|
||||
:label="option.oilType +' '+option.oilName"
|
||||
:value="option.numberId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="油罐体积" prop="tankVolume">
|
||||
<el-input v-model="tankForm.tankVolume" placeholder="请输入油罐体积" maxlength="30" @change="changeNumber" :disabled="disableInput">
|
||||
<el-form-item label="油罐名称" prop="tankName">
|
||||
<el-input v-model="tankForm.tankName" placeholder="请输入油罐名称" style="width:300px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="油品油号" prop="oilNumber">
|
||||
<el-select v-model="tankForm.numberId" placeholder="请选择油品油号" style="width:300px" @change="chooseOilNumber()" :disabled="disableInput">
|
||||
<el-option
|
||||
v-for="option in selectOilTypeByPrice"
|
||||
:key="option.numberId"
|
||||
:label="option.oilType +' '+option.oilName"
|
||||
:value="option.numberId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="油罐体积" prop="tankVolume">
|
||||
<el-input v-model="tankForm.tankVolume" placeholder="请输入油罐体积" maxlength="30" @change="changeNumber" style="width:300px" :disabled="disableInput">
|
||||
<template slot="append">{{tankForm.unit}}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="下限预警" prop="lowerWarning">
|
||||
<el-input v-model="tankForm.lowerWarning" placeholder="小于预警值将进行提示" style="width:300px" maxlength="30">
|
||||
<template slot="append">{{tankForm.unit}}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<template v-if="title == '修改油罐'">
|
||||
<el-form-item label="油品密度" prop="oilDensity">
|
||||
<el-input v-model="tankForm.oilDensity" placeholder="请输入油品密度" style="width:300px" :disabled="true" maxlength="30" @input="getSecondName()">
|
||||
<template slot="append">g/ml</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="存油数量" prop="storedQuantity">
|
||||
<el-input v-model="tankForm.storedQuantity" placeholder="请输入存油数量" style="width:300px" maxlength="30" :disabled="true" pattern="^\d+(\.\d+)?$" @change="changeNumber" @input="changePrice() " >
|
||||
<template slot="append">{{tankForm.unit}}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="下限预警" prop="lowerWarning">
|
||||
<el-input v-model="tankForm.lowerWarning" placeholder="小于预警值将进行提示" maxlength="30">
|
||||
<template slot="append">{{tankForm.unit}}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="油品密度" prop="oilDensity">
|
||||
<el-input v-model="tankForm.oilDensity" placeholder="请输入油品密度" :disabled="true" maxlength="30" @input="getSecondName()">
|
||||
<template slot="append">g/ml</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="存油数量" prop="storedQuantity">
|
||||
<el-input v-model="tankForm.storedQuantity" placeholder="请输入存油数量" maxlength="30" :disabled="true" pattern="^\d+(\.\d+)?$" @change="changeNumber" @input="changePrice() " >
|
||||
<template slot="append">{{tankForm.unit}}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="存油总价" prop="totalPrice" >
|
||||
<el-input v-model="tankForm.totalPrice" placeholder="请输入存油总价" maxlength="30" :disabled="true" @input="changePrice()" @change="changeNumber" >
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="折合单价" prop="discountedPrice">
|
||||
<el-input v-model="tankForm.discountedPrice" placeholder="请输入折合单价" maxlength="30" :disabled="true">
|
||||
<template slot="append">元{{tankForm.unit?"/"+tankForm.unit:''}}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="油罐状态" prop="status">
|
||||
<el-radio-group v-model="tankForm.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
@change="handleIsopenSelect"
|
||||
/>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="库存统计" prop="inventoryStatistics">
|
||||
<el-radio-group v-model="tankForm.inventoryStatistics">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
@change="handleIsopenSelect"
|
||||
/>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注信息">
|
||||
<el-input type="textarea" v-model="tankForm.remarks"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="存油总价" prop="totalPrice" >-->
|
||||
<!-- <el-input v-model="tankForm.totalPrice" placeholder="请输入存油总价" style="width:300px" maxlength="30" :disabled="true" @input="changePrice()" @change="changeNumber" >-->
|
||||
<!-- <template slot="append">元</template>-->
|
||||
<!-- </el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="折合单价" prop="discountedPrice">
|
||||
<el-input v-model="tankForm.discountedPrice" placeholder="请输入折合单价" maxlength="30" style="width:300px" :disabled="true">
|
||||
<template slot="append">元{{tankForm.unit?"/"+tankForm.unit:''}}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<el-form-item label="油罐状态" prop="status">
|
||||
<el-radio-group v-model="tankForm.status">
|
||||
<el-radio
|
||||
v-for="dict in statusList"
|
||||
:key="dict"
|
||||
:label="dict"
|
||||
:value="dict"
|
||||
@change="handleIsopenSelect"
|
||||
/>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="库存统计" prop="inventoryStatistics">-->
|
||||
<!-- <el-radio-group v-model="tankForm.inventoryStatistics">-->
|
||||
<!-- <el-radio-->
|
||||
<!-- v-for="dict in dict.type.zhzt"-->
|
||||
<!-- :key="dict.value"-->
|
||||
<!-- :label="dict.label"-->
|
||||
<!-- :value="dict.value"-->
|
||||
<!-- @change="handleIsopenSelect"-->
|
||||
<!-- />-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="备注信息">
|
||||
<el-input type="textarea" style="width:300px" v-model="tankForm.remarks"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
@ -222,6 +193,7 @@ import {getName,parseTime} from "../../../utils/fuint";
|
||||
import {addStaff, updateStaff} from "@/api/staff/staff";
|
||||
import {getOilNameListApi} from "@/api/oilPrice";
|
||||
import { BigNumber } from 'bignumber.js';
|
||||
import {changeAccountStatus} from "@/api/system/account";
|
||||
|
||||
|
||||
|
||||
@ -247,6 +219,7 @@ export default {
|
||||
// 表单名称
|
||||
title:'',
|
||||
tankList: [], // 油罐列表
|
||||
statusList: ['启用','禁用'],
|
||||
tankForm: {
|
||||
id: null,
|
||||
tankName: '',
|
||||
@ -369,7 +342,13 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
changeStatus(data) {
|
||||
updateTankApi(data).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
// 修改操作
|
||||
handleUpdate(data) {
|
||||
this.disableInput = true
|
||||
|
Loading…
Reference in New Issue
Block a user