Merge branch 'dev-nx' of http://192.168.0.56:3000/bonus/devicesmgt into dev-nx

This commit is contained in:
BianLzhaoMin 2024-04-24 17:57:50 +08:00
commit 237699319a
16 changed files with 1378 additions and 13 deletions

View File

@ -0,0 +1,34 @@
import { POST, GET } from './index.js'
const URL_TYPE_LIST = '/screen/material/returnOfMaterialsInfo/getTypeList'
const URL_DETAILS = '/screen/base/largeScreen/home/getMaterialReqData/details'
const URL_RETURN_DETAILS = '/screen/base/largeScreen/home/getMaterialReturnData/details'
const URL_UNIT_LIST = '/screen/material/agreementInfo/getUnitList'
const URL_PROJECT_LIST = '/screen/material/agreementInfo/getProjectList'
const URL_SCRAP_ANALYSIS = '/screen/base/largeScreen/home/getScrapAnalysisByMonth/details'
const URL_TOTAL_OWNERSHIP = '/screen/base/largeScreen/home/getTotalOwnership/details'
const URL_ACCEPTANCE_STORAGE = '/screen/base/largeScreen/home/getAcceptanceStorage/details'
// 设备类型
export const getTypeList = params => GET(URL_TYPE_LIST, params)
// 领料数据
export const getDetails = data => POST(URL_DETAILS, data)
// 退料数据
export const getReturnDetails = data => POST(URL_RETURN_DETAILS, data)
// 往来单位-下拉
export const getUnitList = params => GET(URL_UNIT_LIST, params)
// 工程名称-下拉
export const getProjectList = params => GET(URL_PROJECT_LIST, params)
// 废料分析
export const getScrapAnalysis = data => POST(URL_SCRAP_ANALYSIS, data)
// 总保有量
export const getTotalOwnership = data => POST(URL_TOTAL_OWNERSHIP, data)
// 入库分析
export const getAcceptanceStorage = data => POST(URL_ACCEPTANCE_STORAGE, data)

View File

@ -0,0 +1,118 @@
<template>
<div :class="{'hidden':hidden}" class="pagination-container">
<el-pagination
:background="background"
:current-page.sync="currentPage"
:page-size.sync="pageSize"
:layout="layout"
:page-sizes="pageSizes"
:pager-count="pagerCount"
:total="total"
v-bind="$attrs"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import { scrollTo } from '../../untils/scroll-to.js'
export default {
name: 'Pagination',
props: {
total: {
required: true,
type: Number
},
page: {
type: Number,
default: 1
},
limit: {
type: Number,
default: 20
},
pageSizes: {
type: Array,
default() {
return [10, 20, 30, 50]
}
},
// 5
pagerCount: {
type: Number,
default: document.body.clientWidth < 992 ? 5 : 7
},
layout: {
type: String,
default: 'total, sizes, prev, pager, next, jumper'
},
background: {
type: Boolean,
default: true
},
autoScroll: {
type: Boolean,
default: true
},
hidden: {
type: Boolean,
default: false
}
},
data() {
return {
};
},
computed: {
currentPage: {
get() {
return this.page
},
set(val) {
this.$emit('update:page', val)
}
},
pageSize: {
get() {
return this.limit
},
set(val) {
this.$emit('update:limit', val)
}
}
},
methods: {
handleSizeChange(val) {
if (this.currentPage * val > this.total) {
this.currentPage = 1
}
this.$emit('pagination', { page: this.currentPage, limit: val })
if (this.autoScroll) {
scrollTo(0, 800)
}
},
handleCurrentChange(val) {
this.$emit('pagination', { page: val, limit: this.pageSize })
if (this.autoScroll) {
scrollTo(0, 800)
}
}
}
}
</script>
<style scoped>
.pagination-container {
margin-top: 20px;
background: #fff;
/* padding: 32px 16px; */
display: flex;
justify-content: end;
align-items: center;
}
.pagination-container.hidden {
display: none;
}
</style>

View File

