Browse Source

5.19

master
fengdong777 2 years ago
parent
commit
8b24b530ed
  1. 11
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/oilTank/oilTank.js
  2. 10
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/layout/components/Sidebar/index.vue
  3. 9
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/router/index.js
  4. 167
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/inventory/oilTankInfo/index.vue
  5. 512
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/inventory/oilTankList/index.vue
  6. 15
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/inventory/oilTypeInBoundList/index.vue
  7. 15
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/inventory/oilTypeOutBoundList/index.vue

11
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/oilTank/oilTank.js

@ -14,6 +14,17 @@ export default {
}
})
},
selectTankInformation: function(params) {
return request({
url: '/cyf/tankinfo/selectTankInformation',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
},
addInfo: function(data) {
return request({

10
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/layout/components/Sidebar/index.vue

@ -125,6 +125,16 @@ export default {
name: "/inventory/oilTypeOutBoundList",
path: "/inventory/oilTypeOutBoundList",
},
{
alwaysShow: true,
component: "index",
meta: {
icon: "el-icon-help",
title: "库存信息",
},
name: "/inventory/oilTankInfo",
path: "/inventory/oilTankInfo",
},
],
},
{

9
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/router/index.js

@ -175,6 +175,15 @@ export const constantRoutes = [{
title: '原油出库记录'
}
},
{
path: '/inventory/oilTankInfo',
component: () =>
import('@/views/inventory/oilTankInfo/index.vue'),
name: 'index',
meta: {
title: '库存信息'
}
},
]
},

167
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/inventory/oilTankInfo/index.vue

@ -0,0 +1,167 @@
<template>
<div class="app-container">
<div v-show="viewState ==1">
<button-bar view-title="油罐信息" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="listtop">
<div class="tit">油罐列表</div>
</div>
<div >
<el-table ref="looktable" v-loading="listLoading" height="585" :data="list" border :summary-method="getSummaries" show-summary style="width: 100%;" >
<!-- <el-table-column type="selection" align="center" width="50"/> -->
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
<el-table-column label="油罐编号" prop="number" align="center" />
<el-table-column label="原油名称" prop="crudeName" align="center" />
<el-table-column label="原油编号" prop="crudeNumber" align="center" />
<el-table-column label="油罐容量" prop="capacity" align="center" />
<el-table-column label="油罐库存(吨)" prop="inventory" align="center" />
<el-table-column label="油罐现有库存(吨)" prop="existingInventory" align="center" />
<el-table-column label="油罐总价值(元)" prop="totalValue" align="center" />
</el-table>
</div>
</div>
</div>
</div>
</template>
<script>
import req from '@/api/oilTank/oilTank'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
// import oilTypeInfo from './oilTypeInfo.vue'
export default {
name: 'CustomerManagement',
components: {
pageye,
ButtonBar
},
data() {
return {
listLoading: false,
btndisabled: false,
editDialog: false,
form: {},
btnList: [{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
isSearchShow: false,
searchxianshitit: '显示查询条件',
list: [],
listQuery: {
current: 1,
size: 50,
params: {
entryName: '',
},
total: 0
},
viewState: 1
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.init()
//
},
methods: {
btnHandle(btnKey) {
switch (btnKey) {
case 'doClose':
this.doClose()
break
default:
break
}
},
//
init() {
this.getList()
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
this.listLoading = true
req.selectTankInformation().then((response) => {
this.listLoading = false
if (response.success) {
this.list = response.data
this.$nextTick(() => {this.$refs.looktable.doLayout()}) //
} else {
this.list = []
}
})
},
//
toAdd() {
this.viewState = 2
},
reset() {
this.form = {};
},
resetState() {
this.viewState = 1
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
//
accAdd(arg1, arg2) {
var r1, r2, m;
try {
r1 = arg1.toString().split(".")[1].length;
} catch(e) {
r1 = 0;
}
try {
r2 = arg2.toString().split(".")[1].length;
}catch(e){
r2 = 0;
}
//JS
m = Math.pow(10, Math.max(r1, r2));
//
return parseFloat((arg1 * m + arg2 * m) / m).toFixed(2);
},
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (column.property === 'inventory' || column.property === 'existingInventory' || column.property === 'totalValue') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return this.accAdd(prev,curr);
} else {
return prev;
}
}, 0);
sums[index];
}
});
return sums
}
}
}
</script>
<style scoped>
</style>

