|
@@ -1,11 +1,13 @@
|
|
|
<template>
|
|
|
<div id="deviceList">
|
|
|
<el-row>
|
|
|
- <el-tabs @tab-click="handleClick" v-model="tabVal">
|
|
|
- <el-tab-pane label="用户管理" name="first"></el-tab-pane>
|
|
|
- <el-tab-pane label="配置管理" name="second"></el-tab-pane>
|
|
|
- <el-tab-pane label="角色管理" name="third"></el-tab-pane>
|
|
|
- <el-tab-pane label="定时任务补偿" name="fourth"></el-tab-pane>
|
|
|
+ <el-tabs @tab-click="tabsClick" v-model="tabVal">
|
|
|
+ <el-tab-pane
|
|
|
+ v-for="t in partsTypeList"
|
|
|
+ :key="t.Id"
|
|
|
+ :name="t.Code"
|
|
|
+ :label="t.Name+'('+t.Count+')'"
|
|
|
+ ></el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-row>
|
|
|
<el-row class="right">
|
|
@@ -37,29 +39,88 @@
|
|
|
:page-sizes="page.pageSizes"
|
|
|
:page-size="page.pageSize"
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="page.total">
|
|
|
- </el-pagination>
|
|
|
+ :total="page.total"
|
|
|
+ ></el-pagination>
|
|
|
+ <!-- 二维码弹窗 -->
|
|
|
+ <qrcode :dialog="myDialog" :qrcodeUrl="qrcodeUrl" :addBody="true" ref="qrcode"></qrcode>
|
|
|
+ <!-- 型号弹窗 -->
|
|
|
+ <firm :mess="{deviceId: firmId}" ref="firm" @changeFirm="firmChange" :dialog="myDialog"></firm>
|
|
|
+ <!-- 供应商合同弹窗 -->
|
|
|
+ <supply-dialog ref="supply" @change="supplyChange" :id="id" :dialog="myDialog"></supply-dialog>
|
|
|
+ <!-- 供应商弹窗 -->
|
|
|
+ <supplier-dialog ref="supplier" @changeSupplier="supplierChange" :dialog="myDialog"></supplier-dialog>
|
|
|
+ <guarantee-dialog :id="id" ref="guarantee" @change="guaranteeChange" :dialog="myDialog"></guarantee-dialog>
|
|
|
+ <upload-files-dialog
|
|
|
+ :read="onlyRead ? true : false"
|
|
|
+ ref="upload"
|
|
|
+ @changeFile="fileChange"
|
|
|
+ :keysArr="filesArr"
|
|
|
+ :dialog="myDialog"
|
|
|
+ ></upload-files-dialog>
|
|
|
+ <upload-img-dialog
|
|
|
+ :read="onlyRead ? true : false"
|
|
|
+ @changeFile="imgChange"
|
|
|
+ :keysArr="imgsArr"
|
|
|
+ :dialog="myDialog"
|
|
|
+ ></upload-img-dialog>
|
|
|
+ <maintainer-dialog @changeMaintainer="changeMaintainer" ref="maintainer" :dialog="myDialog"></maintainer-dialog>
|
|
|
+ <insurer-dialog @changeInsurer="changeInsurer" ref="insurer" :dialog="myDialog"></insurer-dialog>
|
|
|
+ <pic-dialog
|
|
|
+ :read="onlyRead ? true : false"
|
|
|
+ :dialog="myDialog"
|
|
|
+ :keysArr="picsArr"
|
|
|
+ @change="changePics"
|
|
|
+ ></pic-dialog>
|
|
|
+ <system-type :infos="systemId" :graphyId="graphyId" :dialog="myDialog"></system-type>
|
|
|
+ <details-dialog :iframeSrc="iframeSrc" v-if="myDialog.details" :dialog="myDialog"></details-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import tools from "@/utils/scan/tools"
|
|
|
-import handsonUtils from "@/utils/hasontableUtils"
|
|
|
-import showTools from "@/utils/handsontable/notShow"
|
|
|
-import text from "@/utils/handsontable/mainText"
|
|
|
+import tools from "@/utils/scan/tools";
|
|
|
+import handsonUtils from "@/utils/hasontableUtils";
|
|
|
+import showTools from "@/utils/handsontable/notShow";
|
|
|
+import text from "@/utils/handsontable/mainText";
|
|
|
|
|
|
-import cenoteType from "@/components/ledger/lib/cenoteType";
|
|
|
import handsonTable from "@/components/common/handsontable";
|
|
|
-import { getCenoteTableHeader, getCenoteTableData, updataCenoteTableData, deleteCenoteTableData, saveCenoteRelateSpace } from "@/api/scan/request"
|
|
|
+import {
|
|
|
+ getPartsAllType,
|
|
|
+ getDataDictionary,
|
|
|
+ getEquipPartsCon,
|
|
|
+ updateParts,
|
|
|
+ deleteParts,
|
|
|
+ getEquipmentFamily
|
|
|
+} from "@/api/scan/request";
|
|
|
import { mapGetters, mapActions } from "vuex";
|
|
|
+
|
|
|
+import qrcode from "@/components/ledger/lib/qrcode";
|
|
|
+import firm from "@/components/dialogs/list/firm";
|
|
|
+import supplyDialog from "@/components/dialogs/list/supplyDialog";
|
|
|
+import supplierDialog from "@/components/dialogs/list/supplierDialog";
|
|
|
+import maintainerDialog from "@/components/dialogs/list/maintainerDialog";
|
|
|
+import insurerDialog from "@/components/dialogs/list/insurerDialog";
|
|
|
+import guaranteeDialog from "@/components/dialogs/list/guaranteeDialog";
|
|
|
+import uploadFilesDialog from "@/components/dialogs/list/filesDialog";
|
|
|
+import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog";
|
|
|
+import picDialog from "@/components/dialogs/list/picDialog";
|
|
|
+import systemType from "@/components/dialogs/list/systemType";
|
|
|
export default {
|
|
|
components: {
|
|
|
- cenoteType,
|
|
|
+ qrcode, //二维码页面
|
|
|
+ firm, //品牌型号弹窗
|
|
|
+ supplyDialog,
|
|
|
+ supplierDialog,
|
|
|
+ maintainerDialog,
|
|
|
+ insurerDialog,
|
|
|
+ guaranteeDialog,
|
|
|
+ uploadFilesDialog,
|
|
|
+ uploadImgDialog,
|
|
|
+ picDialog,
|
|
|
+ systemType,
|
|
|
handsonTable
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- cenoteId: "",//部件类型id
|
|
|
- shaftId: "",//要操作的部件id
|
|
|
+ shaftId: "", //要操作的部件id
|
|
|
isTableRightShow: false,
|
|
|
spaceList: "",
|
|
|
onlyRead: false,
|
|
@@ -72,157 +133,234 @@ export default {
|
|
|
total: 0
|
|
|
},
|
|
|
tableData: [],
|
|
|
+ isWatch: true,
|
|
|
copyTableData: [],
|
|
|
- tableExample:null,
|
|
|
- tabVal:'first'
|
|
|
+ tableExample: null,
|
|
|
+ tabVal: "",
|
|
|
+ activeTab: {}, //当前tab页index
|
|
|
+ partsTypeList: [], //tabs
|
|
|
+ myDialog: {
|
|
|
+ qrcode: false, //二维码弹窗
|
|
|
+ firm: false, //厂商弹窗
|
|
|
+ supply: false, //选择供应合同
|
|
|
+ supplier: false, //供应商选择
|
|
|
+ guarantee: false, //选择保单
|
|
|
+ maintainer: false, //选择维修商
|
|
|
+ insurer: false, //选择保险公司
|
|
|
+ uploadFiles: false, //上传文件
|
|
|
+ uploadImgs: false, //上传单个图片
|
|
|
+ pic: false, //多个图片
|
|
|
+ addDevice: false,
|
|
|
+ systemType: false,
|
|
|
+ details: false, //详情页
|
|
|
+ changeRea: false,
|
|
|
+ lookPic: false //图片查看
|
|
|
+ },
|
|
|
+ qrcodeUrl: "", //二维码图片地址
|
|
|
+ filesArr: [], //保存临时的文件key
|
|
|
+ imgsArr: [], //临时保存的图片key数组
|
|
|
+ picsArr: [], //临时设备图片keys数组
|
|
|
+ systemId: null,
|
|
|
+ graphyId: null,
|
|
|
+ mess: {},
|
|
|
+ id: 0,
|
|
|
+ readArr: [
|
|
|
+ "A1",
|
|
|
+ "A2",
|
|
|
+ "B1",
|
|
|
+ "C5",
|
|
|
+ "D1",
|
|
|
+ "D2",
|
|
|
+ "E1",
|
|
|
+ "F1",
|
|
|
+ "F2",
|
|
|
+ "L",
|
|
|
+ "L1",
|
|
|
+ "L2"
|
|
|
+ ],
|
|
|
+ EquipmentList: [],
|
|
|
+ firmId: "" //品牌型号所需字段
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters("layout", [
|
|
|
- "projectId",
|
|
|
- "secret",
|
|
|
- "userId"
|
|
|
- ])
|
|
|
+ ...mapGetters("layout", ["projectId", "secret", "userId"])
|
|
|
},
|
|
|
created() {
|
|
|
- this.getTableHeader()
|
|
|
+ this.deviceId = this.$route.params.deviceId; //设备id
|
|
|
+ this.typeId = this.$route.params.typeId; //设备类id
|
|
|
+ this.mess.deviceId = this.typeId;
|
|
|
+ this.getTypes();
|
|
|
+ this.getEquipmentFamilyList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ getEquipmentFamilyList() {
|
|
|
+ getEquipmentFamily(res => {
|
|
|
+ this.EquipmentList = res.Content;
|
|
|
+ this.changeCader();
|
|
|
+ });
|
|
|
+ },
|
|
|
//tab页点击事件
|
|
|
- handleClick(){
|
|
|
- console.log(this.tabVal)
|
|
|
+ tabsClick(tab) {
|
|
|
+ this.activeTab = this.partsTypeList[tab.index];
|
|
|
+ this.getTableHeader();
|
|
|
+ },
|
|
|
+ //获取当前设备类下的所有部件类
|
|
|
+ async getTypes() {
|
|
|
+ let params = {
|
|
|
+ category: this.typeId, //设备类型
|
|
|
+ id: this.deviceId //设备id
|
|
|
+ };
|
|
|
+ await getPartsAllType(params).then(res => {
|
|
|
+ this.partsTypeList = res.data.Content;
|
|
|
+ this.tabVal = this.partsTypeList[0].Code;
|
|
|
+ this.activeTab = this.partsTypeList[0];
|
|
|
+ this.getTableHeader();
|
|
|
+ });
|
|
|
},
|
|
|
// 获取表头数据(初始化表格)
|
|
|
async getTableHeader() {
|
|
|
- let param = {
|
|
|
- ProjId: this.projectId,
|
|
|
- secret: this.secret,
|
|
|
- data: {
|
|
|
- "CollectFlag": this.allMess
|
|
|
+ let params = {
|
|
|
+ PageNumber: 1,
|
|
|
+ PageSize: 500,
|
|
|
+ Filters: `type='Equipment' or type='${this.tabVal}'`
|
|
|
+ };
|
|
|
+ await getDataDictionary(params).then(res => {
|
|
|
+ let response = res.data;
|
|
|
+ if (response.Result == "success") {
|
|
|
+ this.tableHeader = response.Content;
|
|
|
+ this.getTableData();
|
|
|
+ } else {
|
|
|
+ this.$message.error("请求错误:" + response.Result);
|
|
|
}
|
|
|
- }
|
|
|
- await getCenoteTableHeader(param, res => {
|
|
|
- this.tableHeader = res.Content;
|
|
|
- this.getTableData()
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
- async getTableData() {//获取表格数据
|
|
|
- let data = {
|
|
|
- Filters: this.cenoteId? `ProjectId='${this.projectId}';structureInfo.ShaftFuncType='${this.cenoteId}'`: `ProjectId='${this.projectId}'`,
|
|
|
+ //获取表格数据
|
|
|
+ async getTableData() {
|
|
|
+ let params = {
|
|
|
PageNumber: this.page.pageNumber,
|
|
|
- PageSize: this.page.pageSize
|
|
|
- }
|
|
|
- const params = {
|
|
|
- ProjId: this.projectId,
|
|
|
- secret: this.secret,
|
|
|
- data: data
|
|
|
- }
|
|
|
- await getCenoteTableData(params, (res) => {
|
|
|
- this.tableData = res.Content
|
|
|
- this.copyTableData = tools.deepCopy(res.Content)
|
|
|
- this.page.pageNumber = res.PageNumber
|
|
|
- this.page.total = res.Total
|
|
|
- if(this.tableData && this.tableData.length){
|
|
|
- this.initTable()
|
|
|
+ PageSize: this.page.pageSize,
|
|
|
+ Filters: `category='${this.tabVal}';parentId='${this.deviceId}'`
|
|
|
+ };
|
|
|
+ await getEquipPartsCon(params).then(res => {
|
|
|
+ let response = res.data;
|
|
|
+ this.tableData = response.Content;
|
|
|
+ this.copyTableData = tools.deepCopy(response.Content);
|
|
|
+ this.page.pageNumber = response.PageNumber;
|
|
|
+ this.page.total = response.Total;
|
|
|
+ if (this.tableData && this.tableData.length) {
|
|
|
+ this.initTable();
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
// 修改表格内容
|
|
|
async updateTableData(data, change) {
|
|
|
let param = {
|
|
|
- ProjId: this.projectId,
|
|
|
- secret: this.secret,
|
|
|
+ projectId: this.projectId,
|
|
|
data: {
|
|
|
Content: [],
|
|
|
Projection: []
|
|
|
}
|
|
|
};
|
|
|
//生成要修改字段列表
|
|
|
- change.map((item) => {
|
|
|
- if(item[1] && param.data.Projection.indexOf(item[1]) == -1) {
|
|
|
- param.data.Projection.push(item[1])
|
|
|
+ change.map(item => {
|
|
|
+ if (item[1] && param.data.Projection.indexOf(item[1]) == -1) {
|
|
|
+ param.data.Projection.push(item[1]);
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
//生成对应修改数据
|
|
|
data.map((item, index) => {
|
|
|
- let keyarr = change[index][1].split(".")
|
|
|
+ let keyarr = change[index][1].split(".");
|
|
|
if (keyarr && keyarr.length > 1) {
|
|
|
- item[keyarr[0]][keyarr[1]] = item[keyarr[0]][keyarr[1]] != ""? item[keyarr[0]][keyarr[1]]: null
|
|
|
+ item[keyarr[0]][keyarr[1]] =
|
|
|
+ item[keyarr[0]][keyarr[1]] != ""
|
|
|
+ ? item[keyarr[0]][keyarr[1]]
|
|
|
+ : null;
|
|
|
} else {
|
|
|
- item[keyarr[0]] = item[keyarr[0]] != ""? item[keyarr[0]]: null
|
|
|
+ item[keyarr[0]] = item[keyarr[0]] != "" ? item[keyarr[0]] : null;
|
|
|
}
|
|
|
param.data.Content.push(item);
|
|
|
});
|
|
|
-
|
|
|
- await updataCenoteTableData(param, (res) => {
|
|
|
-
|
|
|
- })
|
|
|
+ await updateParts(param).then(res => {});
|
|
|
},
|
|
|
// 删除表格数据
|
|
|
async deleteTableData(params) {
|
|
|
- await deleteCenoteTableData(params, (res) => {
|
|
|
- this.$message.success("删除成功!")
|
|
|
- this.getTableHeader()
|
|
|
- })
|
|
|
+ await deleteParts(params).then(res => {
|
|
|
+ this.$message.success("删除成功!");
|
|
|
+ this.getTypes();
|
|
|
+ });
|
|
|
},
|
|
|
//保存元空间关联
|
|
|
async saveSpaceList() {
|
|
|
let data = {
|
|
|
ShaftId: this.shaftId,
|
|
|
SpaceId: this.spaceList
|
|
|
- }
|
|
|
+ };
|
|
|
const params = {
|
|
|
ProjId: this.projectId,
|
|
|
secret: this.secret,
|
|
|
data: data
|
|
|
- }
|
|
|
- await saveCenoteRelateSpace(params, (res) => {
|
|
|
- this.$message.success("关联成功!")
|
|
|
- this.getTableHeader()
|
|
|
- })
|
|
|
+ };
|
|
|
+ await saveCenoteRelateSpace(params, res => {
|
|
|
+ this.$message.success("关联成功!");
|
|
|
+ this.getTableHeader();
|
|
|
+ });
|
|
|
},
|
|
|
// 添加部件
|
|
|
handleCreateTableData() {
|
|
|
- this.$router.push({ name: 'addparts'})
|
|
|
+ this.activeTab.deviceId = this.deviceId;
|
|
|
+ this.$router.push({
|
|
|
+ name: "addparts",
|
|
|
+ params: this.activeTab
|
|
|
+ });
|
|
|
},
|
|
|
// 删除表格行
|
|
|
handleDeleteTableRow() {
|
|
|
- let params = tools.differenceArr(this.tableData, this.copyTableData)
|
|
|
+ let params = tools.differenceArr(this.tableData, this.copyTableData);
|
|
|
if (params.length < 1 || this.tableData > this.copyTableData) {
|
|
|
- return
|
|
|
+ return;
|
|
|
}
|
|
|
let param = {
|
|
|
- ProjId: this.projectId,
|
|
|
- secret: this.secret,
|
|
|
+ projectId: this.projectId,
|
|
|
data: []
|
|
|
- }
|
|
|
+ };
|
|
|
params.map(item => {
|
|
|
- param.data.push(item.ShaftID)
|
|
|
- })
|
|
|
+ param.data.push(item.EquipID);
|
|
|
+ });
|
|
|
this.$confirm("此操作将删除部件,是否继续?", "提示", {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.deleteTableData(param)
|
|
|
- }).catch(() => {
|
|
|
- this.getTableHeader()
|
|
|
- this.$message("取消删除")
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
})
|
|
|
+ .then(() => {
|
|
|
+ this.deleteTableData(param);
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.getTableHeader();
|
|
|
+ this.$message("取消删除");
|
|
|
+ });
|
|
|
},
|
|
|
//修改
|
|
|
handleUpdataTable(changeData, source) {
|
|
|
if (!this.onlyRead) {
|
|
|
if (changeData) {
|
|
|
let trimmedArr = this.trimmedRows();
|
|
|
- let param = handsonUtils.getParam(changeData, source, this.tableExample, trimmedArr);
|
|
|
+ let param = handsonUtils.getParam(
|
|
|
+ changeData,
|
|
|
+ source,
|
|
|
+ this.tableExample,
|
|
|
+ trimmedArr
|
|
|
+ );
|
|
|
let data = [];
|
|
|
for (let i = 0; i < param.length; i++) {
|
|
|
data.push(param[i]);
|
|
|
}
|
|
|
//如果data中包含/且data长度为1,将其转换成.
|
|
|
- if (changeData.length == 1 && changeData[0][1].indexOf("/") > 0) {
|
|
|
- changeData[0][1] = changeData[0][1].split("/").join(".")
|
|
|
+ if (
|
|
|
+ changeData.length == 1 &&
|
|
|
+ changeData[0][1] &&
|
|
|
+ changeData[0][1].indexOf("/") > 0
|
|
|
+ ) {
|
|
|
+ changeData[0][1] = changeData[0][1].split("/").join(".");
|
|
|
}
|
|
|
|
|
|
// 存在data进行修改请求
|
|
@@ -236,54 +374,63 @@ export default {
|
|
|
undo() {
|
|
|
this.tableExample.undo();
|
|
|
},
|
|
|
- //切换部件类型
|
|
|
- changeFloor(value) {
|
|
|
- this.cenoteId = value.Id
|
|
|
- this.getTableHeader()
|
|
|
- },
|
|
|
- //关闭右侧关联元空间输入按钮
|
|
|
- handleCloseRight() {
|
|
|
- this.isTableRightShow = false
|
|
|
- this.spaceList = ""
|
|
|
- },
|
|
|
//切换每页显示多少条数据
|
|
|
handleSizeChange(val) {
|
|
|
- this.page.pageSize = val
|
|
|
- this.getTableHeader()
|
|
|
+ this.page.pageSize = val;
|
|
|
+ this.getTableHeader();
|
|
|
},
|
|
|
//切换页数
|
|
|
handleCurrentChange(val) {
|
|
|
- this.page.pageNumber = val
|
|
|
- this.getTableHeader()
|
|
|
+ this.page.pageNumber = val;
|
|
|
+ this.getTableHeader();
|
|
|
},
|
|
|
- formatHeaderData(list) {//格式化表头显示的数据
|
|
|
- let arr = tools.copyArr(list)
|
|
|
- arr.map((item) => {
|
|
|
- item.Visible = true
|
|
|
- })
|
|
|
- let readArr = ["A1", "A2", "B1", "C5", "D1", "D2", "E1", "F1", "F2", "L", "L1", "L2", "X"]
|
|
|
+ formatHeaderData(list) {
|
|
|
+ //格式化表头显示的数据
|
|
|
+ let arr = tools.copyArr(list);
|
|
|
+ arr.map(item => {
|
|
|
+ item.Visible = true;
|
|
|
+ });
|
|
|
if (!this.onlyRead) {
|
|
|
- readArr.push("Own")
|
|
|
+ this.readArr.push("Own");
|
|
|
}
|
|
|
- let data = showTools.changeHeader(arr, readArr, this.onlyRead, false, this.allMess)
|
|
|
- data.unshift("关联的元空间");
|
|
|
+ let data = showTools.tableHeadFilter(
|
|
|
+ arr,
|
|
|
+ this.readArr,
|
|
|
+ this.onlyRead,
|
|
|
+ this.isWatch,
|
|
|
+ false
|
|
|
+ );
|
|
|
+ data.unshift("查看详情", "当前关联的资产");
|
|
|
return data;
|
|
|
},
|
|
|
- formatHeaderType(list) {//格式化表头头映射的数据
|
|
|
+ formatHeaderType(list) {
|
|
|
+ //格式化表头头映射的数据
|
|
|
let arr = tools.copyArr(list);
|
|
|
- arr.map((item) => { //缺少信息点
|
|
|
- item.Visible = true
|
|
|
- })
|
|
|
- let readArr = ["A1", "A2", "B1", "C5", "D1", "D2", "E1", "F1", "F2", "L", "L1", "L2", "X"]
|
|
|
- let data = showTools.showHeaderTypes(arr, readArr, this.onlyRead, false, this.allMess)
|
|
|
- data.unshift({
|
|
|
- data: "SpaceCount",
|
|
|
- renderer: tools.num,
|
|
|
- readOnly: true
|
|
|
- })
|
|
|
+ arr.map(item => {
|
|
|
+ item.Visible = true;
|
|
|
+ });
|
|
|
+ let data = showTools.tableHeaderTypes(
|
|
|
+ arr,
|
|
|
+ this.readArr,
|
|
|
+ this.onlyRead,
|
|
|
+ this.isWatch,
|
|
|
+ false
|
|
|
+ );
|
|
|
+ data.unshift(
|
|
|
+ {
|
|
|
+ data: "caozuo",
|
|
|
+ renderer: tools.lookDetails,
|
|
|
+ readOnly: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: "PropertyName",
|
|
|
+ readOnly: true
|
|
|
+ }
|
|
|
+ );
|
|
|
return data;
|
|
|
},
|
|
|
- initTable() {//实例化表格
|
|
|
+ initTable() {
|
|
|
+ //实例化表格
|
|
|
let settings = {
|
|
|
data: this.tableData,
|
|
|
colHeaders: this.formatHeaderData(this.tableHeader),
|
|
@@ -303,21 +450,95 @@ export default {
|
|
|
afterOnCellMouseDown: this.handleTdClick //鼠标点击
|
|
|
};
|
|
|
this.$nextTick(() => {
|
|
|
- console.log(this.$refs.table);
|
|
|
this.tableExample = this.$refs.table.init(settings);
|
|
|
});
|
|
|
},
|
|
|
- //获取到了正确的信息
|
|
|
- getInfors(infos, row) {
|
|
|
- //其他的开始判断
|
|
|
- let val = this.tableExample.colToProp(row.col)
|
|
|
- this.shaftId = infos.ShaftID //要操作的数据id
|
|
|
- //点击关联的元空间
|
|
|
- if (val === "SpaceCount") {
|
|
|
- this.spaceList = infos.SpaceList
|
|
|
- this.isTableRightShow = true
|
|
|
+ //去除数组中相同的元素
|
|
|
+ array_diff(a, b) {
|
|
|
+ for (var i = 0; i < b.length; i++) {
|
|
|
+ for (var j = 0; j < a.length; j++) {
|
|
|
+ if (a[j] == b[i]) {
|
|
|
+ a.splice(j, 1);
|
|
|
+ j = j - 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ return a;
|
|
|
+ },
|
|
|
+ //选择型号修改
|
|
|
+ firmChange(data) {
|
|
|
+ for (let key in data) {
|
|
|
+ if (key == "venderId") {
|
|
|
+ data[key] = data[key] + "-" + data.name + "/" + data.brand;
|
|
|
+ this.utilToKey(key, "venderId", data, "DPManufacturerID");
|
|
|
+ }
|
|
|
+ this.utilToKey(key, "specificationId", data, "DPSpecificationID");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ supplyChange(data) {
|
|
|
+ let changeData = { id: data };
|
|
|
+ this.utilToKey("id", "id", changeData, "SupplierContractID");
|
|
|
+ },
|
|
|
+ //如果选择供应商之后
|
|
|
+ supplierChange(data) {
|
|
|
+ for (let key in data) {
|
|
|
+ if (key == "venderId") {
|
|
|
+ data[key] = data[key] + "-" + data.name;
|
|
|
+ this.utilToKey(key, "venderId", data, "DPSupplierID");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //保险合同
|
|
|
+ guaranteeChange(data) {
|
|
|
+ for (let key in data) {
|
|
|
+ this.utilToKey(key, "insuranceNo", data, "InsuranceNum");
|
|
|
+ if (key == "contractFile") {
|
|
|
+ if (!!data[key]) {
|
|
|
+ data[key] = [data[key]];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.utilToKey(key, "contractFile", data, "InsuranceFile");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //上传文件弹窗触发事件
|
|
|
+ fileChange(keys) {
|
|
|
+ this.setDataToMain(keys, this.messKey.split(".")[1], this.row);
|
|
|
+ },
|
|
|
+ //上传图片弹窗触发事件
|
|
|
+ imgChange(keys) {
|
|
|
+ this.setDataToMain(keys, this.messKey.split(".")[1], this.row);
|
|
|
},
|
|
|
+ //维修商变更
|
|
|
+ changeMaintainer(data) {
|
|
|
+ for (let key in data) {
|
|
|
+ if (key == "venderId") {
|
|
|
+ data[key] = data[key] + "-" + data.name;
|
|
|
+ this.utilToKey(key, "venderId", data, "DPMaintainerID");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //保险商变更
|
|
|
+ changeInsurer(data) {
|
|
|
+ for (let key in data) {
|
|
|
+ if (key == "venderId") {
|
|
|
+ data[key] = data[key] + "-" + data.name;
|
|
|
+ this.utilToKey(key, "venderId", data, "DPInsurerID");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //设备图片弹窗改变事件
|
|
|
+ changePics(keys) {
|
|
|
+ this.setDataToMain(keys, this.messKey.split(".")[1], this.row);
|
|
|
+ },
|
|
|
+ setGraphyId(graphyId, assetGroupList) {
|
|
|
+ this.graphyId = graphyId;
|
|
|
+ this.assetGroupList = assetGroupList;
|
|
|
+ },
|
|
|
+ //触发父组件change
|
|
|
+ getClose(val) {
|
|
|
+ this.$emit("close", val);
|
|
|
+ },
|
|
|
+ reset() {},
|
|
|
//表格点击事件
|
|
|
handleTdClick(el, rowArr) {
|
|
|
//点击的是表头
|
|
@@ -335,7 +556,8 @@ export default {
|
|
|
this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
|
|
|
} else if (isSort) {
|
|
|
//排序后的数组
|
|
|
- let sortArr = this.tableExample.getPlugin("columnSorting").rowsMapper.__arrayMap;
|
|
|
+ let sortArr = this.tableExample.getPlugin("columnSorting").rowsMapper
|
|
|
+ .__arrayMap;
|
|
|
let infos = this.tableData[sortArr[rowArr.row]];
|
|
|
this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
|
|
|
} else if (trimmedArr.length) {
|
|
@@ -348,7 +570,6 @@ export default {
|
|
|
},
|
|
|
//获取被筛选掉的行号
|
|
|
trimmedRows() {
|
|
|
- // var plugin = hot.getPlugin('trimRows').trimmedRows;//获取被筛选掉的行号
|
|
|
var plugin = this.tableExample.getPlugin("trimRows").trimmedRows;
|
|
|
let dataLength = this.tableData.length;
|
|
|
let dataArr = new Array();
|
|
@@ -362,17 +583,142 @@ export default {
|
|
|
}
|
|
|
return dataArr || [];
|
|
|
},
|
|
|
- //去除数组中相同的元素
|
|
|
- array_diff(a, b) {
|
|
|
- for (var i = 0; i < b.length; i++) {
|
|
|
- for (var j = 0; j < a.length; j++) {
|
|
|
- if (a[j] == b[i]) {
|
|
|
- a.splice(j, 1);
|
|
|
- j = j - 1;
|
|
|
+ getInfors(infos, row) {
|
|
|
+ //其他的开始判断
|
|
|
+ let val = this.tableExample.colToProp(row.col);
|
|
|
+ //设备二维码图片
|
|
|
+ if (val == "EquipQRCode") {
|
|
|
+ this.myDialog.qrcode = true;
|
|
|
+ this.$refs.qrcode.getCanvas(1111);
|
|
|
+ }
|
|
|
+ //关联系统
|
|
|
+ if (val == "linkSystem") {
|
|
|
+ // this.systemList = this.tableData[row.row].linkSystem || [];
|
|
|
+ this.myDialog.systemType = true;
|
|
|
+ }
|
|
|
+ //品牌型号弹窗
|
|
|
+ if (val == "DPManufacturerID") {
|
|
|
+ this.myDialog.firm = true;
|
|
|
+ }
|
|
|
+ //供应商信息弹窗
|
|
|
+ if (val == "DPSupplierID") {
|
|
|
+ this.myDialog.supplier = true;
|
|
|
+ }
|
|
|
+ //维修商信息弹窗
|
|
|
+ if (val == "DPMaintainerID") {
|
|
|
+ this.myDialog.maintainer = true;
|
|
|
+ }
|
|
|
+ //保险公司信息
|
|
|
+ if (val == "DPInsurerID") {
|
|
|
+ this.myDialog.insurer = true;
|
|
|
+ }
|
|
|
+ //供应合同编号
|
|
|
+ if (val == "LedgerParam.SupplyPurchase.SupplierContractID") {
|
|
|
+ let falg = null;
|
|
|
+ if (!!this.tableData[row.row].infos) {
|
|
|
+ if (!!this.tableData[row.row].infos) {
|
|
|
+ falg = this.tableData[row.row].infos.DPSupplierID.split("-")[0];
|
|
|
}
|
|
|
}
|
|
|
+ if (!!falg) {
|
|
|
+ this.id = falg;
|
|
|
+ this.myDialog.supply = true;
|
|
|
+ } else {
|
|
|
+ this.$message("请先选择供应商");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //保险单号
|
|
|
+ if (val == "LedgerParam.InsuranceDoc.InsuranceNum") {
|
|
|
+ //选择保单
|
|
|
+ let falg = null;
|
|
|
+ if (!!this.tableData[row.row].infos) {
|
|
|
+ if (!!this.tableData[row.row].infos) {
|
|
|
+ falg = this.tableData[row.row].infos.DPInsurerID.split("-")[0];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!!falg) {
|
|
|
+ this.id = falg;
|
|
|
+ this.myDialog.guarantee = true;
|
|
|
+ } else {
|
|
|
+ this.$message("请先选择保险商");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //保险文件--设备文档
|
|
|
+ if (
|
|
|
+ val == "LedgerParam.InsuranceDoc.InsuranceFile" ||
|
|
|
+ val == "LedgerParam.PhotoDoc.Archive"
|
|
|
+ ) {
|
|
|
+ this.filesArr = this.tableData[row.row].infos
|
|
|
+ ? this.tableData[row.row].infos[val.split(".")[1]]
|
|
|
+ ? [this.tableData[row.row].infos[val.split(".")[1]]]
|
|
|
+ : []
|
|
|
+ : [];
|
|
|
+ this.myDialog.uploadFiles = true;
|
|
|
+ }
|
|
|
+ //安装照片--安装图纸--设备铭牌照片--设备图纸
|
|
|
+ if (
|
|
|
+ val == "LedgerParam.Siteinstall.InstallPic" ||
|
|
|
+ val == "LedgerParam.Siteinstall.InstallDrawing" ||
|
|
|
+ val == "LedgerParam.PhotoDoc.Nameplate" ||
|
|
|
+ val == "LedgerParam.PhotoDoc.Drawing"
|
|
|
+ ) {
|
|
|
+ if (val == "LedgerParam.PhotoDoc.Nameplate") {
|
|
|
+ this.imgsArr = this.tableData[row.row].infos
|
|
|
+ ? this.tableData[row.row].infos[val.split(".")[1]]
|
|
|
+ ? [this.tableData[row.row].infos[val.split(".")[1]].key]
|
|
|
+ : []
|
|
|
+ : [];
|
|
|
+ } else {
|
|
|
+ this.imgsArr = this.tableData[row.row].infos
|
|
|
+ ? this.tableData[row.row].infos[val.split(".")[1]]
|
|
|
+ ? [this.tableData[row.row].infos[val.split(".")[1]]]
|
|
|
+ : []
|
|
|
+ : [];
|
|
|
+ }
|
|
|
+ this.myDialog.uploadImgs = true;
|
|
|
+ }
|
|
|
+ //设备照片
|
|
|
+ if (val == "LedgerParam.PhotoDoc.Pic") {
|
|
|
+ this.picsArr = this.tableData[row.row].infos
|
|
|
+ ? this.tableData[row.row].infos[val.split(".")[1]]
|
|
|
+ ? this.tableData[row.row].infos[val.split(".")[1]]
|
|
|
+ : []
|
|
|
+ : [];
|
|
|
+ this.myDialog.pic = true;
|
|
|
+ }
|
|
|
+ this.row = row.row;
|
|
|
+ this.messKey = val;
|
|
|
+ },
|
|
|
+ //修改设备类型
|
|
|
+ changeCader() {
|
|
|
+ this.EquipmentList.map(item => {
|
|
|
+ if (!!item.content && item.content.length) {
|
|
|
+ item.content.map(child => {
|
|
|
+ if (child.code == this.mess.deviceId) {
|
|
|
+ this.firmId = item.code;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ utilToKey(key, name, data, messName) {
|
|
|
+ if (key == name) {
|
|
|
+ this.setDataToMain(data[key], messName, this.row);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //判断是否有值,有值赋值
|
|
|
+ setDataToMain(data, key, row) {
|
|
|
+ if (!!data && data != "--") {
|
|
|
+ if (!!this.tableData[row]) {
|
|
|
+ this.tableData[row][key] = data;
|
|
|
+ this.handleUpdataTable([[row, key, null, data]], "edit");
|
|
|
+ } else {
|
|
|
+ this.tableData[row] = {};
|
|
|
+ this.tableData[row][key] = data;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.tableData[row][key] = "";
|
|
|
}
|
|
|
- return a;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -389,19 +735,21 @@ export default {
|
|
|
}
|
|
|
.search-header {
|
|
|
overflow: hidden;
|
|
|
- padding:0 10px 10px 10px;
|
|
|
+ padding: 0 10px 10px 10px;
|
|
|
border-bottom: 1px solid #bcbcbc;
|
|
|
}
|
|
|
.tableBox {
|
|
|
display: flex;
|
|
|
height: calc(100% - 150px);
|
|
|
margin-top: 10px;
|
|
|
- .tableLeft {
|
|
|
+ .tableLeft,
|
|
|
+ .middle_sty {
|
|
|
flex: 1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-.el-pagination button, .el-pagination span:not([class*=suffix]) {
|
|
|
- vertical-align: middle;
|
|
|
+.el-pagination button,
|
|
|
+.el-pagination span:not([class*="suffix"]) {
|
|
|
+ vertical-align: middle;
|
|
|
}
|
|
|
</style>
|