|
@@ -17,6 +17,12 @@
|
|
|
<el-button @click="handleCreateTableData">添加部件</el-button>
|
|
|
<el-button @click="getTableHeader">刷新</el-button>
|
|
|
<el-button v-show="!onlyRead" @click="undo">撤销</el-button>
|
|
|
+ <div style="float:right;overflow:hidden;">
|
|
|
+ <span style="width:20px;float:left;display:block;height:20px;cursor: pointer;" @click="changeAssetsFalg">
|
|
|
+ <i v-show="!onlyRead" class="el-icon-fa el-icon-fa-compass"></i>
|
|
|
+ </span>
|
|
|
+ <span>当前筛选条件下共{{page.total || '--'}}部件</span>
|
|
|
+ </div>
|
|
|
</el-row>
|
|
|
<div class="tableBox">
|
|
|
<div class="center middle_sty" v-show="tableData && !tableData.length">
|
|
@@ -134,7 +140,6 @@ export default {
|
|
|
addDevice: false,
|
|
|
systemType: false,
|
|
|
details: false, //详情页
|
|
|
- changeRea: false,
|
|
|
lookPic: false, //图片查看
|
|
|
changeRea: false, //关联的资产
|
|
|
},
|
|
@@ -147,7 +152,8 @@ export default {
|
|
|
mess: {},
|
|
|
id: 0,
|
|
|
EquipmentList: [],
|
|
|
- firmId: "" //品牌型号所需字段--族id三位编码(传设备类id或部件类id)
|
|
|
+ firmId: "", //品牌型号所需字段--族id三位编码(传设备类id或部件类id)
|
|
|
+ deviceType:{}
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -169,7 +175,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
getEquipBelongs(params, res => {
|
|
|
- this.firmId = res.Content[0].Family;
|
|
|
+ if (res.Content.length) {
|
|
|
+ this.firmId = res.Content[0].Family;
|
|
|
+ this.deviceType.assetType = res.Content[0].Family
|
|
|
+ this.deviceType.assetName = res.Content[0].FamilyName
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
//tab页点击事件
|
|
@@ -376,8 +386,9 @@ export default {
|
|
|
readOnly: true
|
|
|
},
|
|
|
{
|
|
|
- data: "PropertyLocalName",
|
|
|
- readOnly: true
|
|
|
+ data: "LinkEquipLocalName",
|
|
|
+ readOnly: true,
|
|
|
+ renderer: tools.LinkEquipLocalName
|
|
|
}
|
|
|
);
|
|
|
return data;
|
|
@@ -526,100 +537,129 @@ export default {
|
|
|
return dataArr || [];
|
|
|
},
|
|
|
getInfors(infos, row) {
|
|
|
- //其他的开始判断
|
|
|
- let val = this.tableExample.colToProp(row.col);
|
|
|
- if (val == "caozuo") {
|
|
|
- // window.open(`http://adm.sagacloud.cn:8058/spread?id=${infos.EquipID}&pid=${this.projectId}&secret=${this.secret}`,"_blank")
|
|
|
- this.$message("开发中...")
|
|
|
- }
|
|
|
- //设备二维码图片
|
|
|
- if (val == "EquipQRCode") {
|
|
|
- this.qrcodeUrl = this.tableData[row.row].EquipQRCode;
|
|
|
- if (!!this.qrcodeUrl) {
|
|
|
- this.myDialog.qrcode = true;
|
|
|
- } else {
|
|
|
- this.$message("此设备没有设备二维码");
|
|
|
- }
|
|
|
- }
|
|
|
- //关联系统
|
|
|
- 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;
|
|
|
- let data = this.tableData[row.row].DPSupplierID;
|
|
|
- if (data) {
|
|
|
- falg = data.split("-")[0];
|
|
|
- }
|
|
|
- if (!!falg) {
|
|
|
- this.id = falg;
|
|
|
- this.myDialog.supply = true;
|
|
|
- } else {
|
|
|
- this.$message("请先选择供应商");
|
|
|
- }
|
|
|
- }
|
|
|
- //保险单号
|
|
|
- if (val == "LedgerParam.InsuranceDoc.InsuranceNum") {
|
|
|
- //选择保单
|
|
|
- let falg = null;
|
|
|
- let data = this.tableData[row.row].DPInsurerID;
|
|
|
- if (data) {
|
|
|
- falg = data.split("-")[0];
|
|
|
- }
|
|
|
- if (!!falg) {
|
|
|
- this.id = falg;
|
|
|
- this.myDialog.guarantee = true;
|
|
|
- } else {
|
|
|
- this.$message("请先选择保险商");
|
|
|
- }
|
|
|
- }
|
|
|
- //保险文件--设备文档--安装质检报告
|
|
|
- if (
|
|
|
- val == "LedgerParam.InsuranceDoc.InsuranceFile" ||
|
|
|
- val == "LedgerParam.PhotoDoc.Archive" ||
|
|
|
- val == "LedgerParam.Siteinstall.CheckReport"
|
|
|
- ) {
|
|
|
- let data = tools.dataForKey(this.tableData[row.row], val);
|
|
|
- this.filesArr = data ? data : [];
|
|
|
- this.myDialog.uploadFiles = true;
|
|
|
- }
|
|
|
- //安装照片--安装图纸--设备铭牌照片--设备图纸
|
|
|
- if (
|
|
|
- val == "LedgerParam.Siteinstall.InstallPic" ||
|
|
|
- val == "LedgerParam.Siteinstall.InstallDrawing" ||
|
|
|
- val == "LedgerParam.PhotoDoc.Nameplate" ||
|
|
|
- val == "LedgerParam.PhotoDoc.Drawing"
|
|
|
- ) {
|
|
|
- let data = tools.dataForKey(this.tableData[row.row], val);
|
|
|
- this.imgsArr = data ? data : [];
|
|
|
- this.myDialog.uploadImgs = true;
|
|
|
- }
|
|
|
- //设备照片
|
|
|
- if (val == "LedgerParam.PhotoDoc.Pic") {
|
|
|
- let data = tools.dataForKey(this.tableData[row.row], val);
|
|
|
- this.picsArr = data ? data : [];
|
|
|
- this.myDialog.pic = true;
|
|
|
- }
|
|
|
this.row = row.row;
|
|
|
this.messKey = val;
|
|
|
+ let val = this.tableExample.colToProp(row.col);
|
|
|
+ console.log(val)
|
|
|
+ switch (val) {
|
|
|
+ //操作
|
|
|
+ case 'caozuo':
|
|
|
+ // window.open(`http://adm.sagacloud.cn:8058/spread?id=${infos.EquipID}&pid=${this.projectId}&secret=${this.secret}`,"_blank")
|
|
|
+ this.$message("开发中...")
|
|
|
+ break;
|
|
|
+ //设备二维码图片
|
|
|
+ case 'EquipQRCode':
|
|
|
+ this.qrcodeUrl = this.tableData[row.row].EquipQRCode;
|
|
|
+ if (!!this.qrcodeUrl) {
|
|
|
+ this.myDialog.qrcode = true;
|
|
|
+ } else {
|
|
|
+ this.$message("此设备没有设备二维码");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ //关联系统
|
|
|
+ case 'LinkSystem':
|
|
|
+ if (!this.onlyRead) {
|
|
|
+ this.curDevice = infos.EquipID;
|
|
|
+ this.systemList = this.tableData[row.row].LinkSystem || [];
|
|
|
+ this.myDialog.systemType = true;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ //关联资产
|
|
|
+ case 'LinkEquipLocalName':
|
|
|
+ if (this.linkNameFalg) {
|
|
|
+ this.myDialog.changeRea = true;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ //品牌型号弹窗
|
|
|
+ case 'DPManufacturerID':
|
|
|
+ if (!this.onlyRead) {
|
|
|
+ this.myDialog.firm = true;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ //供应商信息弹窗
|
|
|
+ case 'DPSupplierID':
|
|
|
+ if (!this.onlyRead) {
|
|
|
+ this.myDialog.supplier = true;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ //维修商信息弹窗
|
|
|
+ case 'DPMaintainerID':
|
|
|
+ if (!this.onlyRead) {
|
|
|
+ this.myDialog.maintainer = true;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ //保险公司信息
|
|
|
+ case 'DPInsurerID':
|
|
|
+ if (!this.onlyRead) {
|
|
|
+ this.myDialog.insurer = true;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ //供应合同编号
|
|
|
+ case 'LedgerParam.SupplyPurchase.SupplierContractID':
|
|
|
+ if (!this.onlyRead) {
|
|
|
+ let ContractIDflag = null;
|
|
|
+ let DPSdata = this.tableData[row.row].DPSupplierID;
|
|
|
+ if (DPSdata) {
|
|
|
+ ContractIDflag = DPSdata.split("-")[0];
|
|
|
+ }
|
|
|
+ if (!!ContractIDflag) {
|
|
|
+ this.id = ContractIDflag;
|
|
|
+ this.myDialog.supply = true;
|
|
|
+ } else {
|
|
|
+ this.$message("请先选择供应商");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ //保险单号
|
|
|
+ case 'LedgerParam.InsuranceDoc.InsuranceNum':
|
|
|
+ if (!this.onlyRead) {
|
|
|
+ let DPInsurerIDflag = null;
|
|
|
+ let DPIdata = this.tableData[row.row].DPInsurerID;
|
|
|
+ if (DPIdata) {
|
|
|
+ DPInsurerIDflag = DPIdata.split("-")[0];
|
|
|
+ }
|
|
|
+ if (!!DPInsurerIDflag) {
|
|
|
+ this.id = DPInsurerIDflag;
|
|
|
+ this.myDialog.guarantee = true;
|
|
|
+ } else {
|
|
|
+ this.$message("请先选择保险商");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ //保险文件--设备文档--安装质检报告
|
|
|
+ case 'LedgerParam.InsuranceDoc.InsuranceFile':
|
|
|
+ case 'LedgerParam.PhotoDoc.Archive':
|
|
|
+ case 'LedgerParam.Siteinstall.CheckReport':
|
|
|
+ let IPSdata = tools.dataForKey(this.tableData[row.row], val);
|
|
|
+ this.filesArr = IPSdata ? IPSdata : [];
|
|
|
+ this.myDialog.uploadFiles = true;
|
|
|
+ break;
|
|
|
+ //安装照片--安装图纸--设备铭牌照片--设备图纸
|
|
|
+ case 'LedgerParam.Siteinstall.InstallPic':
|
|
|
+ case 'LedgerParam.Siteinstall.InstallDrawing':
|
|
|
+ case 'LedgerParam.PhotoDoc.Nameplate':
|
|
|
+ case 'LedgerParam.PhotoDoc.Drawing':
|
|
|
+ let SSPPdata = tools.dataForKey(this.tableData[row.row], val);
|
|
|
+ this.imgsArr = SSPPdata ? SSPPdata : [];
|
|
|
+ this.myDialog.uploadImgs = true;
|
|
|
+ break;
|
|
|
+ //设备照片
|
|
|
+ case 'LedgerParam.PhotoDoc.Pic':
|
|
|
+ let Pdata = tools.dataForKey(this.tableData[row.row], val);
|
|
|
+ this.picsArr = Pdata ? Pdata : [];
|
|
|
+ this.myDialog.pic = true;
|
|
|
+ break;
|
|
|
+ //包含的部件字段
|
|
|
+ case 'Count':
|
|
|
+ if (this.onlyRead) {
|
|
|
+ this.$router.push({ path: '/ledger/parts', query: { deviceId: infos.EquipID } });
|
|
|
+ } else {
|
|
|
+ this.$router.push({ path: '/ledger/partsmanage', query: { deviceId: infos.EquipID, typeId: this.mess.deviceId } });
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
},
|
|
|
utilToKey(key, name, data, messName) {
|
|
|
if (key == name) {
|
|
@@ -639,7 +679,25 @@ export default {
|
|
|
} else {
|
|
|
tools.setDataForKey(this.tableData[row], key, "");
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ //修改资产
|
|
|
+ changeAssetsFalg() {
|
|
|
+ if (this.linkNameFalg) {
|
|
|
+ this.linkNameFalg = false
|
|
|
+ } else {
|
|
|
+ this.$confirm('<p>真的要在这里修改部件关联的资产么?</p><p>真的能通过列表信息找到想关联的资产么?</p><p>在这里修改关联的资产一定是因为之前关联错了要修改么?</p>', '提示', {
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ confirmButtonText: '没错!我要改关联的资产',
|
|
|
+ cancelButtonText: '我就点开看看',
|
|
|
+ confirmButtonClass: 'cancelButtonClass',
|
|
|
+ cancelButtonClass: 'cancelButtonClass'
|
|
|
+ }).then(_ => {
|
|
|
+ this.linkNameFalg = true
|
|
|
+ }).catch(_ => {
|
|
|
+ this.$message("取消")
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|