512
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/inventory/oilTankList/index.vue

@ -1,271 +1,339 @@
<template>
<div class="app-container">
<div v-show="viewState ==1">
<button-bar ref="btnbar" view-title="油罐库存记录" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div v-show="viewState == 1">
<button-bar
ref="btnbar"
view-title="油罐库存记录"
:btndisabled="btndisabled"
@btnhandle="btnHandle"
/>
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form ref="queryParams" :model="jmdListQuery" :inline="true" class="tab-header">
<el-form
ref="queryParams"
:model="jmdListQuery"
:inline="true"
class="tab-header"
>
<el-form-item label="油罐编号">
<el-input v-model="jmdListQuery.number" maxlength="20" placeholder="请输入油罐编号" class="addinputw"
clearable />
<el-input
v-model="jmdListQuery.number"
maxlength="20"
placeholder="请输入油罐编号"
class="addinputw"
clearable
/>
</el-form-item>
<el-form-item label="日期">
<el-date-picker v-model="jmdListQuery.date" :picker-options="pickerOptions" type="date" clearable value-format="yyyy-MM-dd"
placeholder="选择日期" />
<el-date-picker
v-model="jmdListQuery.date"
:picker-options="pickerOptions"
type="date"
clearable
value-format="yyyy-MM-dd"
placeholder="选择日期"
/>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<div class="btn" style="text-align: center">
<el-button
type="primary"
size="small"
icon="el-icon-search"
@click="dosearch"
>查询</el-button
>
<el-button
type="primary"
size="small"
icon="el-icon-refresh"
@click="resetQuery"
>重置</el-button
>
</div>
</div>
</div>
<div>
<el-table v-loading="tableLoading1" :data="logList" border style="width: 100%">
<el-table-column fixed width="100" type="index" label="序号" :index="indexMethod" align="center" />
<el-table-column prop="tankNumber" label="油罐编号" align="center" />
<el-table-column prop="existingInventory" label="油罐登记库存" align="center" />
<el-table-column prop="recordDate" label="登记日期" align="center" />
<el-table-column label="操作" width='150px' align="center">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="purchase(scope.row)"
>
查看详情
</el-button>
</template>
</el-table-column>
<el-table
v-loading="tableLoading1"
:data="logList"
border
style="width: 100%"
>
<el-table-column
fixed
width="100"
type="index"
label="序号"
:index="indexMethod"
align="center"
/>
<el-table-column
prop="tankNumber"
label="油罐编号"
align="center"
/>
<el-table-column
prop="existingInventory"
label="油罐登记库存"
align="center"
/>
<el-table-column
prop="recordDate"
label="登记日期"
align="center"
/>
<el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="purchase(scope.row)"
>
查看详情
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination v-show="logListTotal > 0" :total="logListTotal" :page.sync="logListQuery.current"
:limit.sync="logListQuery.size" class="pagination" @pagination="loadLogList" />
<pagination
v-show="logListTotal > 0"
:total="logListTotal"
:page.sync="logListQuery.current"
:limit.sync="logListQuery.size"
class="pagination"
@pagination="loadLogList"
/>
</div>
</div>
</div>
<el-dialog
:title="dialogTitle + '详细信息'"
:visible.sync="editDialog"
width="37%"
>
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="油罐编号:">
<span>{{ form.number }}</span>
</el-form-item>
<el-form-item label="登记日期:">
<span>{{ form.recordDate }}</span>
</el-form-item>
<el-form-item label="库存高度:">
<span>{{ form.height }}</span>
</el-form-item>
<el-form-item label="描述:" prop="url">
<el-popover placement="left" trigger="hover">
<img :src="form.url" style="width: 500px;height: 400px">
<img slot="reference" :src="form.url" style="width: 200px;height: 150px">
</el-popover>
</el-form-item>
</el-form>
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="油罐编号:">
<span>{{ form.number }}</span>
</el-form-item>
<el-form-item label="登记日期:">
<span>{{ form.recordDate }}</span>
</el-form-item>
<el-form-item label="库存高度:">
<span>{{ form.height }}</span>
</el-form-item>
<el-form-item label="描述:" prop="url">
<el-popover placement="left" trigger="hover">
<img :src="form.url" style="width: 500px; height: 500px" />
<img
slot="reference"
:src="form.url"
style="width: 150px; height: 150px"
/>
</el-popover>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import req from '@/api/oilTank/oilTank'
import Pagination from '@/components/pagination'
import {
parseTime
} from '@/utils/index'
import ButtonBar from '@/components/ButtonBar'
export default {
components: {
ButtonBar,
Pagination,
},
data() {
return {
viewState: 1,
tabActiveName: 'uplog',
index: "0",
isSearchShow: false,
dialogTitle:'',
editDialog:false,
searchxianshitit: '显示查询条件',
btndisabled: false,
tableLoading1: false,
tableLoading2: false,
btnList: [ //
// {
// type: 'success',
// size: 'small',
// icon: 'export',
// btnKey: 'build',
// btnLabel: ''
// },
// {
// type: 'primary',
// size: 'small',
// icon: 'plus',
// btnKey: 'toAdd1',
// btnLabel: ''
// },
// {
// type: 'primary',
// size: 'small',
// icon: 'plus',
// btnKey: 'toAdd2',
// btnLabel: ''
// },
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
logList: [],
form:{},
logListQuery: {
current: 1,
size: 10
import req from "@/api/oilTank/oilTank";
import Pagination from "@/components/pagination";
import { parseTime } from "@/utils/index";
import ButtonBar from "@/components/ButtonBar";
export default {
components: {
ButtonBar,
Pagination,
},
data() {
return {
viewState: 1,
tabActiveName: "uplog",
index: "0",
isSearchShow: false,
dialogTitle: "",
editDialog: false,
searchxianshitit: "显示查询条件",
btndisabled: false,
tableLoading1: false,
tableLoading2: false,
btnList: [
//
// {
// type: 'success',
// size: 'small',
// icon: 'export',
// btnKey: 'build',
// btnLabel: ''
// },
// {
// type: 'primary',
// size: 'small',
// icon: 'plus',
// btnKey: 'toAdd1',
// btnLabel: ''
// },
// {
// type: 'primary',
// size: 'small',
// icon: 'plus',
// btnKey: 'toAdd2',
// btnLabel: ''
// },
{
type: "info",
size: "small",
icon: "cross",
btnKey: "doClose",
btnLabel: "关闭",
},
logListTotal: 1,
],
logList: [],
form: {},
logListQuery: {
current: 1,
size: 10,
},
logListTotal: 1,
jmdListQuery: {
number: "",
date: ""
jmdListQuery: {
number: "",
date: "",
},
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now(); // -8.64e7
},
pickerOptions:{
disabledDate(time){
return time.getTime()> Date.now()- 8.64e7;// -8.64e7
}
}
},
};
},
mounted() {
//
this.$refs["btnbar"].setButtonList(this.btnList);
},
created() {
//
this.init();
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow;
if (this.isSearchShow) {
this.searchxianshitit = "隐藏查询条件";
} else {
this.searchxianshitit = "显示查询条件";
}
},
mounted() {
//
this.$refs['btnbar'].setButtonList(this.btnList)
dosearch() {
this.loadLogList();
},
created() {
//
this.init()
resetQuery() {
this.jmdListQuery = {
contractNumber: "",
date: "",
};
this.loadLogList();
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
dosearch() {
this.loadLogList()
},
resetQuery() {
this.jmdListQuery = {
contractNumber: "",
date: ""
}
this.loadLogList()
},
//
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd1': //
this.doAdd1()
break
case 'toAdd2': //
this.doAdd2()
break
case 'build': //
this.doBuild()
break
case 'doClose': //
this.doClose()
break
default:
break
}
},
init() {
this.loadLogList()
},
loadLogList() {
req.crudeinventoryList({
//
btnHandle(btnKey) {
switch (btnKey) {
case "toAdd1": //
this.doAdd1();
break;
case "toAdd2": //
this.doAdd2();
break;
case "build": //
this.doBuild();
break;
case "doClose": //
this.doClose();
break;
default:
break;
}
},
init() {
this.loadLogList();
},
loadLogList() {
req
.crudeinventoryList({
current: this.logListQuery.current,
size: this.logListQuery.size,
params: this.jmdListQuery
}).then(response => {
if (response.code === '200' && response.data && response.data.total > 0) {
this.logList = response.data.records
this.logListTotal = response.data.total
this.logListQuery.current = response.data.current
this.logListQuery.size = response.data.size
params: this.jmdListQuery,
})
.then((response) => {
if (
response.code === "200" &&
response.data &&
response.data.total > 0
) {
this.logList = response.data.records;
this.logListTotal = response.data.total;
this.logListQuery.current = response.data.current;
this.logListQuery.size = response.data.size;
} else {
this.logList = []
this.logListTotal = 0
this.logList = [];
this.logListTotal = 0;
}
})
},
//
indexMethod(index) {
var pagestart = (this.logListQuery.current - 1) * this.logListQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
doAdd1() {
this.viewState = 2
},
doAdd2() {
this.viewState = 3
},
purchase(row){
this.dialogTitle = "数据";
this.editDialog = true;
req.selectRecordBySid(row.sid).then((res)=>{
this.form=res.data
})
},
resetState() {
this.viewState = 1
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
}
}
}
});
},
//
indexMethod(index) {
var pagestart = (this.logListQuery.current - 1) * this.logListQuery.size;
var pageindex = index + 1 + pagestart;
return pageindex;
},
doAdd1() {
this.viewState = 2;
},
doAdd2() {
this.viewState = 3;
},
purchase(row) {
this.dialogTitle = "数据";
this.editDialog = true;
req.selectRecordBySid(row.sid).then((res) => {
this.form = res.data;
});
},
resetState() {
this.viewState = 1;
},
doClose() {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.go(-1);
},
},
};
</script>
<style scoped>
.wenjiantit {
font-size: 16px;
font-weight: bold;
margin: 25px 0 10px 0;
}
span{
margin-left: 20px;
}
.forminfo {
margin: 0;
padding: 0;
}
.wenjiantit {
font-size: 16px;
font-weight: bold;
margin: 25px 0 10px 0;
}
span {
margin-left: 20px;
}
.forminfo {
margin: 0;
padding: 0;
}
.listcon {
height: calc(100vh - 250px);
overflow-y: auto;
overflow-x: hidden;
}
.listcon {
height: calc(100vh - 250px);
overflow-y: auto;
overflow-x: hidden;
}
</style>

15
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/inventory/oilTypeInBoundList/index.vue

@ -14,7 +14,7 @@
clearable />
</el-form-item>
<el-form-item label="日期">
<el-date-picker v-model="jmdListQuery.date" type="date" clearable value-format="yyyy-MM-dd"
<el-date-picker v-model="jmdListQuery.date" type="date" :picker-options="pickerOptions" clearable value-format="yyyy-MM-dd"
placeholder="选择日期" />
</el-form-item>
</el-form>
@ -133,6 +133,12 @@
</el-form-item>
</el-col>
</el-row>
<el-form-item label="描述:" >
<el-popover placement="left" trigger="hover">
<img :src="form.url" style="width: 600px;height: 600px">
<img slot="reference" :src="form.url" style="width: 200px;height: 200px">
</el-popover>
</el-form-item>
</el-form>
</el-dialog>
@ -211,7 +217,12 @@
jmdListQuery: {
contractNumber: "",
date: ""
}
},
pickerOptions:{
disabledDate(time){
return time.getTime()> Date.now();// -8.64e7
}
}
}
},
mounted() {

15
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/inventory/oilTypeOutBoundList/index.vue

@ -14,7 +14,7 @@
clearable />
</el-form-item>
<el-form-item label="日期">
<el-date-picker v-model="jmdListQuery.date" type="date" clearable value-format="yyyy-MM-dd"
<el-date-picker v-model="jmdListQuery.date" type="date" :picker-options="pickerOptions" clearable value-format="yyyy-MM-dd"
placeholder="选择日期" />
</el-form-item>
</el-form>
@ -123,6 +123,12 @@
</el-form-item>
</el-col>
</el-row>
<el-form-item label="描述:">
<el-popover placement="left" trigger="hover">
<img :src="form.url" style="width: 500px;height: 500px">
<img slot="reference" :src="form.url" style="width: 150px;height: 150px">
</el-popover>
</el-form-item>
</el-form>
</el-dialog>
</div>
@ -199,7 +205,12 @@
jmdListQuery: {
contractNumber: "",
date: ""
}
},
pickerOptions:{
disabledDate(time){
return time.getTime()> Date.now();// -8.64e7
}
}
}
},
mounted() {

Loading…
Cancel
Save