|
@@ -1,903 +0,0 @@
|
|
|
-<template>
|
|
|
- <div id="register">
|
|
|
- <!-- 水价管理 -->
|
|
|
- <div class="head">
|
|
|
- <el-row>
|
|
|
- <!-- 头部查询栏左边 -->
|
|
|
- <el-col :span="20">
|
|
|
- <el-row type="flex" :gutter="10">
|
|
|
- <!--
|
|
|
- <el-col :span="4">
|
|
|
- <el-select v-model="query.waterworksId" placeholder="所在水厂" size="small" style="width:100%" clearable @change="queryWarehouseData">
|
|
|
- <el-option v-for="(item, index) in waterData" :key="index" :label="item.name" :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="4">
|
|
|
- <el-select v-model="query.storeId" placeholder="存放仓库" size="small" style="width:100%" clearable>
|
|
|
- <el-option v-for="(item, index) in warehouseData" :key="index" :label="item.storeName" :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="4">
|
|
|
- <el-select v-model="query.materialTypeId" placeholder="设备类型" size="small" style="width:100%" clearable>
|
|
|
- <el-option v-for="(item, index) in materialTypeData" :key="index" :label="item.materialTypeName" :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-col>
|
|
|
- -->
|
|
|
- <el-col :span="6">
|
|
|
- <el-input v-model="query.materialInfo" placeholder="水价编码、水价名称、用水类型" size="small" style="width:100%" clearable></el-input>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="2">
|
|
|
- <el-button type="primary" size="small" icon="el-icon-search" @click="doQuery">查询</el-button>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-col>
|
|
|
- <!-- 头部查询栏右边 -->
|
|
|
- <el-col :span="4">
|
|
|
- <el-row type="flex" class="row-bg" justify="end">
|
|
|
- <el-button type="primary" size="small" icon="el-icon-plus" @click="add">新 增</el-button>
|
|
|
- <el-button type="primary" size="small" icon="el-icon-edit" :disabled="disabledBtn" @click="editor">修 改</el-button>
|
|
|
- <el-button type="danger" size="small" icon="el-icon-delete" :disabled="disabledBtn2" @click="deleteByIds">删 除</el-button>
|
|
|
- </el-row>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 表格 -->
|
|
|
- <div class="table_width">
|
|
|
- <table-item
|
|
|
- :table-data="list"
|
|
|
- :column="column"
|
|
|
- :pagination="true"
|
|
|
- :pagesize="pagination.size"
|
|
|
- :currentpage="pagination.current"
|
|
|
- :tableheight="Number(tableheight)"
|
|
|
- :border="true"
|
|
|
- :multiple="true" :stripe="true" :total="pagination.total"
|
|
|
- :fixed="false"
|
|
|
- :isdelete="true"
|
|
|
- forId
|
|
|
- @handleCurrentChange="handleCurrentChange"
|
|
|
- @handleSizeChange="handleSizeChange"
|
|
|
- @handleSelectionChange="handleSelectionChange"
|
|
|
- @detail="detail"
|
|
|
- v-loading="loading"/>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 水价管理表单 -->
|
|
|
- <el-dialog v-if="dialogVisible" v-dialogDrag top="20vh" :title="dialogVisibleTitle" :visible.sync="dialogVisible" width="1000px" class="dialog">
|
|
|
- <div style="width: 100%; height: auto">
|
|
|
-
|
|
|
- <tf-title>基本信息</tf-title>
|
|
|
-
|
|
|
- <el-form :model="form" label-width="80px" size="small" ref="form" :rules="formRules">
|
|
|
- <!--
|
|
|
- <el-row>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="设备名称" prop="deviceName">
|
|
|
- <el-input v-model="form.deviceName" style="width:100%" placeholder="点击选择设备名称" :disabled="editState" @focus="selectClient"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- -->
|
|
|
- <el-row>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="所在水厂" prop="waterworksName">
|
|
|
- <el-input v-model="form.waterworksName" style="width:100%" placeholder="水厂名称" :disabled="nameEditState" ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="所属仓库" prop="wareHouse">
|
|
|
- <el-input v-model="form.storeName" style="width:100%" placeholder="仓库名称" :disabled="nameEditState" ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="设备类型" prop="materialTypeName">
|
|
|
- <el-input v-model="form.materialTypeName" style="width:100%" placeholder="设备类型" :disabled="nameEditState"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="规格型号" prop="deviceSpecsModel">
|
|
|
- <el-input v-model="form.deviceSpecsModel" style="width:100%" placeholder="规格型号" :disabled="nameEditState"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="单位" prop="deviceUnitName">
|
|
|
- <el-input v-model="form.deviceUnitName" style="width:100%" placeholder="单位"
|
|
|
- :disabled="nameEditState"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="入库日期" prop="instockTime">
|
|
|
- <el-input v-model="form.instockTime" style="width:100%" placeholder="入库日期"
|
|
|
- :disabled="nameEditState"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="入库数量" prop="instockNum">
|
|
|
- <el-input v-model="form.instockNum" style="width:100%" placeholder="入库数量"
|
|
|
- :disabled="nameEditState"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="采购单价" prop="unitPrice">
|
|
|
- <el-input v-model="form.unitPrice" style="width:100%" placeholder="采购单价" :disabled="nameEditState"><i slot="suffix"
|
|
|
- style="font-style: normal; margin-right: 10px; line-height: 36px">元</i></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="采购总价" prop="totalPrice">
|
|
|
- <el-input v-model="form.totalPrice" style="width:100%" placeholder="采购总价" :disabled="nameEditState"><i slot="suffix"
|
|
|
- style="font-style: normal; margin-right: 10px; line-height: 36px">元</i></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <tf-title>折旧信息</tf-title>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="折旧方式" prop="depreciateType">
|
|
|
- <el-select v-model="form.depreciateType" placeholder="请选择折旧方式" size="small" clearable :disabled="editState" style="width: 100%;" @change="choiceType">
|
|
|
- <el-option v-for="(item,index) in equipmentDepreciateTypes" :key="item.index" :label="item.cname" :value="item.ccode">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="折旧数值" prop="depreciateValue" :rules="valueRequired">
|
|
|
- <el-input v-model="form.depreciateValue" style="width:100%" placeholder="折旧数值" :disabled="valueEditState"
|
|
|
- type="number">
|
|
|
- <i slot="suffix" style="font-style: normal; margin-right: 10px; line-height: 36px" v-if="valueShow1">元</i>
|
|
|
- <i slot="suffix" style="font-style: normal; margin-right: 10px; line-height: 36px" v-if="valueShow2">%</i></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="入库月数" prop="inStockMonth">
|
|
|
- <el-input v-model="form.inStockMonth" style="width:100%" placeholder="入库月数"
|
|
|
- :disabled="nameEditState"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="当前价值" prop="currentPrice">
|
|
|
- <el-input v-model="form.currentPrice" style="width:100%" placeholder="当前价值" :disabled="nameEditState"><i
|
|
|
- slot="suffix" style="font-style: normal; margin-right: 10px; line-height: 36px">元</i></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <!-- <el-col :span="8">
|
|
|
- <el-form-item label="折旧价值" prop="depreciatePrice">
|
|
|
- <el-input v-model="form.depreciatePrice" style="width:100%" placeholder="折旧价值"
|
|
|
- :disabled="nameEditState"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col> -->
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
-
|
|
|
- </div>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" size="small" class="throttle" @click="submit()" v-if="isShow">确 定</el-button>
|
|
|
- <el-button type="primary" size="small" @click="dialogVisible=false">关 闭</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <!-- 选择设备表单 -->
|
|
|
- <el-dialog v-if="dialogVisibleEquipment" v-dialogDrag top="15vh" title="选择设备" :visible.sync="dialogVisibleEquipment" width="1000px" class="dialog">
|
|
|
- <div style="width: 100%; height: auto">
|
|
|
-
|
|
|
- <!-- 搜索框 -->
|
|
|
- <el-row>
|
|
|
- <!-- 头部查询栏左边 -->
|
|
|
- <el-col :span="24">
|
|
|
- <el-row type="flex" :gutter="10">
|
|
|
- <el-col :span="4">
|
|
|
- <el-select v-model="queryDevice.waterworksId" placeholder="所在水厂" size="small" style="width:100%" clearable @change="queryWarehouseData">
|
|
|
- <el-option v-for="(item, index) in waterData" :key="index" :label="item.name" :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="4">
|
|
|
- <el-select v-model="queryDevice.storeId" placeholder="存放仓库" size="small" style="width:100%" clearable>
|
|
|
- <el-option v-for="(item, index) in warehouseData" :key="index" :label="item.storeName" :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="6">
|
|
|
- <el-input v-model="queryDevice.materialInfo" placeholder="设备类型、名称、规格" size="small" style="width:100%" clearable></el-input>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="6">
|
|
|
- <!-- <el-date-picker v-model="queryDevice.times" size="small" type="daterange" unlink-panels range-separator="至"
|
|
|
- start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" clearable/> -->
|
|
|
- <el-date-picker v-model="queryDevice.times" type="daterange" size="small" style="width:100%" clearable range-separator="至"
|
|
|
- start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd 00:00:00"></el-date-picker>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="2">
|
|
|
- <el-button type="primary" size="small" icon="el-icon-search" @click="queryDepreciateData">查询</el-button>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <!-- 物资入库中的设备 -->
|
|
|
- <el-table
|
|
|
- ref = "equipmentDepreciateData"
|
|
|
- highlight-current-row
|
|
|
- id="siteMonitor"
|
|
|
- :total="pageInfo.total"
|
|
|
- class="mapTable"
|
|
|
- :data="equipmentDepreciateData"
|
|
|
- border
|
|
|
- style="margin-top: 5px;">
|
|
|
- <!-- 列 -->
|
|
|
- <el-table-column type="index" align="center" width="50" label="序号" />
|
|
|
-
|
|
|
- <!----> <el-table-column prop="waterworksName"
|
|
|
- align="center"
|
|
|
- label="所在水厂"
|
|
|
- show-overflow-tooltip />
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- prop="storeName"
|
|
|
- align="center"
|
|
|
- label="存放仓库"
|
|
|
- show-overflow-tooltip />
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- prop="materialTypeName"
|
|
|
- align="center"
|
|
|
- label="设备类型"
|
|
|
- show-overflow-tooltip />
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- prop="deviceName"
|
|
|
- align="center"
|
|
|
- label="设备名称"
|
|
|
- show-overflow-tooltip />
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- prop="deviceSpecsModel"
|
|
|
- align="center"
|
|
|
- label="规格型号"
|
|
|
- show-overflow-tooltip />
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- prop="deviceUnitName"
|
|
|
- align="center"
|
|
|
- label="单位"
|
|
|
- show-overflow-tooltip />
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- prop="instockTime"
|
|
|
- align="center"
|
|
|
- label="入库日期"
|
|
|
- show-overflow-tooltip />
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- prop="unitPrice"
|
|
|
- align="center"
|
|
|
- label="采购单价"
|
|
|
- show-overflow-tooltip>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- prop="totalPrice"
|
|
|
- align="center"
|
|
|
- label="采购总价"
|
|
|
- show-overflow-tooltip>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column align="center" label="选择" show-overflow-tooltip>
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" @click="choice(scope.row)">选择</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- </el-table>
|
|
|
-
|
|
|
- <el-row style="margin-top: 10px">
|
|
|
- <el-col :span="24">
|
|
|
- <div style="float: left;">
|
|
|
- <el-pagination ref="pagination" small layout="total, sizes, prev, pager, next, jumper" :pager-count="5"
|
|
|
- :current-page="pageInfo.current" :page-sizes="[1, 10, 20, 30]" style="margin-top: 4px"
|
|
|
- :page-size="pageInfo.size" :total="pageInfo.total" @size-change="handleSizeChange1"
|
|
|
- @current-change="handleCurrentChange1" />
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- <div style="float: right;">
|
|
|
- <el-button type="primary" size="small" class="throttle" @click="commit()">确 定</el-button>
|
|
|
- <el-button type="primary" size="small" @click="dialogVisibleEquipment=false">关 闭</el-button>
|
|
|
- </div> -->
|
|
|
-
|
|
|
- </el-col>
|
|
|
-
|
|
|
- </el-row>
|
|
|
-
|
|
|
-
|
|
|
- </div>
|
|
|
- <!-- <span slot="footer" class="dialog-footer" >
|
|
|
- <el-button type="primary" size="small" class="throttle" @click="commit()">确 定</el-button>
|
|
|
- <el-button type="primary" size="small" @click="dialogVisibleEquipment=false">关 闭</el-button>
|
|
|
- </span> -->
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
-
|
|
|
- </div>
|
|
|
- </template>
|
|
|
-
|
|
|
- <script>
|
|
|
- import { client } from "@/utils/index";
|
|
|
- import TableItem from "@/components/Table";
|
|
|
-
|
|
|
- import { addEquipmentDepreciation, getEquipmentDepreciationPage, editEquipmentDepreciation, deleteEquipmentDepreciation, getEquipmentDepreciateList } from "@/api/dcApi/inventoryApi";
|
|
|
- import {getWaterData} from "@/api/dispatch/dispatch";
|
|
|
- import { getInventoryManagePage } from "@/api/dcApi/inventoryApi";
|
|
|
- import {getPutstockinfo,getMaterialtypeList} from "@/api/storeApi/stroreApi";
|
|
|
- // 引入字典查询接口
|
|
|
- import { getCommonCode } from "@/api/base";
|
|
|
-
|
|
|
- export default {
|
|
|
- components: { TableItem },
|
|
|
- name:"equipmentDepreciation",
|
|
|
- data() {
|
|
|
- return {
|
|
|
-
|
|
|
- isShow:true,
|
|
|
- // 水厂数据
|
|
|
- waterData : [],
|
|
|
- // 仓库数据
|
|
|
- warehouseData : [],
|
|
|
- // 物资类型数据
|
|
|
- materialTypeData:[],
|
|
|
- // 入库数据
|
|
|
- tableDataIn:[],
|
|
|
- // 设备数据
|
|
|
- equipmentDepreciateData: [],
|
|
|
- // 折旧类型数据
|
|
|
- equipmentDepreciateTypes: [],
|
|
|
-
|
|
|
- pagination: { current: 1, size: 20, total: 0 },
|
|
|
- pageInfo: { current: 1, size: 10, total: 0 }, // 分页数据
|
|
|
- dialogVisible: false,
|
|
|
- // 设备选择
|
|
|
- dialogVisibleEquipment: false,
|
|
|
- // 控制折旧数值是否显示
|
|
|
- valueEditState:false,
|
|
|
- // 控制折旧数值是否必填
|
|
|
- valueRequired:[{ required: true, message: "请输入折旧数值", trigger: "blur" }],
|
|
|
- // 控制折旧方式的不同,折旧价值单位不同的显示
|
|
|
- valueShow1:false,
|
|
|
- valueShow2:false,
|
|
|
- list: [],
|
|
|
- form: {
|
|
|
- deviceName:"",
|
|
|
- depreciateType:"",
|
|
|
- depreciateValue:"",
|
|
|
- inStockMonth:"",
|
|
|
- currentPrice:""
|
|
|
- },
|
|
|
- formRules:{
|
|
|
- deviceName:[
|
|
|
- { required: true, message: "请选择设备名称", trigger: "change" },
|
|
|
- ],
|
|
|
- depreciateType:[
|
|
|
- { required: true, message: "请选择折旧方式", trigger: "blur" },
|
|
|
- ],
|
|
|
- },
|
|
|
- query: {
|
|
|
- waterworksId:"",
|
|
|
- storeId:"",
|
|
|
- materialTypeId:"",
|
|
|
- // 水价信息
|
|
|
- materialInfo: "",
|
|
|
- },
|
|
|
-
|
|
|
- queryDevice: {
|
|
|
- waterworksId: "",
|
|
|
- storeId: "",
|
|
|
- // 物资信息
|
|
|
- materialInfo: "",
|
|
|
- // 入库时间
|
|
|
- times:[],
|
|
|
- },
|
|
|
-
|
|
|
- column: [
|
|
|
- {
|
|
|
- label: "公司",
|
|
|
- type: "index",
|
|
|
- sortable: true
|
|
|
- },
|
|
|
- {
|
|
|
- label: "水价编码",
|
|
|
- prop: "CODE"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "水价名称",
|
|
|
- prop: "NAME",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "用水类型",
|
|
|
- prop: "USE_WATER_TYPE"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "水价",
|
|
|
- prop: "PRICE"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "污水费单价",
|
|
|
- prop: "SEWAGE_FEE_PRICE"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "垃圾费单价",
|
|
|
- prop: "GARBAGE_FEE_PRICE"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "阶梯计算类型",
|
|
|
- prop: "TIERED_CAL_TYPE"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "阶梯计算方式",
|
|
|
- prop: "TIERED_CAL_MODE"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "税率",
|
|
|
- prop: "TAX_RATE"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "是否启用",
|
|
|
- prop: "ISDISABLED"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "操作人员",
|
|
|
- prop: "OCODE"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "创建时间",
|
|
|
- prop: "CDATE"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "备注",
|
|
|
- prop: "REMARK"
|
|
|
- },
|
|
|
- {
|
|
|
- slotScoped: 'action',
|
|
|
- label: '操作',
|
|
|
- acts: [{ emitWay: 'detail', color: '#0000FF', operation: '详情' }]
|
|
|
- },
|
|
|
- ],
|
|
|
- opType: true,
|
|
|
- disabledBtn: true,
|
|
|
- disabledBtn2: true,
|
|
|
- dispatchs: [],
|
|
|
- editData:[],
|
|
|
-
|
|
|
- multipleSelection: [],
|
|
|
-
|
|
|
- // 控制设备折旧表单是否能输入
|
|
|
- nameEditState:false,
|
|
|
- editState:false,
|
|
|
-
|
|
|
- // 选中的设备数据
|
|
|
- choiceData:{},
|
|
|
- //折旧id
|
|
|
- depreciateId:"",
|
|
|
- // xuanze
|
|
|
- multipleSelectionId:"",
|
|
|
-
|
|
|
- // 控制表格查询时显示
|
|
|
- loading:false,
|
|
|
- };
|
|
|
- },
|
|
|
-
|
|
|
- computed: {
|
|
|
- // mapHeight() {
|
|
|
- // return client().height - 150 - client().height * 0.1 + "px";
|
|
|
- // },
|
|
|
- tableheight() {
|
|
|
- return client().height - 230 ;
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- watch: {
|
|
|
- multipleSelection(value) {
|
|
|
- this.disabledBtn = this.multipleSelection.length !== 1;
|
|
|
- this.disabledBtn2 = this.multipleSelection.length == 0;
|
|
|
- },
|
|
|
- },
|
|
|
-
|
|
|
- created() { },
|
|
|
-
|
|
|
- mounted() {
|
|
|
- this.getExpertPage();
|
|
|
- this.queryWaterData();
|
|
|
- this.queryInStoreData();
|
|
|
- this.queryMaterialType();
|
|
|
- this.getSelectOptions();
|
|
|
- },
|
|
|
-
|
|
|
- methods: {
|
|
|
- /**
|
|
|
- * 获取下拉菜单
|
|
|
- */
|
|
|
- async getSelectOptions() {
|
|
|
- const getCodeList = async (pcid, arrName) => {
|
|
|
- await getCommonCode({ pCid: pcid }).then(res => {
|
|
|
- if (res.code != 1 && res.result.length == 0) return
|
|
|
- this[arrName] = res.result[0].codeList
|
|
|
- })
|
|
|
- }
|
|
|
- // 工程类型 66305
|
|
|
- await getCodeList('66317', 'equipmentDepreciateTypes');
|
|
|
- },
|
|
|
-
|
|
|
- // 查询水厂数据
|
|
|
- queryWaterData() {
|
|
|
- let params = {
|
|
|
- size: this.pagination.size,
|
|
|
- current: this.pagination.current
|
|
|
- };
|
|
|
- getWaterData(params).then((res) => {
|
|
|
- // console.log("水厂" + JSON.stringify(res));
|
|
|
- this.waterData = res.result.records;
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- // 查询仓库数据
|
|
|
- queryWarehouseData(waterworksId) {
|
|
|
- let params = {
|
|
|
- size: this.pagination.size,
|
|
|
- current: this.pagination.current,
|
|
|
- waterworksId:waterworksId,
|
|
|
- };
|
|
|
- getInventoryManagePage(params).then((res) => {
|
|
|
- // console.log("仓库" + JSON.stringify(res));
|
|
|
- this.warehouseData = res.result.records;
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- // 查询物资类型数据
|
|
|
- queryMaterialType() {
|
|
|
- let params = {
|
|
|
- size: this.pagination.size,
|
|
|
- current: this.pagination.current
|
|
|
- };
|
|
|
- getMaterialtypeList(params).then((res) => {
|
|
|
- // console.log("物资类型" + JSON.stringify(res));
|
|
|
- this.materialTypeData = res.result;
|
|
|
- this.materialTypeData = res.result.filter((item) => {
|
|
|
- return item.materialCategoryId == 62002;
|
|
|
- });
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- // 查询入库数据
|
|
|
- queryInStoreData() {
|
|
|
- let params = {
|
|
|
- size: this.pageInfo.size,
|
|
|
- current: this.pageInfo.current
|
|
|
- };
|
|
|
- getPutstockinfo(params).then((res) => {
|
|
|
- // console.log("入库数据" + JSON.stringify(res));
|
|
|
- this.tableDataIn = res.result.records.map((item) => {
|
|
|
- item.instockTime = item.instockTime.substr(0,10);
|
|
|
- return item;
|
|
|
- });
|
|
|
- this.pageInfo.total = parseInt(res.result.total);
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- queryDepreciateData(){
|
|
|
- this.queryEquipmentDepreciateData(this.opType);
|
|
|
- },
|
|
|
-
|
|
|
- // 查询设备数据
|
|
|
- queryEquipmentDepreciateData(isTrue) {
|
|
|
- let depreciateId = "";
|
|
|
- if(isTrue) depreciateId = 0;
|
|
|
- else depreciateId = this.multipleSelectionId;
|
|
|
- let params = {
|
|
|
- size: this.pageInfo.size,
|
|
|
- current: this.pageInfo.current,
|
|
|
- id:depreciateId,
|
|
|
- };
|
|
|
- if (this.queryDevice.waterworksId) params["waterworksId"] = this.queryDevice.waterworksId;
|
|
|
- if (this.queryDevice.storeId) params["storeId"] = this.queryDevice.storeId;
|
|
|
- if (this.queryDevice.materialInfo) params["searchValue"] = this.queryDevice.materialInfo;
|
|
|
- if (this.queryDevice.times && this.queryDevice.times?.length == 2) {
|
|
|
- params["inStockTimeStart"] = this.queryDevice.times[0];
|
|
|
- params["inStockTimeEnd"] = this.queryDevice.times[1];
|
|
|
- };
|
|
|
-
|
|
|
- params["deviceType"] = 62002;
|
|
|
- getEquipmentDepreciateList(params).then((res) => {
|
|
|
- // console.log("设备数据" + JSON.stringify(res));
|
|
|
- this.equipmentDepreciateData = res.result.records.map((item) => {
|
|
|
- item.instockTime = item.instockTime.substr(0,10);
|
|
|
- return item;
|
|
|
- });
|
|
|
- this.pageInfo.total = res.result.total;
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 分页查询
|
|
|
- */
|
|
|
- getExpertPage() {
|
|
|
- let params = JSON.parse(JSON.stringify(this.pagination));
|
|
|
- if (this.query.waterworksId) params["waterworksId"] = this.query.waterworksId;
|
|
|
- if (this.query.storeId) params["storeId"] = this.query.storeId;
|
|
|
- if (this.query.materialTypeId) params["materialTypeId"] = this.query.materialTypeId;
|
|
|
- if (this.query.materialInfo) params["searchValue"] = this.query.materialInfo;
|
|
|
- params["deviceType"] = 62002;
|
|
|
- this.loading = true;
|
|
|
- getEquipmentDepreciationPage(params).then(res => {
|
|
|
- if (res.code == 1) {
|
|
|
- this.list = res.result.records;
|
|
|
- this.pagination.total = parseInt(res.result.total);
|
|
|
- this.list = this.list.map((item) => {
|
|
|
- item['depreciateTypeName'] = this.equipmentDepreciateTypes.find(el => { return el.ccode == item.depreciateType })?.cname || '--'; // 折旧方式
|
|
|
- return item;
|
|
|
- });
|
|
|
- this.list = this.list.map((item) => {
|
|
|
- item.instockTime = item.instockTime.substr(0,10);
|
|
|
- return item;
|
|
|
- });
|
|
|
- }
|
|
|
- else{
|
|
|
- this.$message.error("查询失败!");
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((er) => {
|
|
|
- this.$message.error("查询失败!");
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- this.loading = false;
|
|
|
- })
|
|
|
- },
|
|
|
- doQuery() {
|
|
|
- // this.pagination.current = 1;
|
|
|
- this.getExpertPage();
|
|
|
- },
|
|
|
- /**
|
|
|
- * 删除
|
|
|
- */
|
|
|
- deleteByIds() {
|
|
|
- const ids = this.multipleSelection.map(item => { return item.id })
|
|
|
- this.$confirm('确定删除设备折旧?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- deleteEquipmentDepreciation({ ids: ids.join(',') }).then(res => {
|
|
|
- if (res.code == 1) {
|
|
|
- this.getExpertPage();
|
|
|
- this.$message.success("删除设备折旧信息成功");
|
|
|
- this.dialogVisible = false;
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- // 新增
|
|
|
- add() {
|
|
|
- this.opType = true
|
|
|
- this.dialogVisibleTitle = "新增水价编码";
|
|
|
- this.dialogVisible = true;
|
|
|
- this.editState = false;
|
|
|
- this.nameEditState = true;
|
|
|
- this.isShow = true;
|
|
|
- // 重置表单
|
|
|
- this.form = this.$options.data().form;
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.form.clearValidate()
|
|
|
- })
|
|
|
- },
|
|
|
- // 修改
|
|
|
- editor() {
|
|
|
- this.multipleSelectionId = this.multipleSelection[0].id;
|
|
|
- this.opType = false;
|
|
|
- this.dialogVisibleTitle = "修改水价编码";
|
|
|
-
|
|
|
- this.dialogVisible = true;
|
|
|
- this.editState = false;
|
|
|
- this.nameEditState = true;
|
|
|
- this.isShow = true;
|
|
|
- this.choiceType(this.multipleSelection[0].depreciateType);
|
|
|
- // 深拷贝
|
|
|
- this.form = JSON.parse(JSON.stringify(this.multipleSelection[0]))
|
|
|
- },
|
|
|
- /**
|
|
|
- * 新增
|
|
|
- */
|
|
|
- addExpert() {
|
|
|
- const deviceDepreciate = {
|
|
|
- instockDetailId : this.form.instockDetailId,
|
|
|
- depreciateType : this.form.depreciateType,
|
|
|
- depreciateValue : this.form.depreciateValue,
|
|
|
-
|
|
|
- }
|
|
|
- addEquipmentDepreciation(deviceDepreciate).then(res => {
|
|
|
- if (res.code == 1) {
|
|
|
- this.getExpertPage();
|
|
|
- this.$message.success("新增水价编码信息成功");
|
|
|
- // 重置
|
|
|
- this.form = this.$options.data().form
|
|
|
- this.dialogVisible = false;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- /**
|
|
|
- * 修改
|
|
|
- */
|
|
|
- putExpert() {
|
|
|
- // const data = JSON.parse(JSON.stringify(this.form));
|
|
|
- const deviceDepreciate = {
|
|
|
- id : this.form.id,
|
|
|
- instockDetailId : this.form.instockDetailId,
|
|
|
- depreciateType : this.form.depreciateType,
|
|
|
- depreciateValue : this.form.depreciateValue,
|
|
|
- };
|
|
|
- editEquipmentDepreciation(deviceDepreciate).then(res => {
|
|
|
- if (res.code == 1) {
|
|
|
- this.getExpertPage();
|
|
|
- this.$message.success("修改水价编码信息成功");
|
|
|
- this.form = this.$options.data().form
|
|
|
- this.dialogVisible = false;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- // 选择
|
|
|
- handleSelectionChange(value) {
|
|
|
- this.multipleSelection = value
|
|
|
- },
|
|
|
- /**
|
|
|
- * 新增修改提交
|
|
|
- */
|
|
|
- submit() {
|
|
|
- this.$refs.form.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- if (this.opType) this.addExpert() // 新增
|
|
|
- else this.putExpert() // 修改
|
|
|
- } else {
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- // 详细
|
|
|
- detail(val) {
|
|
|
- // console.log("xiangxi "+JSON.stringify(val));
|
|
|
- this.isShow = false;
|
|
|
- val.id ? this.editData = val : this.editData = this.multipleSelection[0];
|
|
|
- this.dialogVisibleTitle = "设备折旧详情";
|
|
|
- this.dialogVisible = true;
|
|
|
- this.nameEditState = true;
|
|
|
- this.editState = true;
|
|
|
- this.valueEditState = true;
|
|
|
-
|
|
|
-
|
|
|
- this.choiceType(val.depreciateType);
|
|
|
- this.form = {...this.multipleSelection[0]};
|
|
|
- this.form = {...val};
|
|
|
- this.valueEditState = true;
|
|
|
- },
|
|
|
-
|
|
|
- // 选择设备
|
|
|
- selectClient(){
|
|
|
- this.dialogVisibleEquipment = true;
|
|
|
- this.queryEquipmentDepreciateData(this.opType);
|
|
|
- },
|
|
|
-
|
|
|
- // 选择具体设备
|
|
|
- choice(row){
|
|
|
- // console.log("选中的数据"+JSON.stringify(row));
|
|
|
- this.choiceData = row;
|
|
|
-
|
|
|
- this.dialogVisibleEquipment = false;
|
|
|
- // this.form = {...this.choiceData};
|
|
|
- this.form.instockDetailId = this.choiceData.instockDetailId;
|
|
|
- this.form.deviceName = this.choiceData.deviceName;
|
|
|
- this.form.waterworksName = this.choiceData.waterworksName;
|
|
|
- this.form.storeName = this.choiceData.storeName;
|
|
|
- this.form.materialTypeName = this.choiceData.materialTypeName;
|
|
|
- this.form.deviceSpecsModel = this.choiceData.deviceSpecsModel;
|
|
|
- this.form.deviceUnitName = this.choiceData.deviceUnitName;
|
|
|
- this.form.instockTime = this.choiceData.instockTime;
|
|
|
- this.form.instockNum = this.choiceData.instockNum;
|
|
|
- this.form.unitPrice = this.choiceData.unitPrice;
|
|
|
- this.form.totalPrice = this.choiceData.totalPrice;
|
|
|
- this.form.inStockYear = "";
|
|
|
- },
|
|
|
-
|
|
|
- // 选择折旧方式
|
|
|
- choiceType(val){
|
|
|
- // console.log("折旧方式"+JSON.stringify(val));
|
|
|
- if(val == 1){
|
|
|
- // 是否能编辑
|
|
|
- this.valueEditState = true;
|
|
|
- // 是否能验证
|
|
|
- this.valueRequired = false;
|
|
|
- this.form.depreciateValue = 0;
|
|
|
- this.valueRequired = [{ required: false }];
|
|
|
- }else{
|
|
|
- this.valueEditState = false;
|
|
|
- this.valueRequired = true;
|
|
|
- this.form.depreciateValue = "";
|
|
|
- this.valueRequired = [{ required: true, message: "请输入折旧数值", trigger: "blur" }];
|
|
|
- };
|
|
|
-
|
|
|
- if(val == 1 || val == 2 || val == 3){
|
|
|
- // 根据不同的折旧方式显示不同的单位
|
|
|
- this.valueShow1 = true;
|
|
|
- this.valueShow2 = false;
|
|
|
- }else if(val == 4 || val == 5){
|
|
|
- this.valueShow1 = false;
|
|
|
- this.valueShow2 = true;
|
|
|
- };
|
|
|
- },
|
|
|
-
|
|
|
- handleCurrentChange(current) {
|
|
|
- this.pagination.current = current
|
|
|
- this.doQuery()
|
|
|
- },
|
|
|
- handleSizeChange(size) {
|
|
|
- this.pagination.size = size
|
|
|
- this.doQuery()
|
|
|
- },
|
|
|
-
|
|
|
- handleCurrentChange1(current) {
|
|
|
- this.pageInfo.current = current
|
|
|
- this.queryEquipmentDepreciateData(this.opType)
|
|
|
- },
|
|
|
- handleSizeChange1(size) {
|
|
|
- this.pageInfo.size = size
|
|
|
- this.queryEquipmentDepreciateData(this.opType)
|
|
|
- },
|
|
|
- }
|
|
|
- };
|
|
|
- </script>
|
|
|
-
|
|
|
- <style lang="scss" scoped>
|
|
|
- #register {
|
|
|
- padding: 20px 30px;
|
|
|
- .head {
|
|
|
- margin-bottom: 10px;
|
|
|
- }
|
|
|
- .dialog_style {
|
|
|
- margin-top: 20px;
|
|
|
- width: 100%;
|
|
|
- overflow: hidden;
|
|
|
- /deep/ .el-table {
|
|
|
- text-align: center;
|
|
|
- vertical-align: middle;
|
|
|
- }
|
|
|
- }
|
|
|
- /deep/ .dialog > div > div:nth-child(2) {
|
|
|
- padding: 10px 20px;
|
|
|
- }
|
|
|
- .delete {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
- :nth-child(1) {
|
|
|
- font-size: 50px;
|
|
|
- color: red;
|
|
|
- margin-bottom: 10px;
|
|
|
- }
|
|
|
- p {
|
|
|
- font-size: 20px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .flexs {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
- }
|
|
|
- .inputTitle {
|
|
|
- display: block;
|
|
|
- height: 40px;
|
|
|
- line-height: 40px;
|
|
|
- text-align-last: justify;
|
|
|
- font-weight: 700;
|
|
|
- }
|
|
|
- </style>
|