@ -6,15 +6,21 @@
</div>
<div id="accessRateEchartsCenterBar"></div>
</div>
<inputStoreAnalysisDialog ref="inputStoreAnalysisDialog" />
</div>
</template>
<script>
import { getAcceptanceStorageApi } from "../../api/screen";
import inputStoreAnalysisDialog from './inputStoreAnalysisDialog.vue'
import * as echarts from 'echarts';
export default {
name: 'accessRatePage',
components: {
inputStoreAnalysisDialog
},
data() {
return {
dataObj: {},
@ -301,7 +307,18 @@ export default {
}
let myCharts = echarts.init(document.querySelector('#accessRateEchartsCenterBar'));
myCharts.setOption(option)
}
myCharts.off('click')
myCharts.on('click', (params) => {
console.log('🚀 ~ myCharts.on ~ params:', params);
const data = {
open: true,
maType: this.maType,
startDate: params.name,
type: params.seriesName == '验收数量' ? 1 : 2,
}
this.$refs.inputStoreAnalysisDialog.setOpen(data)
})
},
}
}
</script>

View File

@ -17,7 +17,7 @@
<div class="box1-item_two">
<div>
<div class="box_header_div">
<div class="box_list" v-for="(item, index) of newArr" :key="index">
<div class="box_list" v-for="(item, index) of newArr" :key="index" @click="handleClickItem">
<div class="item-value">
{{ item.value }}
</div>
@ -28,14 +28,20 @@
</div>
</div>
</div>
<inventoryDialog ref="inventoryDialog" />
</div>
</template>
<script>
import GROUP from '../../assets/img/myImage/group.png';
import { getTotalOwnershipApi } from "../../api/screen";
import inventoryDialog from './inventoryDialog.vue'
export default {
components: {
inventoryDialog
},
data() {
return {
isUp: true,
@ -55,7 +61,8 @@ export default {
{ url: GROUP, name: '报废机具', value: 999 },
{ url: GROUP, name: '报废机具', value: 999 },
{ url: GROUP, name: '报废机具', value: 999 },
]
],
maType: 1
}
},
mounted() {
@ -66,7 +73,12 @@ export default {
setInterval(() => {
this.getTotalOwnershipApiPage()
}, 60 * 1000);
this.$eventBus.$on('maType', (maType) => {
this.maType = maType
});
},
destroyed() {
this.$eventBus.$off('maType');
},
methods: {
getTotalOwnershipApiPage() {
@ -103,6 +115,11 @@ export default {
this.$refs['box1'].style.height = 0
this.$refs['box1'].style.height = height
}
},
handleClickItem() {
setTimeout(() => {
this.$refs.inventoryDialog.setOpen({ open: true, maType: this.maType })
}, 10)
}
}
}

View File

