Merge remote-tracking branch 'origin/master'

yangwl
陈恒杰 9 months ago
commit 4eac06b6de

@ -822,6 +822,7 @@ export default {
ownEquipmentName: null, ownEquipmentName: null,
ownEquipmentCode: null, ownEquipmentCode: null,
unitPrice: null, unitPrice: null,
procurementMethod: null,
}, },
options: [ options: [
{ {
@ -837,8 +838,17 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
storageId: [ materialCode: [
{ required: true, message: "唯一序列不能为空", trigger: "blur" }, { required: true, message: "备品备件编码不能为空", trigger: "blur" },
],
materialDesc: [
{ required: true, message: "备品备件名称不能为空", trigger: "blur" },
],
amount: [
{ required: true, message: "库存数量不能为空", trigger: "blur" },
],
procurementMethod: [
{ required: true, message: "采购方式不能为空", trigger: "blur" },
], ],
}, },
}; };
@ -914,6 +924,7 @@ export default {
spareInventoryFloor: null, spareInventoryFloor: null,
spareInventoryUpper: null, spareInventoryUpper: null,
unitPrice: null, unitPrice: null,
procurementMethod: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -962,9 +973,13 @@ export default {
}); });
} else { } else {
addSparePartsLedger(this.form).then((response) => { addSparePartsLedger(this.form).then((response) => {
if(response.code == 500){
this.$modal.msg(response.msg);
}else{
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}
}); });
} }
} }

