Commit 963e445d by T

报表、页面调整及bug修复

parent a1e21668
......@@ -4,7 +4,9 @@ import { transform } from '@/utils/index'
// 添加或修改警员信息
export function addOrUpdatePoliceman(data) {
return request({
url: window._CONFIG['serviceURL'] + '/api/Policeman/AddOrUpdatePoliceman',
//url: window._CONFIG['serviceURL'] + '/api/Policeman/AddOrUpdatePoliceman',
//区分第三方的接口,下面接口自己用
url: window._CONFIG['serviceURL'] + '/api/Policeman/AddOrUpdatePolicemanFromHost',
method: 'post',
data: transform(data)
})
......
import Vue from 'vue';
export default new Vue();
\ No newline at end of file
......@@ -42,13 +42,13 @@
{{ item.label }}
</el-checkbox>
</el-popover>
<el-select v-model="query.isCurrentLevel" clearable placeholder="是否本级" class="filter-item" style="width: 160px" @change="toPostQuery">
<el-option v-for="item in levelOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
<el-input v-model="query.value" clearable placeholder="柜号" style="width: 200px;" class="filter-item" @keyup.enter.native="toPostQuery"/>
<!-- <el-select v-model="query.state" clearable placeholder="状态" class="filter-item" style="width: 90px" @change="toPostQuery">
<el-option v-for="item in stateOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select> -->
<el-select v-model="query.isCurrentLevel" clearable placeholder="是否本级" class="filter-item" style="width: 160px" @change="toPostQuery">
<el-option v-for="item in levelOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
<el-button class="filter-item" type="success" icon="el-icon-search" @click="toPostQuery">搜索</el-button>
<el-button class="filter-item" type="primary" icon="el-icon-plus" @click="add">新增</el-button>
</div>
......@@ -135,6 +135,7 @@ export default {
filterText: '',
selection: '',
organizationId: '',
query:{isCurrentLevel:true},
columns: [],
allColumnsSelected: true,
allColumnsSelectedIndeterminate: false,
......
......@@ -2,7 +2,7 @@
<el-card style="height:350px">
<div slot="header" class="clearfix">
<span>{{radio}}</span>
<el-radio-group v-model="radio" size="small" @change="radioChange" style="float: right;margin-top:-7px;margin-bottom:-10px;">
<el-radio-group v-model="radio" size="small" @change="radioChange" :disabled="!canClick" style="float: right;margin-top:-7px;margin-bottom:-10px;">
<el-radio-button label="使用次数"></el-radio-button>
<el-radio-button label="维修次数"></el-radio-button>
<el-radio-button label="报废数"></el-radio-button>
......@@ -13,10 +13,11 @@
<v-axis />
<v-bar position="year*sales" />
</v-chart> -->
<v-chart :forceFit="true" :height="300" :data="chartData" style="margin-left: -50px">
<v-chart :forceFit="true" :height="300" :data="chartData" style="margin-left: -50px" v-if="dom">
<v-tooltip />
<v-axis data-key='维修次数' :line="line" :label="label" />
<v-axis data-key='报废次数' :line="line" :label="label" />
<!-- <v-axis data-key='维修次数' :line="line" :label="label" v-if="dom"/>
<v-axis data-key='报废次数' :line="line" :label="label" v-if="dom"/> -->
<v-axis />
<v-legend />
<v-bar :position="position" color="parentName" :adjust="adjust" />
</v-chart>
......@@ -48,9 +49,11 @@ export default {
type: 'dodge',
marginRatio: 1 / 32,
}],
dom:true,
canClick: true,
chartData: [],
line,
label,
//label,
position: '装备类型*使用量'
}
},
......@@ -90,9 +93,14 @@ export default {
})
},
radioChange(value) {
this.dom=false
//防点,不然请求未返回结果会出现渲染显示问题
this.canClick = false;
if (value == '使用次数') {
this.dom=false
getSyPOrg({orgId: this.orgId}).then(res => {
if (res.code == "10000") {
this.dom=true
this.dataSource = res.data
let dv = new DataSet.View().source(this.dataSource)
dv.transform({
......@@ -106,10 +114,13 @@ export default {
} else {
this.$message.error(res.msg)
}
this.canClick = true;
})
} else if (value == '维修次数') {
}
else if (value == '维修次数') {
getWxPOrg({orgId: this.orgId}).then(res => {
if (res.code == "10000") {
this.dom=true
this.dataSource = res.data
let dv = new DataSet.View().source(this.dataSource)
dv.transform({
......@@ -123,16 +134,18 @@ export default {
} else {
this.$message.error(res.msg)
}
this.canClick = true;
})
}
else if (value == '报废数') {
getBfPOrg({orgId: this.orgId}).then(res => {
if (res.code == "10000") {
this.dom=true
this.dataSource = res.data
let dv = new DataSet.View().source(this.dataSource)
dv.transform({
type: 'fold',
fields: ['近三个月报废数', '近半年使报废数'],
fields: ['近三个月报废数', '近半年报废数'],
key: '装备类型',
value: '报废次数',
});
......@@ -141,6 +154,7 @@ export default {
} else {
this.$message.error(res.msg)
}
this.canClick = true;
})
}
}
......
......@@ -10,7 +10,7 @@
</div>
<v-chart :forceFit="true" :height="300" :data="chartData" style="margin-left: -50px">
<v-tooltip />
<v-axis data-key='维修次数' :line="line" :label="label" />
<v-axis data-key='维修次数' :line="line" :label="label" :lineStyle="{stroke: 'red'}" :v-style="style"/>
<v-axis data-key='报废次数' :line="line" :label="label" />
<v-legend />
<v-line :position="position" color="parentName" />
......
<template>
<el-card style="height:350px">
<div slot="header" class="clearfix">
<span>{{radio}}</span>
<el-radio-group v-model="radio" size="small" @change="radioChange" style="float: right;margin-top:-7px;margin-bottom:-10px;">
<el-radio-button label="使用次数"></el-radio-button>
<el-radio-button label="维修次数"></el-radio-button>
<el-radio-button label="报废数"></el-radio-button>
</el-radio-group>
</div>
<!-- <v-chart :forceFit="true" :height="height" :data="chartData" :scale="scale">
<v-tooltip />
<v-axis />
<v-bar position="year*sales" />
</v-chart> -->
<v-chart :forceFit="true" :height="300" :data="chartData" style="margin-left: -50px">
<v-tooltip />
<v-axis data-key='维修次数' :line="line" :label="label" />
<v-axis data-key='报废次数' :line="line" :label="label" />
<v-legend />
<v-bar :position="position" color="parentName" :adjust="adjust" />
</v-chart>
</el-card>
</template>
<script>
import { getSyPOrg } from '@/api/view'
import { getWxPOrg } from '@/api/view'
import { getBfPOrg } from '@/api/view'
import DataSet from '@antv/data-set'
export default {
data() {
const label = {
offset: -620,
textStyle: {
textAlign: 'left',
}
}
const line = {
textAlign: 'left'
}
return {
orgId: this.$store.state.user.user.baseJpOrganization.id,
radio: '使用次数',
dataSource: [],
adjust: [{
type: 'dodge',
marginRatio: 1 / 32,
}],
chartData: [],
line,
label,
position: '装备类型*使用量'
}
},
computed: {
// chartData() {
// let dv = new DataSet.View().source(this.dataSource)
// dv.transform({
// type: 'fold',
// fields: ['近七天使用次数', '近三十天使用次数'],
// key: '装备类型',
// value: '使用量',
// });
// return dv.rows
// },
},
mounted() {
this.init()
},
methods: {
init(orgId) {
this.orgId = orgId || this.$store.state.user.user.baseJpOrganization.id
getSyPOrg({orgId: this.orgId}).then(res => {
if (res.code == "10000") {
console.log(res.data)
let a =[
{parentName: "指挥信通装备", 近七天使用次数: 0, 近三十天使用次数: 0},
{parentName: "刑事技术装备", 近七天使用次数: 0, 近三十天使用次数: 0},
{parentName: "侦查技术装备", 近七天使用次数: 0, 近三十天使用次数: 0},
{parentName: "武器警械", 近七天使用次数: 0, 近三十天使用次数: 0},
{parentName: "防护装备", 近七天使用次数: 0, 近三十天使用次数: 0},
{parentName: "警用车辆及船艇", 近七天使用次数: 0, 近三十天使用次数: 0},
{parentName: "反恐救援装备", 近七天使用次数: 0, 近三十天使用次数: 0},
{parentName: "警用航空装备", 近七天使用次数: 0, 近三十天使用次数: 0},
{parentName: "其他装备", 近七天使用次数: 0, 近三十天使用次数: 0},
]
this.dataSource = a
let dv = new DataSet.View().source(this.dataSource)
dv.transform({
type: 'fold',
fields: ['近七天使用次数', '近三十天使用次数'],
key: '装备类型',
value: '使用量',
});
this.chartData = dv
this.position = '装备类型*使用量'
} else {
this.$message.error(res.msg)
}
})
},
radioChange(data) {
// 清空数据
// this.dataSource = [];
// this.chartData = [];
if (data == '使用次数') {
getSyPOrg({orgId: this.orgId}).then(res => {
if (res.code == "10000") {
let a=[
{parentName: "指挥信通装备", 近七天使用次数: 0, 近三十天使用次数: 0},
{parentName: "刑事技术装备", 近七天使用次数: 0, 近三十天使用次数: 0},
{parentName: "侦查技术装备", 近七天使用次数: 0, 近三十天使用次数: 0},
{parentName: "武器警械", 近七天使用次数: 0, 近三十天使用次数: 0},
{parentName: "防护装备", 近七天使用次数: 0, 近三十天使用次数: 0},
{parentName: "警用车辆及船艇", 近七天使用次数: 0, 近三十天使用次数: 0},
{parentName: "反恐救援装备", 近七天使用次数: 0, 近三十天使用次数: 0},
{parentName: "警用航空装备", 近七天使用次数: 0, 近三十天使用次数: 0},
{parentName: "其他装备", 近七天使用次数: 0, 近三十天使用次数: 0},
]
this.dataSource = a
let dv = new DataSet.View().source(this.dataSource)
dv.transform({
type: 'fold',
fields: ['近七天使用次数', '近三十天使用次数'],
key: '装备类型',
value: '使用量',
});
this.chartData = dv
this.position = '装备类型*使用量'
} else {
this.$message.error(res.msg)
}
})
} else if (data == '维修次数') {
getWxPOrg({orgId: this.orgId}).then(res => {
if (res.code == "10000") {
let a=[
{parentName: "指挥信通装备", 近三个月维修次数: 0, 近半年维修次数: 0},
{parentName: "刑事技术装备", 近三个月维修次数: 0, 近半年维修次数: 0},
{parentName: "侦查技术装备", 近三个月维修次数: 0, 近半年维修次数: 0},
{parentName: "武器警械", 近三个月维修次数: 0, 近半年维修次数: 0},
{parentName: "防护装备", 近三个月维修次数: 0, 近半年维修次数: 0},
{parentName: "警用车辆及船艇", 近三个月维修次数: 0, 近半年维修次数: 0},
{parentName: "反恐救援装备", 近三个月维修次数: 0, 近半年维修次数: 0},
{parentName: "警用航空装备", 近三个月维修次数: 0, 近半年维修次数: 0},
{parentName: "其他装备", 近三个月维修次数: 0, 近半年维修次数: 0},
]
this.dataSource = a
let dv = new DataSet.View().source(this.dataSource)
dv.transform({
type: 'fold',
fields: ['近三个月维修次数', '近半年维修次数'],
key: '装备类型',
value: '维修次数',
});
this.chartData = dv
this.position = '装备类型*维修次数'
} else {
this.$message.error(res.msg)
}
})
}
else if (data == '报废数') {
getBfPOrg({orgId: this.orgId}).then(res => {
if (res.code == "10000") {
let a=[
{parentName: "指挥信通装备", 近三个月报废数: 0, 近半年报废数: 0},
{parentName: "刑事技术装备", 近三个月报废数: 0, 近半年报废数: 0},
{parentName: "侦查技术装备", 近三个月报废数: 0, 近半年报废数: 0},
{parentName: "武器警械", 近三个月报废数: 0, 近半年报废数: 0},
{parentName: "防护装备", 近三个月报废数: 0, 近半年报废数: 0},
{parentName: "警用车辆及船艇", 近三个月报废数: 0, 近半年报废数: 0},
{parentName: "反恐救援装备", 近三个月报废数: 0, 近半年报废数: 0},
{parentName: "警用航空装备", 近三个月报废数: 0, 近半年报废数: 0},
{parentName: "其他装备", 近三个月报废数: 0, 近半年报废数: 0},
]
this.dataSource = a
let dv = new DataSet.View().source(this.dataSource)
dv.transform({
type: 'fold',
fields: ['近三个月报废数', '近半年报废数'],
key: '装备类型',
value: '报废次数',
});
this.chartData = dv
this.position = '装备类型*报废次数'
} else {
this.$message.error(res.msg)
}
})
}
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/.el-card .el-card__header{
background:#ffffff;
color:#000000;
font-size: 16px;
}
</style>
\ No newline at end of file
......@@ -42,6 +42,9 @@
{{ item.label }}
</el-checkbox>
</el-popover>
<el-select v-model="query.level" clearable placeholder="是否本级" class="filter-item" style="width: 160px" @change="toPostQuery">
<el-option v-for="item in levelOptions" :key="item.key" :label="item.display_name" :value="item.display_name"/>
</el-select>
<el-input v-model="query.devName" clearable placeholder="设备名称" style="width: 200px;" class="filter-item" @keyup.enter.native="toPostQuery"/>
<el-input v-model="query.devCode" clearable placeholder="设备编号" style="width: 200px;" class="filter-item" @keyup.enter.native="toPostQuery"/>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toPostQuery">搜索</el-button>
......@@ -113,6 +116,7 @@ export default {
columns: [],
allColumnsSelected: true,
allColumnsSelectedIndeterminate: false,
query:{level:'本级'},
show: true,
tData: [],
defaultProps:{
......@@ -123,6 +127,10 @@ export default {
{ key: 1, display_name: '启用' },
{ key: 0, display_name: '禁用' }
],
levelOptions: [
{ key: true, display_name: '本级' },
{ key: false, display_name: '全部' }
],
delLoading: false
}
},
......@@ -155,12 +163,14 @@ export default {
checkPermission,
beforeInit() {
this.url = window._CONFIG['serviceURL'] + '/api/WarehouseDev/GetPageDev'
this.params = { page: this.page, size: this.size, orgId: this.orgId || this.$store.state.user.user.baseJpOrganization.id }
this.params = { page: this.page, size: this.size, orgId: this.orgId || this.$store.state.user.user.baseJpOrganization.id }
const query = this.query
const devName = query.devName
const devCode = query.devCode
const level = query.level
if (devName) { this.params['devName'] = devName }
if (devCode) { this.params['devCode'] = devCode }
if (level) { this.params['level'] = level }
return true
},
initTree() {
......
......@@ -278,6 +278,7 @@ export default {
},
cancel() {
this.resetForm()
this.$parent.initPost()
},
doSubmit() {
this.$refs['form'].validate((valid) => {
......
......@@ -174,13 +174,24 @@ export default {
var backMessObj = JSON.parse(e.data);
if(backMessObj.CmdType == 2) {
getWzByEpc({epc : backMessObj.Content}).then(res => {
if (res.code === "10000") {
if (res.code === "10000"){
if (!this.epsList.includes(backMessObj.Content)) {
if (res.data.warehouseId == this.form.warehouseId || res.data.warehouseId == null || res.data.warehouseId == '') {
if(res.data.orgId == this.$store.state.user.user.baseJpOrganization.id) {
if (res.data.warehouseId == this.form.warehouseId || res.data.warehouseId == null || res.data.warehouseId == '') {
this.epsList.unshift(backMessObj.Content)
this.handleAdd(res.data)
}
}else{
this.$message.warning('组织机构不匹配')
}
if (res.data.warehouseId == this.form.warehouseId) {
this.epsList.unshift(backMessObj.Content)
this.handleAdd(res.data)
}
}
}else{
this.$message.warning(res.msg)
}
})
} else if(![0,1,2,5].includes(backMessObj.CmdType)) {
......@@ -230,11 +241,17 @@ export default {
getWzByEpc({epc : this.eqEpc}).then(res => {
if(res.code === "10000"){
if (!this.epsList.includes(this.eqEpc)) {
if (res.data.warehouseId == this.form.warehouseId) {
// if (res.data.warehouseId == this.form.warehouseId) {
// this.epsList.push(this.eqEpc)
// this.handleAdd(res.data)
// }
if (res.data.orgId == this.$store.state.user.user.baseJpOrganization.id ) {
this.epsList.push(this.eqEpc)
this.handleAdd(res.data)
} else {
this.$message.warning('组织机构不匹配')
}
}
}
} else {
this.$message.warning(res.msg)
}
......@@ -248,6 +265,7 @@ export default {
},
cancel() {
this.resetForm()
this.$parent.initPost()
},
doSubmit() {
this.form.orgCode = this.$store.state.user.user.baseJpOrganization.code.substring(0,6)
......
......@@ -175,11 +175,22 @@ export default {
getWzByEpc({epc : backMessObj.Content}).then(res => {
if (res.code === "10000"){
if (!this.epsList.includes(backMessObj.Content)) {
if (res.data.warehouseId == this.form.warehouseId || res.data.warehouseId == null || res.data.warehouseId == '') {
if(res.data.orgId == this.$store.state.user.user.baseJpOrganization.id) {
if (res.data.warehouseId == this.form.warehouseId || res.data.warehouseId == null || res.data.warehouseId == '') {
this.epsList.unshift(backMessObj.Content)
this.handleAdd(res.data)
}
}else{
this.$message.warning('组织机构不匹配')
}
if (res.data.warehouseId == this.form.warehouseId) {
this.epsList.unshift(backMessObj.Content)
this.handleAdd(res.data)
}
}
}else{
this.$message.warning(res.msg)
}
})
}else if (![0,1,2,5].includes(backMessObj.CmdType)){
......@@ -231,9 +242,15 @@ export default {
getWzByEpc({epc : this.eqEpc}).then(res => {
if(res.code === "10000"){
if (!this.epsList.includes(this.eqEpc)) {
if (res.data.warehouseId == this.form.warehouseId) {
// if (res.data.warehouseId == this.form.warehouseId) {
// this.epsList.push(this.eqEpc)
// this.handleAdd(res.data)
// }
if (res.data.orgId == this.$store.state.user.user.baseJpOrganization.id ) {
this.epsList.push(this.eqEpc)
this.handleAdd(res.data)
} else {
this.$message.warning('组织机构不匹配')
}
}
} else {
......@@ -248,6 +265,7 @@ export default {
},
cancel() {
this.resetForm()
this.$parent.initPost()
},
doSubmit() {
this.form.orgCode = this.$store.state.user.user.baseJpOrganization.code.substring(0,6)
......
......@@ -203,6 +203,7 @@ export default {
})
},
handleConfirm() {
this.form.applyOrgId = this.form.targetOrgId
let form = { ...this.form, ...this.processForm }
if (!form.policeId) {
this.loading = false
......
......@@ -156,6 +156,8 @@ export default {
this.$refs.applyForm.initOrgTree()
this.$refs.applyForm.initPolicemanList()
this.$refs.applyForm.getProcess()
const _this = this.$refs.applyForm
_this.detailList = []
this.$refs.applyForm.dialog = true
},
edit(data) {
......
<template>
<div>
<!--表格渲染-->
<el-table ref="table" :data="data" border style="width: 94%;margin:auto;">
<el-table-column label="序号" align="center" width="50">
<template slot-scope="props">
{{ props.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="equipmentName" label="装备名称" align="center"/>
<el-table-column prop="sizeName" label="装备型号名称" align="center"/>
<el-table-column prop="warehouseName" label="仓库名称" width="160" align="center">
<template slot-scope="data">
{{ data.row.warehouseName || data.row.name+'单警柜' }}
</template>
</el-table-column>
<el-table-column prop="supplierName" label="供应商名称" width="180" align="center"/>
<!-- <el-table-column label="生产日期" align="center">
<template slot-scope="scope">
{{ parseTimes(scope.row.productTime) }}
</template>
</el-table-column> -->
<el-table-column :show-overflow-tooltip="true" prop="address" label="位置" align="center">
<template slot-scope="props">
<span v-if="[3,7].includes(props.row.currentState)"> {{props.row.cabinetNum}}-{{props.row.cabinetChildNum}}</span>
<span v-else> {{ props.row.shelfName ? props.row.shelfName + (props.row.range ? ('-' + props.row.range) : (props.row.column ? '-X' : (props.row.row ? '-X' : ''))) + (props.row.column ? ('-' + props.row.column) : (props.row.row ? '-X' : '')) + (props.row.row ? ('-' + props.row.row) : '') : '' }}</span>
</template>
</el-table-column>
<el-table-column label="安全等级" align="center" width="150px">
<template slot-scope="scope">
<el-tag v-if="scope.row.safeLevel == 0" type="success">质保期内</el-tag>
<el-tag v-else-if="scope.row.safeLevel == 1" type="warning">即将过期</el-tag>
<el-tag v-else-if="scope.row.safeLevel == 2" type="danger">已过质保期</el-tag>
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<el-tag v-if="[0,3].includes(scope.row.currentState)" type="success">在库</el-tag>
<el-tag v-else-if="[6].includes(scope.row.currentState)&& orgCode != '330200000000'" type="danger">已报废</el-tag>
<el-tag v-else-if="[6].includes(scope.row.currentState)&& orgCode == '330200000000'" type="danger">已销毁</el-tag>
<el-tag v-else type="warning">出库</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="150" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="show(scope.row.id)">查看</el-button>
<el-button size="mini" type="warning" :disabled="[6].includes(scope.row.currentState)" @click="edit(scope.row.id)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination style="margin-top: 8px;" layout="total, prev, pager, next" :total="total"
:page-size="5" :current-page="page + 1" @current-change="postPageChange"></el-pagination>
<!--表单组件-->
<eForm ref="form" />
<eqInformation ref="equipment" @ok="refresh"/>
</div>
</template>
<script>
import initData from '@/mixins/initData'
import { initPdata } from '@/api/data'
import { transform } from '@/utils/index'
import eForm from '@/views/warehouse/maintenance/form'
import eqInformation from '@/views/warehouse/maintenance/eqInformation'
import { getInfoByID } from '@/api/inventory'
import { parseTimes } from '@/utils/index'
export default {
name: 'EquipmentSize',
props: {
orgId: {
type: String
},
warehouseId: {
type: String
},
equipmentSizeId: {
type: String
},
shelfId: {
type: String
},
range: {
type: String
},
row: {
type: String
},
column: {
type: String
}
},
components: { eForm, eqInformation },
mixins: [initData],
data() {
return {
orgCode: this.$store.state.user.user.baseJpOrganization.code,
selection: '',
size: 5
}
},
created() {
this.initPost()
},
methods: {
parseTimes,
initPost() {
//var url = window._CONFIG['serviceURL'] + '/api/Inventory/GetListEquipmentByOrgSize'
var url = window._CONFIG['serviceURL'] + '/api/Inventory/GetListEquipmentByOrgSizeV2'
var params = { page: this.page, size: this.size, orgId: this.orgId || this.$store.state.user.user.baseJpOrganization.id,
warehouseId: this.warehouseId, equipmentSizeId: this.equipmentSizeId, shelfId: this.shelfId, range: this.range, row: this.row, column: this.column }
initPdata(url, transform(params)).then(res => {
if (res.code === '10000') {
this.total = res.data.totalElements
this.data = res.data.content
} else this.$message.error(res.msg)
})
},
show(id) {
const _this = this.$refs.form
getInfoByID({id: id}).then(res => {
if(res.code == '10000') {
_this.form = res.data
_this.stateList = res.data.stateList.slice(0, 3)
_this.total = res.data.stateList.length
} else {
this.$message.error(res.msg)
}
})
_this.dialog = true
},
async edit(id) {
const _this = this.$refs.equipment
await getInfoByID({id: id}).then(res => {
if(res.code == '10000') {
_this.initShelfList(res.data.warehouseCode)
_this.form = {
id: res.data.id,
epc: res.data.epc,
name: res.data.name,
warehouseName: res.data.warehouseName,
equipmentName: res.data.equipmentName,
sizeName: res.data.sizeName,
supplierName: res.data.supplierName,
currentState: res.data.currentState,
repairCycle: res.data.repairCycle,
price: res.data.price,
warrantyCycle: res.data.warrantyCycle,
useTime: res.data.useTime,
productTime: res.data.productTime,
shelfId: res.data.shelfId,
range: res.data.range,
row: res.data.row,
column: res.data.column
}
} else {
this.$message.error(res.msg)
}
})
_this.dialog = true
},
refresh() {
this.$emit('refresh')
}
}
}
</script>
<style scoped>
.dev-type-main-left {
overflow: auto;
padding: 10px;
}
.right-menu {
z-index: 1;
position: absolute;
height: 100px;
width: 100px;
position: absolute;
border-radius: 5px;
border: 1px solid #ccc;
background-color: white;
}
.menu-item {
line-height: 20px;
text-align: left;
margin-top: 10px;
font-size: 14px;
color: #606266;
}
li:hover {
background-color: #edf6ff;
color: #606266;
}
</style>
<style rel="stylesheet/scss" lang="scss" scoped>
.dashboard-editor-container {
padding: 7px 7px 7px 7px;
background-color: rgb(240, 242, 245);
.chart-wrapper {
background: #fff;
padding: 16px 16px 0;
height : 650px
}
}
</style>
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" ref="form" :visible.sync="dialog" :title="'查看装备库存状态'" width="1200px">
<!-- 搜索 -->
<div class="head-container">
<el-cascader v-model="id" :options="orgList"
:props="{ value: 'id', label: 'name', checkStrictly: true, emitPath: false }" filterable
class="filter-item" style="width: 300px;margin-left:0px" placeholder="请选择本级或下级的组织机构" @change="orgChange"/>
<el-select v-model="sizeId"
v-if="id!==''"
style="width:240px "
class="filter-item"
:filterable="true"
placeholder="请选择装备型号"
@change="orgChangeSizeFind">
<el-option v-for="item in equipmentSizeList" :key="item.id" :label="item.sizeName" :value="item.id"/>
</el-select>
<el-select v-model="sizeId"
v-if="id==''"
style="width:240px "
class="filter-item"
:filterable="true"
placeholder="请选择装备型号"
@change="orgChangeSizeFind2">
<el-option v-for="item in equipmentSizeList" :key="item.id" :label="item.sizeName" :value="item.id"/>
</el-select>
<el-button type="warning" @click="clearSelected" class="filter-item" size="small" style="margin-left:5px">重置</el-button>
</div>
<!--表格渲染-->
<el-table ref="table" v-loading="loading" :row-key="getRowKeys" :data="data" style="width: 100%;" stripe border>
<el-table ref="table" v-loading="loading" :row-key="getRowKeys" :data="data" style="width: 100%;" max-height="530" stripe border>
<el-table-column type="expand" width="50">
<template slot-scope="props">
<detail-form :orgId="props.row.orgId" :warehouseId="props.row.warehouseCode" :equipmentSizeId="props.row.equipmentSizecode"/>
</template>
</el-table-column>
<el-table-column type="index" label="序号" width="50" align="center"/>
<el-table-column prop="warehouseName" label="仓库名称" align="center"/>
<el-table-column prop="equipmentName" label="装备名称" align="center"/>
<el-table-column prop="sizeName" label="装备型号名称" align="center"/>
<el-table-column prop="orgName" label="组织机构名称" width="300" align="center"/>
<el-table-column prop="zsCount" label="装备总数" align="center"/>
<el-table-column prop="zkCount" label="在库数" align="center"/>
<el-table-column prop="ckCount" label="出库数" align="center"/>
......@@ -26,7 +51,9 @@
</template>
<script>
import detailForm from '@/views/warehouse/stock/detail'
import { getListOrg, getOrgById } from '@/api/org'
import { getListEquipmentSize } from '@/api/equipmentSize'
import detailForm from './detail'
import { initData, initPdata, initGdata } from '@/api/data'
import { transform } from '@/utils/index'
export default {
......@@ -35,22 +62,112 @@ export default {
},
data() {
return {
//orgId: this.$store.state.user.user.baseJpOrganization.id,
orgCode: this.$store.state.user.user.baseJpOrganization.code,
dialog:false,
data: [],
orgList: [],
id:'',
orgId:'',
findCode:'',
equipmentId:'',
equipmentSizeList:[],
selected: [],
sizeId:'',
loading: true,
url: '',
params: {}
}
},
methods: {
initTable(equipmentId, findCode, orgCode, code) {
initTable(equipmentId, findCode, orgCode, code, orgId) {
this.equipmentId = equipmentId
this.findCode= findCode
this.orgId = orgId
this.url = window._CONFIG['serviceURL'] + '/api/Inventory/GetListEquByFindCode'
this.params = { findCode: findCode, equipmentId: equipmentId, orgCode: orgCode.substring(6,8) === '00' ? (orgCode === code ? orgCode: '') : orgCode } // 先判断是不是 派出所还是上级,派出所直接传orgCode,上级会包含本级及下级的,相等的话传本级
this.initPost()
this.initOrgList()
getListEquipmentSize({detailId : this.equipmentId}).then(res => {
this.equipmentSizeList = res.data
//号型重新排序
// let newData = res.data.sort(function(x, y) {
// return x.sizeName.localeCompare(y.sizeName);
// });
// this.equipmentSizeList = newData
})
},
orgChange(id) {
getOrgById({id:id}).then(res => {
this.orgName = res.data.name
this.orgId = res.data.id
this.initPost2()
})
},
clearSelected() {
this.id = '';
this.sizeId ='';
this.initPost();
console.log(1111111)
},
async initPost2() {
return new Promise((resolve, reject) => {
this.loading = true
initPdata(this.url, transform({findCode: this.findCode, equipmentId: this.equipmentId, sizeId: this.sizeId, orgId: this.orgId})).then(res => {
if (res.code === '10000') {
this.data = res.data
//按号型重新排序
// let newData = res.data.sort(function(x, y) {
// return x.sizeName.localeCompare(y.sizeName);
// });
// this.data = newData
// console.log(this.data)
setTimeout(() => {
this.loading = false
}, this.time)
resolve(res)
} else this.$message.error(res.msg)
}).catch(err => {
this.loading = false
reject(err)
})
})
},
orgChangeSizeFind(){
this.findCode=this.findCode,
this.initPost2()
},
orgChangeSizeFind2(sizeId){
this.sizeId =sizeId
this.findCode=this.findCode,
this.initPost3()
//console.log('2222')
},
async initPost3() {
return new Promise((resolve, reject) => {
this.loading = true
initPdata(this.url, transform({findCode: this.findCode, equipmentId: this.equipmentId, sizeId: this.sizeId})).then(res => {
if (res.code === '10000') {
this.data = res.data
//按号型重新排序
// let newData = res.data.sort(function(x, y) {
// return x.sizeName.localeCompare(y.sizeName);
// });
// this.data = newData
//console.log(this.data)
setTimeout(() => {
this.loading = false
}, this.time)
resolve(res)
} else this.$message.error(res.msg)
}).catch(err => {
this.loading = false
reject(err)
})
})
},
getRowKeys(row) {
return row.equipmentCode + row.equipmentSizecode + row.warehouseCode
return row.equipmentCode + row.equipmentSizecode + row.warehouseCode + row.orgId
},
async initPost() {
return new Promise((resolve, reject) => {
......@@ -58,6 +175,12 @@ export default {
initPdata(this.url, transform(this.params)).then(res => {
if (res.code === '10000') {
this.data = res.data
//按号型重新排序
// let newData = res.data.sort(function(x, y) {
// return x.sizeName.localeCompare(y.sizeName);
// });
// this.data = newData
//console.log(this.data)
setTimeout(() => {
this.loading = false
}, this.time)
......@@ -69,11 +192,21 @@ export default {
})
})
},
initOrgList() {
getListOrg({id: this.orgId}).then(res => {
this.orgList = res.data
console.log(this.orgList)
});
},
cancel() {
this.resetForm()
},
resetForm() {
this.dialog = false
this.orgId =''
this.findCode =''
this.equipmentId =''
this.sizeId =''
}
}
}
......
......@@ -63,7 +63,7 @@
<el-table-column prop="bfCount" label="报废数" sortable align="center" v-if="$store.state.user.user.baseJpOrganization.code !== '330200000000'"/>
<el-table-column label="操作" width="80" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="show(scope.row.id, props.row.findCode, props.row.orgCode)">查看</el-button>
<el-button size="mini" type="primary" @click="show(scope.row.id, props.row.findCode, props.row.orgCode,props.row.orgId)">查看</el-button>
</template>
</el-table-column>
</el-table>
......@@ -319,9 +319,9 @@ export default {
return sums;
},
show(equipmentId, findCode, orgCode) {
show(equipmentId, findCode, orgCode, orgId) {
const _this = this.$refs.form
_this.initTable(equipmentId, findCode, orgCode, this.code)
_this.initTable(equipmentId, findCode, orgCode, this.code, orgId)
_this.dialog = true
}
}
......
......@@ -160,22 +160,19 @@ export default {
typeList: [
{name:"全部装备",value:"装备总数"},
{name:"在库装备",value:"在库数量"},
{name:"仓库装备",value:"仓库装备"},
{name:"调拨中",value:"调拨数量"},
{name:"使用中",value:"领用数量"},
{name:"维修装备",value:"维修数量"},
{name:"报废装备",value:"报废数量"},
{name:"单警柜装备",value:"单警柜装备"},
],
typeListNb: [
{name:"全部装备",value:"装备总数"},
{name:"在库装备",value:"在库数量"},
{name:"仓库装备",value:"仓库装备"},
{name:"调拨中",value:"调拨数量"},
{name:"使用中",value:"领用数量"},
{name:"维修装备",value:"维修数量"},
{name:"报废装备",value:"报废区数量"},
{name:"销毁装备",value:"销毁数量"},
// {name:"报废装备",value:"报废区数量"},
// {name:"销毁装备",value:"销毁数量"},
{name:"单警柜装备",value:"单警柜装备"},
],
orgCode: this.$store.state.user.user.baseJpOrganization.code,
......
......@@ -174,19 +174,22 @@ export default {
getWzByEpc({epc : backMessObj.Content}).then(res => {
if (res.code === "10000"){
if (!this.epsList.includes(backMessObj.Content)) {
if (res.data.warehouseId == null || res.data.warehouseId == '') {
if(res.data.orgId == this.$store.state.user.user.baseJpOrganization.id) {
this.epsList.unshift(backMessObj.Content)
this.handleAdd(res.data)
} else {
this.$message.warning('组织机构不匹配')
}
if(res.data.orgId == this.$store.state.user.user.baseJpOrganization.id) {
if (res.data.warehouseId == this.form.warehouseId || res.data.warehouseId == null || res.data.warehouseId == '') {
this.epsList.unshift(backMessObj.Content)
this.handleAdd(res.data)
}
}else{
this.$message.warning('组织机构不匹配')
}
if (res.data.warehouseId == this.form.warehouseId) {
this.epsList.unshift(backMessObj.Content)
this.handleAdd(res.data)
}
}
}else{
this.$message.warning(res.msg)
}
})
}else if (![0,1,2,5].includes(backMessObj.CmdType)){
......@@ -238,11 +241,17 @@ export default {
getWzByEpc({epc : this.eqEpc}).then(res => {
if(res.code === "10000"){
if (!this.epsList.includes(this.eqEpc)) {
if (res.data.warehouseId == this.form.warehouseId) {
// if (res.data.warehouseId == this.form.warehouseId ) {
// this.epsList.push(this.eqEpc)
// this.handleAdd(res.data)
// } else {
// this.$message.warning('仓库未匹配成功')
// }
if (res.data.orgId == this.$store.state.user.user.baseJpOrganization.id ) {
this.epsList.push(this.eqEpc)
this.handleAdd(res.data)
} else {
this.$message.warning('仓库未匹配成功')
this.$message.warning('组织机构不匹配')
}
}
} else {
......@@ -257,6 +266,7 @@ export default {
},
cancel() {
this.resetForm()
this.$parent.initPost()
},
doSubmit() {
this.form.orgCode = this.$store.state.user.user.baseJpOrganization.code.substring(0,6)
......
......@@ -5,10 +5,21 @@
<el-tab-pane style="margin-left: 20px">
<span slot="label"><i class="el-icon-document"></i>&nbsp;报废信息</span>
<el-collapse v-model="collapseNum">
<el-collapse-item name="1">
<template slot="title"> <el-tag>所在仓库</el-tag></template>
<el-form-item prop="warehouseId" label-width="6px">
<el-select v-model="form.warehouseId" style="width:240px" filterable placeholder="请选择目标仓库" :disabled="true">
<el-collapse-item name="1" >
<template slot="title"> <el-tag>所属仓库</el-tag></template>
<el-form-item prop="warehouseId" label-width="6px" v-if="this.form.warehouseId==null">
<el-select v-model="form.warehouseId" style="width:240px" filterable placeholder="请选择目标仓库" :disabled="true">
<el-option
v-for="item in warehouseList"
:key="item.name"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="warehouseId" label-width="6px" v-if="this.form.warehouseId!=null">
<el-select v-model="form.warehouseId" style="width:240px" filterable placeholder="请选择目标仓库" >
<el-option
v-for="item in warehouseList"
:key="item.name"
......@@ -74,6 +85,8 @@ import { addOrUpdateFixed,getWzByEpc } from '@/api/fixReceiveApply'
import {getListOrgWarehouse } from '@/api/warehouse'
import { getProcess, getAllProcess } from '@/api/process'
import { deleteTxt, addTxt, getListTxt } from '@/api/policeman'
import { Message } from 'element-ui';
import EventBus from '@/utils/event-bus.js'
export default {
data() {
return {
......@@ -113,9 +126,19 @@ export default {
},
texts: [],
inputVisible: false,
inputValue: ''
inputValue: '',
//message: ''
}
},
mounted() {
// if (EventBus) {
// EventBus.$on('show-message', message => {
// Message.warning(message);
// });
// } else {
// console.error('EventBus not defined');
// }
},
methods: {
//获取仓库列表
getListOrgWarehouse() {
......@@ -152,7 +175,7 @@ export default {
if(res.code === "10000"){
this.resetForm()
this.$notify({
title: '成功',
title: '操作成功',
type: 'success',
duration: 2500
})
......@@ -242,7 +265,7 @@ export default {
}
</script>
<style lang="less" scoped>
<style lang="less" scoped >
/deep/ .el-input-number .el-input__inner {
text-align: left;
}
......
......@@ -76,6 +76,7 @@ import { getInfoByID, setLostEquipment } from '@/api/inventory'
import eForm from '../maintenance/form'
import applyForm from './form'
import initData from '@/mixins/initData'
import EventBus from '@/utils/event-bus'
export default {
name: 'Loss',
components: { eForm, applyForm },
......@@ -143,11 +144,27 @@ export default {
quantity : 1
}
const _this = this.$refs.applyForm
_this.form.warehouseId = data.warehouseId
_this.getListOrgWarehouse()
_this.getProcess()
_this.form.detailList.push(row)
_this.dialog = true
// if (data.warehouseId != null) {
// _this.form.warehouseId = data.warehouseId;
// } else {
// EventBus.$emit('show-message', '无所属仓库,请为其选择所属仓库');
// }
if(data.warehouseId!=null){
_this.form.warehouseId = data.warehouseId
}else{
this.$nextTick(() => {
_this.$message.warning({
message :'该装备无所属仓库,请为其选择所属仓库',
customClass:'messageboxIndex'
})
});
}
// this.$confirm('是否确认遗失?', '确认操作', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
......@@ -171,9 +188,12 @@ export default {
}
</script>
<style scoped>
<style lang="less" >
.dashboard-editor-container {
padding: 10px 12px 12px 12px;
background-color: rgb(240, 242, 245);
}
.messageboxIndex {
z-index: 9999 !important;
}
</style>
......@@ -49,9 +49,11 @@
<th class="textHeader">生产日期</th>
<td class="textContent">{{ parseTimes(form.productTime) }}</td>
<th class="textHeader">质保周期</th>
<td class="textContent">{{form.warrantyCycle}}个月{{ form.safeLevel === 0 ? '(质保期内)' : form.safeLevel === 1 ? '(即将过期)' : '(已过质保期)' }}</td>
<!-- <td class="textContent">{{form.warrantyCycle}}个月{{ form.safeLevel === 0 ? '(质保期内)' : form.safeLevel === 1 ? '(即将过期)' : '(已过质保期)' }}</td> -->
<td class="textContent">{{form.warrantyCycle !== 0 ? (form.warrantyCycle + '个月') : '无'}}{{form.warrantyCycle !== 0 ? (form.safeLevel === 0 ? '(质保期内)' : form.safeLevel === 1 ? '(即将过期)' : '(已过质保期)') : ''}}</td>
<th class="textHeader">截止日期</th>
<td class="textContentLast">{{ parseTimes(new Date(form.productTime).getTime() + 86400*1000*form.warrantyCycle/12*365) }}</td>
<!-- <td class="textContentLast">{{ parseTimes(new Date(form.productTime).getTime() + 86400*1000*form.warrantyCycle/12*365) }}</td> -->
<td class="textContentLast">{{ form.warrantyCycle !== 0 ? parseTimes(new Date(form.productTime).getTime() + 86400 * 1000 * form.warrantyCycle / 12 * 365) : '无' }}</td>
</tr>
<tr style="border-bottom:1px solid #e8e8e8;">
<th class="textHeader">价格</th>
......@@ -102,9 +104,9 @@
{{scope.row.outInState == 0 ? '出库': '入库'}}
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right">
<el-table-column label="抓拍记录" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="warning" v-if="scope.row.picUrl" @click="previewPic(encodeURI(baseApi2 + scope.row.picUrl))">预览</el-button>
<el-button size="mini" type="warning" :disabled="scope.row.picUrl==null ||scope.row.picUrl===''" @click="previewPic(encodeURI(baseApi2 + scope.row.picUrl))">预览</el-button>
</template>
</el-table-column>
</el-table>
......@@ -131,9 +133,9 @@
{{scope.row.outInState == 0 ? '出库': '入库'}}
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right">
<el-table-column label="抓拍记录" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="warning" v-if="scope.row.picUrl" @click="previewPic(encodeURI(baseApi2 + scope.row.picUrl))">预览</el-button>
<el-button size="mini" type="warning" :disabled="scope.row.picUrl==null ||scope.row.picUrl===''" @click="previewPic(encodeURI(baseApi2 + scope.row.picUrl))">预览</el-button>
</template>
</el-table-column>
</el-table>
......
......@@ -104,7 +104,7 @@ export default {
parseTimes,
initPost() {
var url = window._CONFIG['serviceURL'] + '/api/Inventory/GetGroupListEquipmentByOrgAndTypeDetailV2'
var params = { page: this.page, size: this.size, orgId: this.orgId || this.$store.state.user.user.baseJpOrganization.id,
var params = { page: this.page, size: this.size, orgId: this.orgId ,
type: this.type, level: this.level, name: this.name, topTypeName: this.topTypeName, safeLevel: this.safeLevel, equipmentSizeId: this.equipmentSizeId }
const type = this.type
const level = this.level
......
......@@ -61,7 +61,7 @@
<el-table ref="table" v-loading="loading" row-key="id" :data="data" show-summary :summary-method="getSummaries" highlight-current-row border style="width: 100%;" :expand-row-keys="expandedRowKeys" @row-click="rowClick" @expand-change="expandChange">
<el-table-column type="expand" width="50" align="center">
<template slot-scope="props">
<detail-form :orgId="orgId" :type="type" :level="level" :name="props.row.equipmentName" :topTypeName="topTypeName" :safeLevel="safeLevel" :equipmentSizeId="props.row.equipmentSizecode"
<detail-form :orgId="props.row.orgizationId" :type="type" :level="level" :name="props.row.equipmentName" :topTypeName="topTypeName" :safeLevel="safeLevel" :equipmentSizeId="props.row.equipmentSizecode"
:row="row" :column="column" @refresh="handleRefresh"/>
</template>
</el-table-column>
......
......@@ -111,7 +111,11 @@
<el-table-column prop="warehouseName" label="仓库名称" align="center" width="300"/>
<el-table-column prop="equipmentName" label="装备名称" align="center"/>
<el-table-column prop="equipmentSizeName" label="装备型号名称" align="center"/>
<el-table-column prop="sumCount" label="装备总数" align="center" sortable/>
<el-table-column label="装备总数" align="center" sortable>
<template slot-scope="scope">
{{scope.row.sumCount - scope.row.bfCount}}
</template>
</el-table-column>
<el-table-column prop="zkCount" label="在库数" align="center" sortable/>
<el-table-column prop="ckCount" label="出库数" align="center" sortable/>
<el-table-column prop="baofeiquCount" label="报废数" align="center" sortable v-if="$store.state.user.user.baseJpOrganization.code === '330200000000'"/>
......
......@@ -262,6 +262,7 @@ export default {
},
cancel() {
this.resetForm()
this.$parent.initPost()
},
doSubmit() {
this.$refs['form'].validate((valid) => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论