@ -25,11 +25,17 @@
</div>
<div v-if="suffix" class="count-flop-unit">{{ suffix }}</div>
</div>
<getMaterialsDialog ref="materialsDialog"></getMaterialsDialog>
</div>
</template>
<script>
import getMaterialsDialog from './getMaterialsDialog.vue'
export default {
name: 'countFlop',
components: {
getMaterialsDialog
},
data() {
return {
value: [],
@ -47,6 +53,15 @@ export default {
mounted() {
this.value = this.val.toString().split("");
},
methods: {
handleClick(val) {
const params = {
open: true,
maType: val
}
this.$refs.materialsDialog.setOpen(params);
}
}
};
</script>
<style scoped lang="scss">

View File

@ -25,10 +25,17 @@
</div>
<div v-if="suffix" class="count-flop-unit">{{ suffix }}</div>
</div>
<returnMaterialsDialog ref="returnMaterialsDialog"></returnMaterialsDialog>
</div>
</template>
<script>
import returnMaterialsDialog from './returnMaterialsDialog'
export default {
components: {
returnMaterialsDialog
},
name: 'countFlop',
data() {
return {
@ -47,6 +54,15 @@ export default {
mounted() {
this.value = this.val.toString().split("");
},
methods: {
handleClick(val) {
const params = {
open: true,
maType: val
}
this.$refs.returnMaterialsDialog.setOpen(params);
}
}
};
</script>
<style scoped lang="scss">

View File

@ -0,0 +1,232 @@
<template>
<div>
<el-dialog
title=""
:visible.sync="open"
width="85%"
append-to-body
:close-on-click-modal="false"
>
<div class="content">
<el-form :model="formData" ref="form" label-width="80px" :inline="false" size="small" inline>
<el-form-item label="领料单号" size="small" prop="materialReqNo">
<el-input v-model="formData.materialReqNo" placeholder="请输入领料单号" size="small" clearable filterable></el-input>
</el-form-item>
<el-form-item label="单位名称" size="small" prop="materialReqUnitValue">
<el-select v-model="formData.materialReqUnitValue" placeholder="请选择单位" size="small" clearable filterable @change="handleUnit">
<el-option
v-for="item in formData.materialReqUnitList"
:key="item.unitId"
:label="item.unitName"
:value="item.unitId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="工程名称" size="small" prop="materialReqProjectValue">
<el-select v-model="formData.materialReqProjectValue" placeholder="请选择工程名称" size="small" clearable filterable @change="handleProject">
<el-option
v-for="item in formData.materialReqProjectList"
:key="item.projectId"
:label="item.projectName"
:value="item.projectId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="设备类型" size="small" prop="materialReqTypeValue">
<el-select v-model="formData.materialReqTypeValue" placeholder="请选择设备类型" size="small" clearable filterable @change="handleType">
<el-option v-for="item in formData.materialReqTypeList"
:key="item.typeId"
:label="item.typeName"
:value="item.typeId">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleSearch">查询</el-button>
<el-button icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-table :data="tableData" style="width: 100%">
<el-table-column
v-for="item in tableColumn"
:prop="item.prop"
:label="item.label"
:width="item.width"
:key="item.prop"
:align="item.align"
:type="item.type"
show-overflow-tooltip
>
</el-table-column>
</el-table>
<Pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="open = false"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Pagination from '../Pagination/index.vue'
import { getTypeList, getDetails, getUnitList, getProjectList } from '../../api/dialog'
export default {
name: 'getMaterialsDialog',
components: {
Pagination
},
data() {
return {
open: false,
material: false, //
formData: {
materialReqNo: '',
materialReqUnitValue: '',
materialReqProjectValue: '',
materialReqTypeValue: '',
materialReqUnitList: [],
materialReqProjectList: [],
materialReqTypeList: [],
},
tableData: [],
tableColumn: [
{
label: '序号',
type: 'index',
width: 60,
align: 'center'
},
{
label: '出库时间',
prop: 'materialTime',
align: 'center'
},
{
label: '设备类型',
prop: 'typeName',
align: 'center'
},
{
label: '规格型号',
prop: 'typeModelName',
align: 'center'
},
{
label: '出库数量',
prop: 'num',
align: 'center'
},
{
label: '设备负责人',
prop: 'userName',
align: 'center'
},
{
label: '领料单号',
prop: 'materialCode',
align: 'center'
},
{
label: '领料申请单位',
prop: 'unitName',
align: 'center'
},
{
label: '领料申请工程',
prop: 'projectName',
align: 'center'
}
],
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10
},
maType: 1
};
},
created() {
this.getUnit()
this.getProject()
this.getType()
},
methods: {
setOpen(params) {
this.open = params.open,
this.maType = params.maType,
this.tableData = []
this.total = 0
setTimeout(() => {
this.$refs.form.resetFields()
this.getList()
}, 100)
},
getList() {
const params = {
pageNum: this.queryParams.pageNum,
pageSize: this.queryParams.pageSize,
maType: this.maType,
materialCode: this.formData.materialReqNo.trim(),
unitId: this.formData.materialReqUnitValue,
projectId: this.formData.materialReqProjectValue,
typeId: this.formData.materialReqTypeValue
}
getDetails(params).then(({data}) => {
this.tableData = data.rows
this.total = data.total
})
},
getUnit() {
getUnitList().then(res => {
this.formData.materialReqUnitList = res.data
})
},
handleUnit(val) {
this.formData.materialReqUnitValue = val
},
getProject() {
getProjectList().then(res => {
this.formData.materialReqProjectList = res.data
})
},
handleProject(val) {
this.formData.materialReqProjectValue = val
},
getType() {
getTypeList({ level: '3' }).then(res => {
this.formData.materialReqTypeList = res.data
})
},
handleType(val) {
this.formData.materialReqTypeValue = val
},
handleSearch() {
this.queryParams.pageNum = 1
this.getList()
},
handleReset() {
this.$refs.form.resetFields()
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.content{
padding: 20px;
}
</style>

View File

@ -0,0 +1,173 @@
<template>
<div>
<el-dialog
title=""
:visible.sync="open"
width="85%"
append-to-body
:close-on-click-modal="false"
>
<div class="content">
<el-form :model="formData" ref="form" label-width="80px" :inline="false" size="small" inline>
<el-form-item label="设备类型" size="small" prop="materialReqTypeValue">
<el-select v-model="formData.materialReqTypeValue" placeholder="请选择设备类型" size="small" clearable filterable @change="handleType">
<el-option v-for="item in formData.materialReqTypeList"
:key="item.typeId"
:label="item.typeName"
:value="item.typeId">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleSearch">查询</el-button>
<el-button icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-table :data="tableData" style="width: 100%">
<el-table-column
v-for="item in tableColumn"
:prop="item.prop"
:label="item.label"
:width="item.width"
:key="item.prop"
:align="item.align"
:type="item.type"
show-overflow-tooltip
>
</el-table-column>
</el-table>
<Pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="open = false"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Pagination from '../Pagination/index.vue'
import { getTypeList, getAcceptanceStorage } from '../../api/dialog'
export default {
name: 'inputStoreAnalysisDialog',
components: {
Pagination
},
data() {
return {
open: false,
formData: {
materialReqTypeValue: '',
materialReqTypeList: [],
},
tableData: [],
tableColumn: [
{
label: '序号',
type: 'index',
width: 60,
align: 'center'
},
{
label: '设备类型',
prop: 'typeName',
align: 'center'
},
{
label: '规格型号',
prop: 'typeModelName',
align: 'center'
},
{
label: '采购数量',
prop: 'purchaseNum',
align: 'center'
},
{
label: '验收数量',
prop: 'checkNum',
align: 'center'
},
{
label: '入库数量',
prop: 'inputNum',
align: 'center'
}
],
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10
},
maType: 1,
startDate: '',
type: ''
};
},
created() {
this.getType()
},
methods: {
setOpen(params) {
this.open = params.open
this.maType = params.maType
this.tableData = []
this.total = 0
this.startDate = params.startDate
this.type = params.type
setTimeout(() => {
this.$refs.form.resetFields()
this.getList()
}, 10)
},
getList() {
const params = {
pageNum: this.queryParams.pageNum,
pageSize: this.queryParams.pageSize,
maType: this.maType,
typeId: this.formData.materialReqTypeValue,
startDate: this.startDate,
type: this.type
}
getAcceptanceStorage(params).then(({data}) => {
this.tableData = data.rows
this.total = data.total
})
},
getType() {
getTypeList({ level: '3' }).then(res => {
this.formData.materialReqTypeList = res.data
})
},
handleType(val) {
this.formData.materialReqTypeValue = val
},
handleSearch() {
this.queryParams.pageNum = 1
this.getList()
},
handleReset() {
this.$refs.form.resetFields()
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.content{
padding: 20px;
}
</style>

View File

@ -0,0 +1,187 @@
<template>
<div>
<el-dialog
title=""
:visible.sync="open"
width="85%"
append-to-body
:close-on-click-modal="false"
>
<div class="content">
<el-form :model="formData" ref="form" label-width="80px" :inline="false" size="small" inline>
<el-form-item label="设备类型" size="small" prop="materialReqTypeValue">
<el-select v-model="formData.materialReqTypeValue" placeholder="请选择设备类型" size="small" clearable filterable @change="handleType">
<el-option v-for="item in formData.materialReqTypeList"
:key="item.typeId"
:label="item.typeName"
:value="item.typeId">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleSearch">查询</el-button>
<el-button icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-table :data="tableData" style="width: 100%">
<el-table-column
v-for="item in tableColumn"
:prop="item.prop"
:label="item.label"
:width="item.width"
:key="item.prop"
:align="item.align"
:type="item.type"
show-overflow-tooltip
>
</el-table-column>
</el-table>
<Pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="open = false"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Pagination from '../Pagination/index.vue'
import { getTypeList, getTotalOwnership } from '../../api/dialog'
export default {
name: 'inventoryDialog',
components: {
Pagination
},
data() {
return {
open: false,
formData: {
materialReqTypeValue: '',
materialReqTypeList: [],
},
tableData: [],
tableColumn: [
{
label: '序号',
type: 'index',
width: 60,
align: 'center'
},
{
label: '设备类型',
prop: 'typeName',
align: 'center'
},
{
label: '规格型号',
prop: 'typeModelName',
align: 'center'
},
{
label: '单位',
prop: 'unitName',
align: 'center'
},
{
label: '在库数量',
prop: 'stockNum',
align: 'center'
},
{
label: '在用数量',
prop: 'useNum',
align: 'center'
},
{
label: '在修数量',
prop: 'inRepairNum',
align: 'center'
},
{
label: '修饰后待入库',
prop: 'inputNum',
align: 'center'
},
{
label: '新购待入库',
prop: 'purchaseNum',
align: 'center'
},
{
label: '总保有量',
prop: 'totalOwnershipNum',
align: 'center'
},
],
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10
},
maType: 1
};
},
created() {
this.getType()
},
methods: {
setOpen(params) {
this.open = params.open,
this.maType = params.maType,
this.tableData = []
this.total = 0
setTimeout(() => {
this.$refs.form.resetFields()
this.getList()
}, 10)
},
getList() {
const params = {
pageNum: this.queryParams.pageNum,
pageSize: this.queryParams.pageSize,
maType: this.maType,
typeId: this.formData.materialReqTypeValue
}
getTotalOwnership(params).then(({data}) => {
this.tableData = data.rows
this.total = data.total
})
},
getType() {
getTypeList({ level: '3' }).then(res => {
this.formData.materialReqTypeList = res.data
})
},
handleType(val) {
this.formData.materialReqTypeValue = val
},
handleSearch() {
this.queryParams.pageNum = 1
this.getList()
},
handleReset() {
this.$refs.form.resetFields()
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.content{
padding: 20px;
}
</style>

View File

@ -4,9 +4,11 @@
<div class="access-rate-box-title-bg">
<h5 class="access-rate-box-title">领料数据</h5>
</div>
<CountFlopOne :val="num" sonTitle="施工工具今日出库"></CountFlopOne>
<div class="access-rate-box-top">
<CountFlopOne :val="num2" sonTitle="工器具今日出库"></CountFlopOne>
<div @click="handleClick(1)">
<CountFlopOne :val="num" sonTitle="施工工具今日出库"></CountFlopOne>
</div>
<div class="access-rate-box-top" @click="handleClick(2)">
<CountFlopOne :val="num2" sonTitle="工器具今日出库" ref="countFlopOne"></CountFlopOne>
</div>
</div>
</div>
@ -52,6 +54,9 @@ export default {
} else {
return str.replace(/(\d{3})(?=\d)/g, '$1,'); //
}
},
handleClick(maType) {
this.$refs.countFlopOne.handleClick(maType)
}
}
}

View File

@ -4,7 +4,9 @@
<div class="access-rate-box-title-bg">
<h5 class="access-rate-box-title">当月报废分析</h5>
</div>
<div id="accessRateEcharts"></div>
<div id="accessRateEcharts" @click="handleClick">
<scrapAnalysisDialog ref="scrapAnalysisDialog" />
</div>
</div>
</div>
</template>
@ -13,11 +15,13 @@
import * as echarts from 'echarts';
import CountFlopOne from './countFlopOne.vue'
import { getScrapAnalysisByMonthApi } from "../../api/screen";
import scrapAnalysisDialog from './scrapAnalysisDialog.vue'
export default {
name: 'accessRatePage',
components: {
CountFlopOne
CountFlopOne,
scrapAnalysisDialog
},
data() {
return {
@ -230,6 +234,10 @@ export default {
}
let myCharts = echarts.init(document.querySelector('#accessRateEcharts'));
myCharts.setOption(echartOption)
},
handleClick() {
console.log('handleClick--报废分析')
this.$refs.scrapAnalysisDialog.setOpen({ open: true, maType: this.maType})
}
}
}

View File

@ -4,8 +4,10 @@
<div class="access-rate-box-title-bg">
<h5 class="access-rate-box-title">退料数据</h5>
</div>
<CountFlopTwo :val="num" sonTitle="施工机具今日退库"></CountFlopTwo>
<div class="access-rate-box-top">
<div @click="handleClick(1)">
<CountFlopTwo :val="num" sonTitle="施工机具今日退库" ref="countFlopOne"></CountFlopTwo>
</div>
<div class="access-rate-box-top" @click="handleClick(2)">
<CountFlopTwo :val="num2" sonTitle="工器具今日退料"></CountFlopTwo>
</div>
</div>
@ -51,6 +53,9 @@ export default {
this.num2 = this.formatNumber(res.data.num2)
}
})
},
handleClick(maType) {
this.$refs.countFlopOne.handleClick(maType)
}
}

View File

@ -0,0 +1,232 @@
<template>
<div>
<el-dialog
title=""
:visible.sync="open"
width="85%"
append-to-body
:close-on-click-modal="false"
>
<div class="content">
<el-form :model="formData" ref="form" label-width="80px" :inline="false" size="small" inline>
<el-form-item label="退料单号" size="small" prop="materialReqNo">
<el-input v-model="formData.materialReqNo" placeholder="请输入退料单号" size="small" clearable filterable></el-input>
</el-form-item>
<el-form-item label="单位名称" size="small" prop="materialReqUnitValue">
<el-select v-model="formData.materialReqUnitValue" placeholder="请选择单位" size="small" clearable filterable @change="handleUnit">
<el-option
v-for="item in formData.materialReqUnitList"
:key="item.unitId"
:label="item.unitName"
:value="item.unitId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="工程名称" size="small" prop="materialReqProjectValue">
<el-select v-model="formData.materialReqProjectValue" placeholder="请选择工程名称" size="small" clearable filterable @change="handleProject">
<el-option
v-for="item in formData.materialReqProjectList"
:key="item.projectId"
:label="item.projectName"
:value="item.projectId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="设备类型" size="small" prop="materialReqTypeValue">
<el-select v-model="formData.materialReqTypeValue" placeholder="请选择设备类型" size="small" clearable filterable @change="handleType">
<el-option v-for="item in formData.materialReqTypeList"
:key="item.typeId"
:label="item.typeName"
:value="item.typeId">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleSearch">查询</el-button>
<el-button icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-table :data="tableData" style="width: 100%">
<el-table-column
v-for="item in tableColumn"
:prop="item.prop"
:label="item.label"
:width="item.width"
:key="item.prop"
:align="item.align"
:type="item.type"
show-overflow-tooltip
>
</el-table-column>
</el-table>
<Pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="open = false"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Pagination from '../Pagination/index.vue'
import { getTypeList, getReturnDetails, getUnitList, getProjectList } from '../../api/dialog'
export default {
name: 'returnMaterialsDialog',
components: {
Pagination
},
data() {
return {
open: false,
material: false, //
formData: {
materialReqNo: '',
materialReqUnitValue: '',
materialReqProjectValue: '',
materialReqTypeValue: '',
materialReqUnitList: [],
materialReqProjectList: [],
materialReqTypeList: [],
},
tableData: [],
tableColumn: [
{
label: '序号',
type: 'index',
width: 60,
align: 'center'
},
{
label: '退料时间',
prop: 'materialTime',
align: 'center'
},
{
label: '退料单号',
prop: 'materialCode',
align: 'center'
},
{
label: '退料单位',
prop: 'unitName',
align: 'center'
},
{
label: '退料工程',
prop: 'projectName',
align: 'center'
},
{
label: '设备类型',
prop: 'typeName',
align: 'center'
},
{
label: '规格型号',
prop: 'typeModelName',
align: 'center'
},
{
label: '退料数量',
prop: 'num',
align: 'center'
},
{
label: '退料状态',
prop: 'statusName',
align: 'center'
}
],
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10
},
maType: 1
};
},
created() {
this.getUnit()
this.getProject()
this.getType()
},
methods: {
setOpen(params) {
this.open = params.open,
this.maType = params.maType,
this.tableData = []
this.total = 0
setTimeout(() => {
this.$refs.form.resetFields()
this.getList()
}, 100)
},
getList() {
const params = {
pageNum: this.queryParams.pageNum,
pageSize: this.queryParams.pageSize,
maType: this.maType,
materialCode: this.formData.materialReqNo.trim(),
unitId: this.formData.materialReqUnitValue,
projectId: this.formData.materialReqProjectValue,
typeId: this.formData.materialReqTypeValue
}
getReturnDetails(params).then(({data}) => {
this.tableData = data.rows
this.total = data.total
})
},
getUnit() {
getUnitList().then(res => {
this.formData.materialReqUnitList = res.data
})
},
handleUnit(val) {
this.formData.materialReqUnitValue = val
},
getProject() {
getProjectList().then(res => {
this.formData.materialReqProjectList = res.data
})
},
handleProject(val) {
this.formData.materialReqProjectValue = val
},
getType() {
getTypeList({ level: '3' }).then(res => {
this.formData.materialReqTypeList = res.data
})
},
handleType(val) {
this.formData.materialReqTypeValue = val
},
handleSearch() {
this.queryParams.pageNum = 1
this.getList()
},
handleReset() {
this.$refs.form.resetFields()
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.content{
padding: 20px;
}
</style>

View File

@ -0,0 +1,249 @@
<template>
<div>
<el-dialog
title=""
:visible.sync="open"
width="85%"
append-to-body
:close-on-click-modal="false"
>
<div class="content">
<el-form :model="formData" ref="form" label-width="80px" :inline="false" size="small" inline>
<el-form-item label="报废单号" size="small" prop="scrapCode">
<el-input v-model="formData.scrapCode" placeholder="请输入领料单号" size="small" clearable filterable></el-input>
</el-form-item>
<el-form-item label="报废来源" size="small" prop="scrapSource">
<el-select v-model="formData.scrapSource" placeholder="请选择报废来源" size="small" clearable filterable @change="handleSource">
<el-option
v-for="item in formData.scrapSourceList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="处置状态" size="small" prop="scrapStatus">
<el-select v-model="formData.scrapStatus" placeholder="请选择处置状态" size="small" clearable filterable @change="handleStatus">
<el-option
v-for="item in formData.scrapStatusList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="设备类型" size="small" prop="materialReqTypeValue">
<el-select v-model="formData.materialReqTypeValue" placeholder="请选择设备类型" size="small" clearable filterable @change="handleType">
<el-option v-for="item in formData.materialReqTypeList"
:key="item.typeId"
:label="item.typeName"
:value="item.typeId">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleSearch">查询</el-button>
<el-button icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-table :data="tableData" style="width: 100%">
<el-table-column
v-for="item in tableColumn"
:prop="item.prop"
:label="item.label"
:width="item.width"
:key="item.prop"
:align="item.align"
:type="item.type"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="处置状态"
prop="statusName"
align="center"
>
<template slot-scope="scope">
<el-tag :type="tagType(scope.row.scrapStatus)">{{ scope.row.statusName }}</el-tag>
</template>
</el-table-column>
</el-table>
<Pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="open = false"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Pagination from '../Pagination/index.vue'
import { getTypeList, getScrapAnalysis } from '../../api/dialog'
export default {
name: 'getMaterialsDialog',
components: {
Pagination
},
data() {
return {
open: false,
material: false, //
formData: {
scrapCode: '',
scrapSource: '',
scrapStatus: '',
materialReqTypeValue: '',
scrapSourceList: [
// 1,退 2, 3,
{ value: 1, label: '退料报废' },
{ value: 2, label: '维修报废' },
{ value: 3, label: '盘点报废' }
],
scrapStatusList: [
// 01234
{ value: 0, label: '进行中' },
{ value: 1, label: '已审核' },
{ value: 2, label: '驳回' },
{ value: 3, label: '待处置' },
{ value: 4, label: '已处置' }
],
materialReqTypeList: [],
},
tableData: [],
tableColumn: [
{
label: '序号',
type: 'index',
width: 60,
align: 'center'
},
{
label: '报废单号',
prop: 'scrapCode',
align: 'center'
},
{
label: '报废来源',
prop: 'scrapSourceName',
align: 'center'
},
{
label: '报废时间',
prop: 'scrapTime',
align: 'center'
},
{
label: '设备类型',
prop: 'typeName',
align: 'center'
},
{
label: '规格型号',
prop: 'typeModelName',
align: 'center'
},
{
label: '报废数量',
prop: 'scrapNum',
align: 'center'
},
],
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10
},
maType: 1,
tagType: (status) => {
switch (status) {
case '0':
return 'primary'
case '1':
return 'success'
case '2':
return 'danger'
case '3':
return 'warning'
case '4':
return 'info'
default:
return 'primary'
}
}
};
},
created() {
this.getType()
},
methods: {
setOpen(params) {
this.open = params.open,
this.maType = params.maType,
this.tableData = []
this.total = 0
setTimeout(() => {
this.$refs.form.resetFields()
this.getList()
}, 100)
},
getList() {
const params = {
pageNum: this.queryParams.pageNum,
pageSize: this.queryParams.pageSize,
scrapCode: this.formData.scrapCode.trim(),
scrapSource: this.formData.scrapSource,
scrapStatus: this.formData.scrapStatus,
typeId: this.formData.materialReqTypeValue,
maType: this.maType
}
getScrapAnalysis(params).then(({data}) => {
this.tableData = data.rows
this.total = data.total
})
},
handleSource(val) {
this.formData.scrapSource = val
},
handleStatus(val) {
this.formData.scrapStatus = val
},
getType() {
getTypeList({ level: '3' }).then(res => {
this.formData.materialReqTypeList = res.data
})
},
handleType(val) {
this.formData.materialReqTypeValue = val
},
handleSearch() {
this.queryParams.pageNum = 1
this.getList()
},
handleReset() {
this.$refs.form.resetFields()
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.content{
padding: 20px;
}
</style>

View File

@ -0,0 +1,58 @@
Math.easeInOutQuad = function(t, b, c, d) {
t /= d / 2
if (t < 1) {
return c / 2 * t * t + b
}
t--
return -c / 2 * (t * (t - 2) - 1) + b
}
// requestAnimationFrame for Smart Animating http://goo.gl/sx5sts
var requestAnimFrame = (function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) }
})()
/**
* Because it's so fucking difficult to detect the scrolling element, just move them all
* @param {number} amount
*/
function move(amount) {
document.documentElement.scrollTop = amount
document.body.parentNode.scrollTop = amount
document.body.scrollTop = amount
}
function position() {
return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop
}
/**
* @param {number} to
* @param {number} duration
* @param {Function} callback
*/
export function scrollTo(to, duration, callback) {
const start = position()
const change = to - start
const increment = 20
let currentTime = 0
duration = (typeof (duration) === 'undefined') ? 500 : duration
var animateScroll = function() {
// increment the time
currentTime += increment
// find the value with the quadratic in-out easing function
var val = Math.easeInOutQuad(currentTime, start, change, duration)
// move the document.body
move(val)
// do the animation unless its over
if (currentTime < duration) {
requestAnimFrame(animateScroll)
} else {
if (callback && typeof (callback) === 'function') {
// the animation is done so lets callback
callback()
}
}
}
animateScroll()
}

View File

@ -187,8 +187,7 @@ export default {
const seconds = date.getSeconds().toString().padStart(2, '0')
const dateTimeString = `${year}/${month}/${day} ${weekday} ${hours}:${minutes}:${seconds}`
this.dateTimeString = dateTimeString
}
},
}
}
</script>