@ -1,57 +1,65 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px"> <el-form
<el-form-item label="仓库编码" prop="whCode"> :model="queryParams"
<el-input ref="queryForm"
v-model="queryParams.whCode" size="small"
placeholder="请输入仓库编码" :inline="true"
clearable v-show="showSearch"
@keyup.enter.native="handleQuery" label-width="98px"
/> >
</el-form-item> <el-form-item label="出入库类型" prop="inOutType">
<el-form-item label="库区编码" prop="waCode"> <el-select
<el-input v-model="queryParams.inOutType"
v-model="queryParams.waCode" placeholder="请选择出入库类型"
placeholder="请输入库区编码" @change="$forceUpdate()"
clearable clearable
style="width: 200px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> >
</el-form-item> <el-option
<el-form-item label="库位编码" prop="wlCode"> v-for="dict in dict.type.in_out_type"
<el-input :key="dict.value"
v-model="queryParams.wlCode" :label="dict.label"
placeholder="请输入库位编码" :value="dict.value"
clearable ></el-option>
@keyup.enter.native="handleQuery" </el-select>
/> </el-form-item>
</el-form-item> <el-form-item label="出入库单号" prop="orderNo">
<el-form-item label="入库单号" prop="orderNo">
<el-input <el-input
v-model="queryParams.orderNo" v-model="queryParams.orderNo"
placeholder="请输入入库单号" placeholder="请输入出入库单号"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="备品备件号" prop="materialCode"> <el-form-item label="备品备件号" prop="spareCode">
<el-input <el-input
v-model="queryParams.materialCode" v-model="queryParams.spareCode"
placeholder="请输入备品备件号" placeholder="请输入备品备件号"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="备品备件描述" prop="materialDesc"> <el-form-item label="备品备件名称" prop="spareName">
<el-input <el-input
v-model="queryParams.materialDesc" v-model="queryParams.spareName"
placeholder="请输入备品备件描述" placeholder="请输入备品备件名称"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -64,9 +72,10 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['device:sparepartsInOutStorage:add']" v-hasPermi="['device:sparepartsInOutStorage:add']"
>新增</el-button> >新增</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="success" type="success"
plain plain
@ -75,8 +84,9 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['device:sparepartsInOutStorage:edit']" v-hasPermi="['device:sparepartsInOutStorage:edit']"
>修改</el-button> >修改</el-button
</el-col> >
</el-col> -->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="danger" type="danger"
@ -86,7 +96,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['device:sparepartsInOutStorage:remove']" v-hasPermi="['device:sparepartsInOutStorage:remove']"
>删除</el-button> >删除</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -96,37 +107,98 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['device:sparepartsInOutStorage:export']" v-hasPermi="['device:sparepartsInOutStorage:export']"
>导出</el-button> >导出</el-button
>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="sparepartsInOutStorageList" @selection-change="handleSelectionChange"> <el-table
v-loading="loading"
:data="sparepartsInOutStorageList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!-- 序号 --> <!-- 序号 -->
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"/> <el-table-column
<el-table-column label="仓库编码" align="center" prop="whCode" /> type="index"
<el-table-column label="库区编码" align="center" prop="waCode" /> width="90"
<el-table-column label="库位编码" align="center" prop="wlCode" width="100"/> align="center"
<el-table-column label="入库单号" align="center" prop="orderNo" width="100"/> :index="indexMethod"
<el-table-column label="采购订单号" align="center" prop="poNo" width="100"/> label="序号"
<el-table-column label="采购订单行项目" align="center" prop="poLine" width="120"/> />
<el-table-column label="备品备件号" align="center" prop="materialCode" width="120"/> <el-table-column
<el-table-column label="备品备件描述" align="center" prop="materialDesc" width="180"/> label="出入库类型"
align="center"
prop="inOutType"
width="100"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.in_out_type"
:value="scope.row.inOutType"
/>
</template>
</el-table-column>
<el-table-column
label="出入库单号"
align="center"
prop="orderNo"
width="200"
/>
<el-table-column
label="备品备件号"
align="center"
prop="spareCode"
width="180"
/>
<el-table-column
label="备品备件描述"
align="center"
prop="spareName"
width="180"
/>
<el-table-column label="数量" align="center" prop="amount" /> <el-table-column label="数量" align="center" prop="amount" />
<el-table-column label="创建时间" align="center" prop="gmtCreate" width="180"> <el-table-column
label="出入库时间"
align="center"
prop="createTime"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.gmtCreate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="最后更新人" align="center" prop="lastModifiedBy" width="180"/> <el-table-column
<el-table-column label="最后更新时间" align="center" prop="gmtModified" width="180"> label="出入库人员"
align="center"
prop="createBy"
width="180"
/>
<el-table-column
label="最后更新人"
align="center"
prop="updateBy"
width="180"
/>
<el-table-column
label="最后更新时间"
align="center"
prop="updateTime"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.gmtModified, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.updateTime, "{y}-{m}-{d}") }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="有效标记" align="center" prop="activeFlag" /> <!-- <el-table-column
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -134,20 +206,22 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['device:sparepartsInOutStorage:edit']" v-hasPermi="['device:sparepartsInOutStorage:edit']"
>修改</el-button> >修改</el-button
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['device:sparepartsInOutStorage:remove']" v-hasPermi="['device:sparepartsInOutStorage:remove']"
>删除</el-button> >删除</el-button
>
</template> </template>
</el-table-column> </el-table-column> -->
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@ -156,95 +230,76 @@
<!-- 添加或修改备品备件出入库对话框 --> <!-- 添加或修改备品备件出入库对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="仓库编码" prop="whCode"> <!-- <el-form-item label="出入库类型" prop="inOutType">
<el-input v-model="form.whCode" placeholder="请输入仓库编码" /> <el-input v-model="form.inOutType" placeholder="请输入出入库类型" style="width: 280px"/>
</el-form-item> </el-form-item> -->
<el-form-item label="库区编码" prop="waCode"> <el-form-item label="出入库类型" prop="inOutType">
<el-input v-model="form.waCode" placeholder="请输入库区编码" /> <el-select
</el-form-item> v-model="form.inOutType"
<el-form-item label="库位编码" prop="wlCode"> placeholder="请输入出入库类型"
<el-input v-model="form.wlCode" placeholder="请输入库位编码" /> @change="$forceUpdate()"
</el-form-item> clearable
<el-form-item label="入库单号" prop="orderNo"> style="width: 280px"
<el-input v-model="form.orderNo" placeholder="请输入入库单号" /> @keyup.enter.native="handleQuery"
</el-form-item> >
<el-form-item label="采购订单号" prop="poNo"> <el-option
<el-input v-model="form.poNo" placeholder="请输入采购订单号" /> v-for="dict in dict.type.in_out_type"
</el-form-item> :key="dict.value"
<el-form-item label="采购订单行项目" prop="poLine"> :label="dict.label"
<el-input v-model="form.poLine" placeholder="请输入采购订单行项目" /> :value="dict.value"
</el-form-item> ></el-option>
<el-form-item label="物料号" prop="materialCode"> </el-select>
<el-input v-model="form.materialCode" placeholder="请输入物料号" /> </el-form-item>
</el-form-item> <el-form-item label="出入库单号" prop="orderNo" v-if="form.id != null">
<el-form-item label="物料描述" prop="materialDesc"> <el-input
<el-input v-model="form.materialDesc" placeholder="请输入物料描述" /> v-model="form.orderNo"
</el-form-item> placeholder="请输入入库单号"
<el-form-item label="sn/LPN" prop="sn"> style="width: 280px"
<el-input v-model="form.sn" placeholder="请输入sn/LPN" /> disabled
/>
</el-form-item> </el-form-item>
<el-form-item label="备品备件编码" prop="spareCode">
<el-input
v-model="form.spareCode"
placeholder="请选择备品备件编码"
style="width: 280px"
>
<el-button
slot="append"
@click="handleSelectSparePartsLedger"
icon="el-icon-search"
></el-button>
</el-input>
<ItemSelectSparePartsLedger
ref="itemSelectSparePartsLedger"
@onSelected="onItemSelectedSparePartsLedger"
>
</ItemSelectSparePartsLedger>
</el-form-item>
<el-form-item label="备品备件名称" prop="spareName">
<el-input v-model="form.spareName" style="width: 280px" disabled />
</el-form-item>
<!-- <el-form-item label="备品备件号" prop="spareCode">
<el-input v-model="form.spareCode" placeholder="请输入备品备件号" />
</el-form-item>
<el-form-item label="备品备件描述" prop="spareName">
<el-input v-model="form.spareName" placeholder="请输入备品备件描述" />
</el-form-item> -->
<!-- <el-form-item label="数量" prop="amount">
<el-input v-model="form.amount" placeholder="请输入数量" style="width: 280px"/>
</el-form-item> -->
<el-col :span="12">
<el-form-item label="数量" prop="amount"> <el-form-item label="数量" prop="amount">
<el-input v-model="form.amount" placeholder="请输入数量" /> <el-input-number
</el-form-item> :min="0"
<el-form-item label="备用1" prop="userDefined1"> :step="1"
<el-input v-model="form.userDefined1" placeholder="请输入备用1" /> v-model="form.amount"
</el-form-item> placeholder="请输入数量"
<el-form-item label="备用2" prop="userDefined2"> style="width: 280px"
<el-input v-model="form.userDefined2" placeholder="请输入备用2" /> />
</el-form-item>
<el-form-item label="备用3" prop="userDefined3">
<el-input v-model="form.userDefined3" placeholder="请输入备用3" />
</el-form-item>
<el-form-item label="备用4" prop="userDefined4">
<el-input v-model="form.userDefined4" placeholder="请输入备用4" />
</el-form-item>
<el-form-item label="备用5" prop="userDefined5">
<el-input v-model="form.userDefined5" placeholder="请输入备用5" />
</el-form-item>
<el-form-item label="备用6" prop="userDefined6">
<el-input v-model="form.userDefined6" placeholder="请输入备用6" />
</el-form-item>
<el-form-item label="备用7" prop="userDefined7">
<el-input v-model="form.userDefined7" placeholder="请输入备用7" />
</el-form-item>
<el-form-item label="备用8" prop="userDefined8">
<el-input v-model="form.userDefined8" placeholder="请输入备用8" />
</el-form-item>
<el-form-item label="备用9" prop="userDefined9">
<el-input v-model="form.userDefined9" placeholder="请输入备用9" />
</el-form-item>
<el-form-item label="备用10" prop="userDefined10">
<el-input v-model="form.userDefined10" placeholder="请输入备用10" />
</el-form-item>
<el-form-item label="创建时间" prop="gmtCreate">
<el-date-picker clearable
v-model="form.gmtCreate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
</el-date-picker>
</el-form-item>
<el-form-item label="最后更新人" prop="lastModifiedBy">
<el-input v-model="form.lastModifiedBy" placeholder="请输入最后更新人" />
</el-form-item>
<el-form-item label="最后更新时间" prop="gmtModified">
<el-date-picker clearable
v-model="form.gmtModified"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择最后更新时间">
</el-date-picker>
</el-form-item>
<el-form-item label="有效标记" prop="activeFlag">
<el-input v-model="form.activeFlag" placeholder="请输入有效标记" />
</el-form-item>
<el-form-item label="${comment}" prop="factoryCode">
<el-input v-model="form.factoryCode" placeholder="请输入${comment}" />
</el-form-item>
<el-form-item label="${comment}" prop="sapFactoryCode">
<el-input v-model="form.sapFactoryCode" placeholder="请输入${comment}" />
</el-form-item> </el-form-item>
</el-col>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -255,10 +310,19 @@
</template> </template>
<script> <script>
import { listSparepartsInOutStorage, getSparepartsInOutStorage, delSparepartsInOutStorage, addSparepartsInOutStorage, updateSparepartsInOutStorage } from "@/api/device/sparepartsInOutStorage"; import {
listSparepartsInOutStorage,
getSparepartsInOutStorage,
delSparepartsInOutStorage,
addSparepartsInOutStorage,
updateSparepartsInOutStorage,
} from "@/api/device/sparepartsInOutStorage";
import ItemSelectSparePartsLedger from "./selectSparePartsLedger.vue";
export default { export default {
name: "SparepartsInOutStorage", name: "SparepartsInOutStorage",
components: { ItemSelectSparePartsLedger },
dicts: ["in_out_type"],
data() { data() {
return { return {
// //
@ -283,38 +347,37 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
whCode: null, id: null,
waCode: null, inOutType: null,
wlCode: null,
orderNo: null, orderNo: null,
poNo: null, spareCode: null,
poLine: null, spareName: null,
materialCode: null,
materialDesc: null,
sn: null,
amount: null, amount: null,
userDefined1: null, attr1: null,
userDefined2: null, attr2: null,
userDefined3: null, attr3: null,
userDefined4: null, createBy: null,
userDefined5: null, createTime: null,
userDefined6: null, updateBy: null,
userDefined7: null, updateTime: null,
userDefined8: null, delFlag: null,
userDefined9: null,
userDefined10: null,
gmtCreate: null,
lastModifiedBy: null,
gmtModified: null,
activeFlag: null,
factoryCode: null, factoryCode: null,
sapFactoryCode: null
}, },
// //
form: {}, form: {},
// //
rules: { rules: {
} inOutType: [
{ required: true, message: "出入库类型不能为空", trigger: "blur" },
],
spareCode: [
{ required: true, message: "备件名不能为空", trigger: "blur" },
],
spareName: [
{ required: true, message: "备件名称不能为空", trigger: "blur" },
],
amount: [{ required: true, message: "数量不能为空", trigger: "blur" }],
},
}; };
}, },
created() { created() {
@ -325,10 +388,20 @@ export default {
indexMethod(index) { indexMethod(index) {
return index + 1; return index + 1;
}, },
//
handleSelectSparePartsLedger() {
this.$refs.itemSelectSparePartsLedger.showFlag = true;
},
//
onItemSelectedSparePartsLedger(obj) {
this.form.storageId = obj[0].storageId;
this.form.spareCode = obj[0].materialCode;
this.form.spareName = obj[0].materialDesc;
},
/** 查询备品备件出入库列表 */ /** 查询备品备件出入库列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listSparepartsInOutStorage(this.queryParams).then(response => { listSparepartsInOutStorage(this.queryParams).then((response) => {
this.sparepartsInOutStorageList = response.rows; this.sparepartsInOutStorageList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -342,34 +415,22 @@ export default {
// //
reset() { reset() {
this.form = { this.form = {
rawOrderInSnId: null, id: null,
whCode: null, inOutType: null,
waCode: null,
wlCode: null,
orderNo: null, orderNo: null,
poNo: null, spareCode: null,
poLine: null, spareName: null,
materialCode: null,
materialDesc: null,
sn: null,
amount: null, amount: null,
userDefined1: null, attr1: null,
userDefined2: null, attr2: null,
userDefined3: null, attr3: null,
userDefined4: null,
userDefined5: null,
userDefined6: null,
userDefined7: null,
userDefined8: null,
userDefined9: null,
userDefined10: null,
createBy: null, createBy: null,
gmtCreate: null, createTime: null,
lastModifiedBy: null, updateBy: null,
gmtModified: null, updateTime: null,
activeFlag: null, delFlag: null,
factoryCode: null, factoryCode: null,
sapFactoryCode: null storageId: null, //ID
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -385,9 +446,9 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.rawOrderInSnId) this.ids = selection.map((item) => item.id);
this.single = selection.length!==1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
@ -398,8 +459,8 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const rawOrderInSnId = row.rawOrderInSnId || this.ids const id = row.id || this.ids;
getSparepartsInOutStorage(rawOrderInSnId).then(response => { getSparepartsInOutStorage(id).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改备品备件出入库"; this.title = "修改备品备件出入库";
@ -407,16 +468,16 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.rawOrderInSnId != null) { if (this.form.id != null) {
updateSparepartsInOutStorage(this.form).then(response => { updateSparepartsInOutStorage(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addSparepartsInOutStorage(this.form).then(response => { addSparepartsInOutStorage(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
@ -427,20 +488,28 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const rawOrderInSnIds = row.rawOrderInSnId || this.ids; const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除备品备件出入库编号为"' + rawOrderInSnIds + '"的数据项?').then(function() { this.$modal
return delSparepartsInOutStorage(rawOrderInSnIds); .confirm('是否确认删除备品备件出入库编号为"' + ids + '"的数据项?')
}).then(() => { .then(function () {
return delSparepartsInOutStorage(ids);
})
.then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); })
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('device/sparepartsInOutStorage/export', { this.download(
...this.queryParams "device/sparepartsInOutStorage/export",
}, `sparepartsInOutStorage_${new Date().getTime()}.xlsx`) {
} ...this.queryParams,
} },
`sparepartsInOutStorage_${new Date().getTime()}.xlsx`
);
},
},
}; };
</script> </script>

@ -0,0 +1,332 @@
<template>
<el-dialog
title="备品备件选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal="false"
width="1100px"
center
:before-close="cancel"
>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="98px"
>
<el-form-item label="备品备件号" prop="materialCode">
<el-input
v-model="queryParams.materialCode"
placeholder="请输入备品备件号"
clearable
@keyup.enter.native="handleQuery"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="备件类型" prop="spareType">
<el-select
v-model="queryParams.spareType"
placeholder="请选择备件类型"
@keyup.enter.native="handleQuery"
@change="$forceUpdate()"
clearable
style="width: 150px"
>
<el-option
v-for="item in options"
:key="item.spareType"
:label="item.label"
:value="item.spareType"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
<el-table
v-loading="loading"
:data="sparePartsLedgerList"
@selection-change="handleSelectionChange"
ref="multipleTable"
>
<el-table-column type="selection" width="55" align="center" />
<!-- 序号 -->
<el-table-column
type="index"
width="90"
align="center"
:index="indexMethod"
label="序号"
/>
<el-table-column
label="备品备件号"
align="center"
prop="materialCode"
width="120"
/>
<el-table-column
label="备品备件描述"
align="center"
prop="materialDesc"
width="120"
/>
<el-table-column
label="备品备件类型"
align="center"
prop="spareType"
width="120"
/>
<el-table-column label="规格型号" align="center" prop="spareMode" />
<el-table-column label="库存总数量" align="center" prop="amount" />
<el-table-column
label="库存可用数量"
align="center"
prop="availableQuantity"
>
<template slot-scope="scope">
<span>{{ scope.row.amount - scope.row.storageAmount }}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :disabled="multiple"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {
listSparePartsLedger,
getSparePartsLedger,
delSparePartsLedger,
addSparePartsLedger,
updateSparePartsLedger,
} from "@/api/device/sparePartsLedger";
export default {
name: "SparePartsLedger",
data() {
return {
//
showFlag: false,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
sparePartsLedgerList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
storageId: null,
whCode: null,
regionCode: null,
waCode: null,
storageType: null,
wlCode: null,
materialCode: null,
materialDesc: null,
amount: null,
storageAmount: null,
occupyAmount: null,
lpn: null,
productBatch: null,
receiveDate: null,
productDate: null,
userDefined1: null,
userDefined2: null,
userDefined3: null,
userDefined4: null,
userDefined5: null,
userDefined6: null,
userDefined7: null,
userDefined8: null,
userDefined9: null,
userDefined10: null,
gmtCreate: null,
lastModifiedBy: null,
gmtModified: null,
activeFlag: null,
factoryCode: null,
sapFactoryCode: null,
wlName: null,
spareUseLife: null,
spareName: null,
spareMode: null,
spareManufacturer: null,
spareSupplier: null,
spareReplacementCycle: null,
spareMeasurementUnit: null,
spareConversionUnit: null,
spareConversionRatio: null,
spareInventoryFloor: null,
spareInventoryUpper: null,
},
options: [
{
spareType: "专用",
label: "专用",
},
{
spareType: "通用",
label: "通用",
},
],
//
form: {},
//
rules: {
storageId: [
{ required: true, message: "唯一序列不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
handleEdit(index, row) {
console.log("row:", index, row);
console.log("storageId:", row.storageId); //name
},
//
indexMethod(index) {
return index + 1;
},
/** 查询备品备件台账管理列表 */
getList() {
this.loading = true;
listSparePartsLedger(this.queryParams).then((response) => {
this.sparePartsLedgerList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.showFlag = false;
this.reset();
this.resetQuery();
},
//
reset() {
this.form = {
storageId: null,
whCode: null,
regionCode: null,
waCode: null,
storageType: null,
wlCode: null,
materialCode: null,
materialDesc: null,
amount: null,
storageAmount: null,
occupyAmount: null,
lpn: null,
productBatch: null,
receiveDate: null,
productDate: null,
userDefined1: null,
userDefined2: null,
userDefined3: null,
userDefined4: null,
userDefined5: null,
userDefined6: null,
userDefined7: null,
userDefined8: null,
userDefined9: null,
userDefined10: null,
createBy: null,
gmtCreate: null,
lastModifiedBy: null,
gmtModified: null,
activeFlag: null,
factoryCode: null,
sapFactoryCode: null,
wlName: null,
delFlag: null,
spareUseLife: null,
spareName: null,
spareMode: null,
spareManufacturer: null,
spareSupplier: null,
spareReplacementCycle: null,
spareMeasurementUnit: null,
spareConversionUnit: null,
spareConversionRatio: null,
spareInventoryFloor: null,
spareInventoryUpper: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.storageId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 提交按钮 */
submitForm() {
console.log("data:", this.sparePartsLedgerList);
console.log("选择的数据", this.$refs.multipleTable.selection);
if (this.$refs.multipleTable.selection.length > 1) {
this.$message({
message: "请勿选择多种备件!",
type: "warning",
});
} else {
this.$emit("onSelected", this.$refs.multipleTable.selection);
this.showFlag = false;
//
this.resetQuery();
}
},
},
};
</script>

@ -21,7 +21,7 @@
:filter-node-method="filterNode" :filter-node-method="filterNode"
ref="tree" ref="tree"
node-key="id" node-key="id"
default-expand-all :default-expanded-keys="[deptOptions[0].id]"
highlight-current highlight-current
@node-click="handleNodeClick" @node-click="handleNodeClick"
/> />
@ -47,16 +47,20 @@
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item><div>-</div></el-form-item> <el-form-item>
<div>-</div>
</el-form-item>
<el-form-item <el-form-item
><el-date-picker >
<el-date-picker
v-model="dateRangetwo" v-model="dateRangetwo"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
style="width: 240px" style="width: 240px"
type="datetime" type="datetime"
placeholder="选择日期时间" placeholder="选择日期时间"
></el-date-picker ></el-date-picker
></el-form-item> >
</el-form-item>
<el-form-item label="时间范围" prop="status"> <el-form-item label="时间范围" prop="status">
<el-select <el-select
v-model="queryParams.dateType" v-model="queryParams.dateType"
@ -93,10 +97,12 @@
icon="el-icon-search" icon="el-icon-search"
size="mini" size="mini"
@click="handleQuery" @click="handleQuery"
>搜索</el-button >搜索
</el-button
> >
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button >重置
</el-button
> >
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -111,6 +117,16 @@
</el-card> </el-card>
<!-- 新增等功能按钮 --> <!-- 新增等功能按钮 -->
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- >光伏用量-->
<!-- </el-button>-->
<!-- </el-col>-->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
@ -119,7 +135,8 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['report:pointDnb:export']" v-hasPermi="['report:pointDnb:export']"
>导出</el-button >导出
</el-button
> >
</el-col> </el-col>
<right-toolbar <right-toolbar
@ -134,7 +151,7 @@
:data="userList" :data="userList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="50" align="center" /> <el-table-column type="selection" width="50" align="center"/>
<el-table-column <el-table-column
label="计量设备编号" label="计量设备编号"
align="center" align="center"
@ -202,6 +219,51 @@
/> />
</el-col> </el-col>
</el-row> </el-row>
<!-- 添加光伏整点数据对话框 -->
<!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>-->
<!-- <el-form ref="form" :model="form" :rules="rules" label-width="120px">-->
<!-- <el-form-item label="光伏设备名称" prop="monitorId">-->
<!-- <el-select v-model="form.monitorId" placeholder="请选择光伏设备名称">-->
<!-- <el-option-->
<!-- v-for="item in photovoltaicList"-->
<!-- :key="item.monitorId"-->
<!-- :label="item.monitorName"-->
<!-- :value="item.monitorId"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="耗量" prop="expend">-->
<!-- <el-input v-model="form.expend" placeholder="请输入耗量"/>-->
<!-- </el-form-item>-->
<!-- &lt;!&ndash; <el-form-item label="仪表值" prop="instrumentValue">&ndash;&gt;-->
<!-- &lt;!&ndash; <el-input v-model="form.instrumentValue" placeholder="请输入仪表值"/>&ndash;&gt;-->
<!-- &lt;!&ndash; </el-form-item>&ndash;&gt;-->
<!-- <el-form-item label="开始日期" prop="beginTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.beginTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择开始日期"-->
<!-- >-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="结束日期" prop="endTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.endTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择结束日期"-->
<!-- >-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="submitForm"> </el-button>-->
<!-- <el-button @click="cancel"> </el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
</div> </div>
</template> </template>
@ -211,16 +273,21 @@ import {
treeDat, treeDat,
dnbCountingData, dnbCountingData,
listUser2, listUser2,
deptTreeSelect, deptTreeSelect
} from "@/api/energy/powerUse/WholePointData"; } from '@/api/energy/powerUse/WholePointData'
import { getToken } from "@/utils/auth"; import { getToken } from '@/utils/auth'
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from '@riophae/vue-treeselect'
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import * as echarts from "echarts"; import * as echarts from 'echarts'
import {
addShuiMeasurement,
listShuiMeasurement,
updateShuiMeasurement
} from '@/api/energy/energy/waterManagement/shuiMeasurement'
export default { export default {
name: "User", name: 'WholePointData',
dicts: ["sys_normal_disable", "sys_user_sex", "public_share_type"], dicts: ['sys_normal_disable', 'sys_user_sex', 'public_share_type'],
components: { Treeselect }, components: { Treeselect },
data() { data() {
return { return {
@ -239,9 +306,9 @@ export default {
// //
userList: null, userList: null,
// //
title: "", title: '',
// //
deptOptions: undefined, deptOptions: [{ id: 2 }],
// //
open: false, open: false,
// //
@ -250,45 +317,49 @@ export default {
initPassword: undefined, initPassword: undefined,
// //
dateRange: [], dateRange: [],
dateRangeone: "", dateRangeone: '',
dateRangetwo: "", dateRangetwo: '',
// //
postOptions: [], postOptions: [],
// //
roleOptions: [], roleOptions: [],
//list
photovoltaicList: [],
// //
form: {}, form: {},
defaultProps: { defaultProps: {
children: "children", children: 'children',
label: "lable", label: 'lable'
}, },
// //
upload: { upload: {
// //
open: false, open: false,
// //
title: "", title: '',
// //
isUploading: false, isUploading: false,
// //
updateSupport: 0, updateSupport: 0,
// //
headers: { Authorization: "Bearer " + getToken() }, headers: { Authorization: 'Bearer ' + getToken() },
// //
url: process.env.VUE_APP_BASE_API + "/system/user/importData", url: process.env.VUE_APP_BASE_API + '/system/user/importData'
}, },
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
dateType: "hour", dateType: 'hour',
isAsc: "asc", isAsc: 'asc',
monitorSubset: "", monitorSubset: '',
publicShareType:'', publicShareType: '',
monitorCode: null,
instrumentValue: null,
params: { params: {
beginCollectTime: "", beginCollectTime: '',
endCollectTime: "", endCollectTime: ''
}, }
}, },
// //
columns: [ columns: [
@ -298,265 +369,261 @@ export default {
{ key: 3, label: `耗量(kW·h)`, visible: true }, { key: 3, label: `耗量(kW·h)`, visible: true },
{ key: 4, label: `开始时间`, visible: true }, { key: 4, label: `开始时间`, visible: true },
{ key: 5, label: `结束时间`, visible: true }, { key: 5, label: `结束时间`, visible: true },
{ key: 6, label: `仪表值(kW·h)`, visible: true }, { key: 6, label: `仪表值(kW·h)`, visible: true }
], ],
// //
rules: { rules: {
userName: [ monitorId: [
{ required: true, message: "用户名称不能为空", trigger: "blur" }, { required: true, message: '计量设备名称不能为空', trigger: 'blur' }
{
min: 2,
max: 20,
message: "用户名称长度必须介于 2 和 20 之间",
trigger: "blur",
},
], ],
nickName: [ expend: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" }, { required: true, message: '耗量不能为空', trigger: 'blur' }
], ],
password: [ beginTime: [
{ required: true, message: "用户密码不能为空", trigger: "blur" }, { required: true, message: '开始日期不能为空', trigger: 'blur' }
{
min: 5,
max: 20,
message: "用户密码长度必须介于 5 和 20 之间",
trigger: "blur",
},
], ],
email: [ endTime: [
{ { required: true, message: '结束日期不能为空', trigger: 'blur' }
type: "email",
message: "请输入正确的邮箱地址",
trigger: ["blur", "change"],
},
],
phonenumber: [
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
trigger: "blur",
},
], ],
}, },
baoliudateRangeone: "", baoliudateRangeone: '',
baoliudateRangetwo: "", baoliudateRangetwo: '',
// //
dict1: [ dict1: [
{ label: "时", value: "hour" }, { label: '时', value: 'hour' },
{ label: "天", value: "day" }, { label: '天', value: 'day' },
{ label: "月", value: "month" }, { label: '月', value: 'month' },
{ label: "年", value: "year" }, { label: '年', value: 'year' }
], ],
// //
option: { option: {
tooltip: { tooltip: {
trigger: "axis", trigger: 'axis',
formatter: function (params) { formatter: function(params) {
return ( return (
params[0].name + params[0].name +
"<br>" + '<br>' +
params[0].marker + params[0].marker +
" " + ' ' +
"电耗量(kW·h):" + '电耗量(kW·h):' +
params[0].data params[0].data
); )
}, },
axisPointer: { axisPointer: {
type: "cross", type: 'cross',
crossStyle: { crossStyle: {
color: "#999", color: '#999'
}, }
}, }
}, },
xAxis: { xAxis: {
type: "category", type: 'category',
data: [], data: []
}, },
yAxis: { yAxis: {
type: "value", type: 'value',
axisLine: { show: true }, axisLine: { show: true }
}, },
series: [ series: [
{ {
tooltip: { tooltip: {
valueFormatter: function (value) { valueFormatter: function(value) {
return value; return value
}, }
}, },
data: [], data: [],
type: "bar", type: 'bar'
}, }
], ]
}, }
}; }
}, },
watch: { watch: {
// //
deptName(val) { deptName(val) {
this.$refs.tree.filter(val); this.$refs.tree.filter(val)
}, }
}, },
created() { created() {
this.dateRangeone = new Date(new Date().setHours(0, 0, 0, 0)); this.dateRangeone = new Date(new Date().setHours(0, 0, 0, 0))
var d = new Date(this.dateRangeone); var d = new Date(this.dateRangeone)
let m = ("0" + (d.getMonth() + 1)).slice(-2); let m = ('0' + (d.getMonth() + 1)).slice(-2)
let tian = ("0" + d.getDate()).slice(-2); let tian = ('0' + d.getDate()).slice(-2)
let h = ("0" + d.getHours()).slice(-2); let h = ('0' + d.getHours()).slice(-2)
let M = ("0" + d.getMinutes()).slice(-2); let M = ('0' + d.getMinutes()).slice(-2)
let s = ("0" + d.getSeconds()).slice(-2); let s = ('0' + d.getSeconds()).slice(-2)
console.log("d", d);
this.dateRangeone = this.dateRangeone =
d.getFullYear() + "-" + m + "-" + tian + " " + h + ":" + M + ":" + s; d.getFullYear() + '-' + m + '-' + tian + ' ' + h + ':' + M + ':' + s
this.baoliudateRangeone = this.dateRangeone; this.baoliudateRangeone = this.dateRangeone
this.dateRangetwo = new Date( this.dateRangetwo = new Date(
new Date().setHours(0, 0, 0, 0) + 24 * 60 * 60 * 1000 - 1 new Date().setHours(0, 0, 0, 0) + 24 * 60 * 60 * 1000 - 1
); )
var d1 = new Date(this.dateRangetwo); var d1 = new Date(this.dateRangetwo)
let m1 = ("0" + (d1.getMonth() + 1)).slice(-2); let m1 = ('0' + (d1.getMonth() + 1)).slice(-2)
let tian1 = ("0" + d1.getDate()).slice(-2); let tian1 = ('0' + d1.getDate()).slice(-2)
let h1 = ("0" + d1.getHours()).slice(-2); let h1 = ('0' + d1.getHours()).slice(-2)
let M1 = ("0" + d1.getMinutes()).slice(-2); let M1 = ('0' + d1.getMinutes()).slice(-2)
let s1 = ("0" + d1.getSeconds()).slice(-2); let s1 = ('0' + d1.getSeconds()).slice(-2)
console.log("tian1.length", tian1);
this.dateRangetwo = this.dateRangetwo =
d1.getFullYear() + d1.getFullYear() +
"-" + '-' +
m1 + m1 +
"-" + '-' +
tian1 + tian1 +
" " + ' ' +
h1 + h1 +
":" + ':' +
M1 + M1 +
":" + ':' +
s1; s1
//this.dateRangetwo = d1.getFullYear()+ '-'+m1+ '-'+tian1+ ' '+ h1+ ':'+M1+':'+s1; //this.dateRangetwo = d1.getFullYear()+ '-'+m1+ '-'+tian1+ ' '+ h1+ ':'+M1+':'+s1;
this.baoliudateRangetwo = this.dateRangetwo; this.baoliudateRangetwo = this.dateRangetwo
this.getList(); this.getList()
this.getDeptTree(); this.getDeptTree()
}, },
mounted() { mounted() {
var chartDom = document.getElementById("card"); var chartDom = document.getElementById('card')
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom)
this.option && myChart.setOption(this.option); this.option && myChart.setOption(this.option)
}, },
methods: { methods: {
/** 查询用户列表 */ /** 查询用户列表 */
getList() { getList() {
this.loading = true; this.loading = true
this.queryParams.params.beginCollectTime = this.dateRangeone; this.queryParams.params.beginCollectTime = this.dateRangeone
this.queryParams.params.endCollectTime = this.dateRangetwo; this.queryParams.params.endCollectTime = this.dateRangetwo
console.log("this.datatimeone", this.queryParams); if (this.queryParams.dateType === 'hour') {
if (this.queryParams.dateType === "hour") {
listUser(this.queryParams).then((response) => { listUser(this.queryParams).then((response) => {
this.userList = response.rows; this.userList = response.rows
this.total = response.total; this.total = response.total
this.loading = false; this.loading = false
}); })
} else { } else {
listUser2(this.queryParams).then((response) => { listUser2(this.queryParams).then((response) => {
this.userList = response.rows; this.userList = response.rows
this.total = response.total; this.total = response.total
this.loading = false; this.loading = false
}); })
} }
}, },
// //
tranListToTreeData(list) { tranListToTreeData(list) {
// //
const treeList = []; const treeList = []
// 使 // 使
const map = {}; const map = {}
// id // id
list.forEach((item) => { list.forEach((item) => {
if (!item.children) { if (!item.children) {
item.children = []; item.children = []
} }
map[item.id] = item; map[item.id] = item
}); })
list.forEach((item) => { list.forEach((item) => {
// //
// children // children
// treeList // treeList
const parent = map[item.pId]; const parent = map[item.pId]
// item // item
if (parent) { if (parent) {
parent.children.push(item); parent.children.push(item)
} else { } else {
// //
treeList.push(item); treeList.push(item)
} }
}); })
// //
return treeList; return treeList
},
/** 添加光伏整点数据 */
// submitForm: function() {
// this.$refs["form"].validate((valid) => {
// if (valid) {
// addReportPointDnb(this.form).then((response) => {
// this.$modal.msgSuccess('')
// this.open = false
// this.getList()
// })
// }
// });
// },
/** 新增按钮操作 */
handleAdd() {
this.reset()
listShuiMeasurement({publicShareType: 4}).then((response) => {
this.photovoltaicList = response.data
})
this.open = true
this.title = '添加光伏发电数据'
}, },
/** 真查询部门下拉树结构 */ /** 真查询部门下拉树结构 */
getDeptTree() { getDeptTree() {
treeDat().then((response) => { treeDat().then((response) => {
response.map((item, index) => { response.map((item, index) => {
item, (item.oid = item.id), (item.lable = item.name); item, (item.oid = item.id), (item.lable = item.name)
}); })
this.deptOptions = this.tranListToTreeData(response); this.deptOptions = this.tranListToTreeData(response)
console.log(this.deptOptions); })
//this.deptOptions = response.data;
});
}, },
// //
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true
return data.lable.indexOf(value) !== -1; return data.lable.indexOf(value) !== -1
}, },
// //
handleNodeClick(data) { handleNodeClick(data) {
this.queryParams.monitorSubset = data.monitorId; this.queryParams.monitorSubset = data.monitorId
this.getList(); this.getList()
this.dnbCountingData(); this.dnbCountingData()
}, },
// //
cancel() { cancel() {
this.open = false; this.open = false
this.reset(); this.reset()
}, },
// //
reset() { reset() {
this.form = { this.form = {
userId: undefined, objid: null,
deptId: undefined, monitorId: null,
userName: undefined, instrumentValue: null,
nickName: undefined, monitorName: null,
password: undefined, pMonitorId: null,
phonenumber: undefined, address: null,
email: undefined, expend: null,
sex: undefined, price: null,
status: "0", pointTime: null,
remark: undefined, beginTime: null,
postIds: [], endTime: null,
roleIds: [], recordTime: null,
}; meterValue: null,
this.resetForm("form"); collectType: null
}
this.resetForm('form')
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1
this.getList(); this.getList()
this.dnbCountingData(); this.dnbCountingData()
}, },
//**** */ //**** */
dnbCountingData() { dnbCountingData() {
this.loading = true; this.loading = true
dnbCountingData({ dnbCountingData({
beginCollectTime: this.queryParams.params.beginCollectTime, beginCollectTime: this.queryParams.params.beginCollectTime,
endCollectTime: this.queryParams.params.endCollectTime, endCollectTime: this.queryParams.params.endCollectTime,
type: this.queryParams.dateType, type: this.queryParams.dateType,
publicShareType: this.queryParams.publicShareType, publicShareType: this.queryParams.publicShareType,
monitorSubset: this.queryParams.monitorSubset, monitorSubset: this.queryParams.monitorSubset,
energyType: 2, energyType: 2
}).then((response) => { }).then((response) => {
this.option.xAxis.data = response.data.dateList; this.option.xAxis.data = response.data.dateList
this.option.series[0].data = response.data.valueList; this.option.series[0].data = response.data.valueList
// this.total = response.total; // this.total = response.total;
// this.loading = false; // this.loading = false;
// var chartDom = document.getElementById('card'); // var chartDom = document.getElementById('card');
@ -578,56 +645,56 @@ export default {
// ] // ]
// }; // };
// this.option = option; // this.option = option;
var chartDom = document.getElementById("card"); var chartDom = document.getElementById('card')
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom)
this.option && myChart.setOption(this.option); this.option && myChart.setOption(this.option)
}); })
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
// this.dateRange = []; // this.dateRange = [];
this.resetForm("queryForm"); this.resetForm('queryForm')
this.dateRangeone = this.baoliudateRangeone; this.dateRangeone = this.baoliudateRangeone
this.dateRangetwo = this.baoliudateRangetwo; this.dateRangetwo = this.baoliudateRangetwo
//this.queryParams.deptId = undefined; //this.queryParams.deptId = undefined;
//this.$refs.tree.setCurrentKey(null); //this.$refs.tree.setCurrentKey(null);
this.getList(); this.getList()
//this.handleQuery(); //this.handleQuery();
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map((item) => item.userId); this.ids = selection.map((item) => item.userId)
this.single = selection.length != 1; this.single = selection.length != 1
this.multiple = !selection.length; this.multiple = !selection.length
}, },
// //
handleCommand(command, row) { handleCommand(command, row) {
switch (command) { switch (command) {
case "handleResetPwd": case 'handleResetPwd':
this.handleResetPwd(row); this.handleResetPwd(row)
break; break
case "handleAuthRole": case 'handleAuthRole':
this.handleAuthRole(row); this.handleAuthRole(row)
break; break
default: default:
break; break
} }
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
let paramsexport = JSON.parse(JSON.stringify(this.queryParams)); let paramsexport = JSON.parse(JSON.stringify(this.queryParams))
delete paramsexport.pageNum; delete paramsexport.pageNum
delete paramsexport.pageSize; delete paramsexport.pageSize
this.download( this.download(
"/energy/report/pointDnb/export", '/energy/report/pointDnb/export',
{ {
...paramsexport, ...paramsexport,
orderByColumn: null, orderByColumn: null
}, },
`user_${new Date().getTime()}.xlsx` `user_${new Date().getTime()}.xlsx`
); )
}, }
}, }
}; }
</script> </script>

Loading…
Cancel
Save