|
@@ -143,7 +143,7 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.category = this.$route.query;
|
|
|
- this.category.ParentId = this.category.Code.substr(0, 4);
|
|
|
+ this.category.parentId = this.category.code.substr(0, this.category.code.length - 2);
|
|
|
this.getBelongs();
|
|
|
this.getTableHeader();
|
|
|
},
|
|
@@ -152,7 +152,7 @@ export default {
|
|
|
getBelongs() {
|
|
|
let params = {
|
|
|
data: {
|
|
|
- filters: `equipCode='${this.category.Code}'`,
|
|
|
+ filters: `equipCode='${this.category.code}'`,
|
|
|
pageNumber: 1,
|
|
|
pageSize: 50
|
|
|
}
|
|
@@ -169,7 +169,7 @@ export default {
|
|
|
orders: "sort asc, name desc",
|
|
|
pageNumber: 1,
|
|
|
pageSize: 1000,
|
|
|
- type: this.category.Code
|
|
|
+ type: this.category.code
|
|
|
// Filters: `type='Equipment' or type='${this.category.Code}'`
|
|
|
};
|
|
|
await getDataDictionary(params, res => {
|
|
@@ -198,7 +198,7 @@ export default {
|
|
|
}
|
|
|
let flag = false;
|
|
|
newData.map(item => {
|
|
|
- if (item.Checked && !item.EquipLocalName) {
|
|
|
+ if (item.Checked && !item.localName) {
|
|
|
flag = true;
|
|
|
}
|
|
|
})
|
|
@@ -208,18 +208,18 @@ export default {
|
|
|
}
|
|
|
|
|
|
for (let i = 0; i < newData.length; i++) {
|
|
|
- newData[i].ParentId = this.category.deviceId //当前设备id
|
|
|
- newData[i].Category = this.category.Code //当前部件分类
|
|
|
- newData[i].Family = this.firmId;
|
|
|
+ newData[i].parentId = this.category.deviceId //当前设备id
|
|
|
+ newData[i].classCode = this.category.code //当前部件分类
|
|
|
+ newData[i].family = this.firmId;
|
|
|
//待接口修改为关联创建
|
|
|
let param = {
|
|
|
- Cascade: [],
|
|
|
- Content: [newData[i]]
|
|
|
+ cascade: [],
|
|
|
+ content: [newData[i]]
|
|
|
}
|
|
|
|
|
|
await createPart(param, async res => {
|
|
|
if (newData[i].Checked) {//同时创建资产
|
|
|
- param.Content[0].EquipmentId = res.EntityList[0].EquipID
|
|
|
+ param.content[0].equipmentId = res.entityList[0].id
|
|
|
await createPropertyData(param, res => {
|
|
|
// todo 创建资产
|
|
|
})
|
|
@@ -231,34 +231,13 @@ export default {
|
|
|
path: "/ledger/partsmanage",
|
|
|
query: {
|
|
|
deviceId: this.category.deviceId,
|
|
|
- typeId: this.category.ParentId,
|
|
|
+ typeId: this.category.parentId,
|
|
|
pageNo: this.category.pageNo,
|
|
|
pageSize: this.category.pageSize
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
- // if (newData[i].Checked) {//同时创建资产
|
|
|
- // await createPropertyData([params], async res => {
|
|
|
- // params.PropertyId = res.Id
|
|
|
-
|
|
|
- // })
|
|
|
- // }
|
|
|
- // else {
|
|
|
- // await createPart(params, res => {
|
|
|
- // if (i == newData.length - 1) {
|
|
|
- // this.$router.push({
|
|
|
- // path: "/ledger/partsmanage",
|
|
|
- // query: {
|
|
|
- // deviceId: this.category.deviceId,
|
|
|
- // typeId: this.category.ParentId
|
|
|
- // }
|
|
|
- // });
|
|
|
- // session.remove("partsAddData")
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
}
|
|
|
},
|
|
|
// 删除表格行
|
|
@@ -358,41 +337,56 @@ export default {
|
|
|
},
|
|
|
//选择型号修改
|
|
|
firmChange(data) {
|
|
|
- tools.setDataForKey(this.tableData[this.row], "dpManufacturerId", data.venderId)//生产商ID
|
|
|
- tools.setDataForKey(this.tableData[this.row], "dpBrandId", data.brandId)//品牌ID
|
|
|
- tools.setDataForKey(this.tableData[this.row], "dpSpecificationId", data.specificationId)//型号ID
|
|
|
- tools.setDataForKey(this.tableData[this.row], "LedgerParam.equipManufactor.manufacturer", data.venderName)
|
|
|
- tools.setDataForKey(this.tableData[this.row], "LedgerParam.equipManufactor.brand", data.brandName)
|
|
|
- tools.setDataForKey(this.tableData[this.row], "LedgerParam.equipManufactor.Specification", data.name)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "dpManufacturerId", data.venderId); //生产商ID
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "dpBrandId", data.brandId); //品牌ID
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "dpSpecificationId", data.specificationId); //型号ID
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "infos.manufacturer", data.venderName);
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "infos.brand", data.name);
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "infos.specification", data.brandName);
|
|
|
},
|
|
|
//供应商变更
|
|
|
supplierChange(data) {
|
|
|
- tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.Supplier", data.name)
|
|
|
- tools.setDataForKey(this.tableData[this.row], "dpSupplierId", data.venderId)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "dpSupplierId", data.venderId);
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "infos.supplier", data.name);
|
|
|
+ tools.setDataForKey(this.tableData[this.row], 'infos.supplierPhone', data.contacts[0]?data.contacts[0].phone:null)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], 'infos.supplierContactor', data.contacts[0]?data.contacts[0].name:null)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], 'infos.supplierWeb', data.website?data.website:null)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], 'infos.supplierEmail', data.contacts[0]?data.contacts[0].email:null)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], 'infos.supplierFax', data.contacts[0]?data.contacts[0].fax:null)
|
|
|
},
|
|
|
//保险商变更
|
|
|
changeInsurer(data) {
|
|
|
- tools.setDataForKey(this.tableData[this.row], "LedgerParam.InsuranceDoc.Insurer", data.name)
|
|
|
- tools.setDataForKey(this.tableData[this.row], "dpInsurerId", data.venderId)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "dpInsurerId", data.venderId);
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "infos.insurer", data.name);
|
|
|
+ tools.setDataForKey(this.tableData[this.row], 'infos.insurerWeb', data.website?data.website:null)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], 'infos.insurerEmail', data.contacts[0]?data.contacts[0].email:null)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], 'infos.insurerFax', data.contacts[0]?data.contacts[0].fax:null)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], 'infos.insurerPhone', data.contacts[0]?data.contacts[0].phone:null)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], 'infos.insurerContactor', data.contacts[0]?data.contacts[0].name:null)
|
|
|
},
|
|
|
//维修商变更
|
|
|
changeMaintainer(data) {
|
|
|
- tools.setDataForKey(this.tableData[this.row], "LedgerParam.operationMainte.maintainer", data.name)
|
|
|
- tools.setDataForKey(this.tableData[this.row], "dpMaintainerId", data.venderId)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "dpMaintainerId", data.venderId);
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "infos.maintainer", data.name);
|
|
|
+ tools.setDataForKey(this.tableData[this.row], 'infos.maintainerWeb', data.website?data.website:null)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], 'infos.maintainerContactor', data.contacts[0]?data.contacts[0].name:null)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], 'infos.maintainerPhone', data.contacts[0]?data.contacts[0].phone:null)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], 'infos.maintainerEmail', data.contacts[0]?data.contacts[0].email:null)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], 'infos.maintainerFax', data.contacts[0]?data.contacts[0].fax:null)
|
|
|
},
|
|
|
supplyChange(data) {
|
|
|
- tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.SupplierContractID", { id: data });
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "infos.supplierContractID", { id: data });
|
|
|
},
|
|
|
//保险合同
|
|
|
guaranteeChange(data) {
|
|
|
for (let key in data) {
|
|
|
- this.utilToKey(key, "insuranceNo", data, "InsuranceNum");
|
|
|
+ this.utilToKey(key, "insuranceNo", data, "insuranceNum");
|
|
|
if (key == "contractFile") {
|
|
|
if (!!data[key]) {
|
|
|
data[key] = [data[key]];
|
|
|
}
|
|
|
}
|
|
|
- this.utilToKey(key, "contractFile", data, "InsuranceFile");
|
|
|
+ this.utilToKey(key, "contractFile", data, "insuranceFile");
|
|
|
}
|
|
|
},
|
|
|
//上传文件弹窗触发事件
|
|
@@ -455,7 +449,7 @@ export default {
|
|
|
//其他的开始判断
|
|
|
let val = this.tableExample.colToProp(row.col);
|
|
|
//设备二维码图片
|
|
|
- if (val == "EquipQRCode") {
|
|
|
+ if (val == "defaultQRCode") {
|
|
|
this.myDialog.qrcode = true;
|
|
|
this.$refs.qrcode.getCanvas(1111);
|
|
|
}
|
|
@@ -481,7 +475,7 @@ export default {
|
|
|
this.myDialog.insurer = true;
|
|
|
}
|
|
|
//供应合同编号
|
|
|
- if (val == "LedgerParam.SupplyPurchase.SupplierContractID") {
|
|
|
+ if (val == "infos.supplierContractID") {
|
|
|
let falg = null;
|
|
|
let data = this.tableData[row.row].dpSupplierId;
|
|
|
if (data) {
|
|
@@ -495,7 +489,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
//保险单号
|
|
|
- if (val == "LedgerParam.InsuranceDoc.InsuranceNum") {
|
|
|
+ if (val == "infos.insuranceNum") {
|
|
|
//选择保单
|
|
|
let falg = null;
|
|
|
let data = this.tableData[row.row].dpInsurerId
|
|
@@ -532,15 +526,15 @@ export default {
|
|
|
}
|
|
|
//安装照片--设备铭牌照片
|
|
|
if (
|
|
|
- val == "LedgerParam.Siteinstall.InstallPic" ||
|
|
|
- val == "LedgerParam.PhotoDoc.Nameplate"
|
|
|
+ val == "infos.installPic" ||
|
|
|
+ val == "infos.nameplate"
|
|
|
) {
|
|
|
let data = tools.dataForKey(this.tableData[row.row], val)
|
|
|
this.imgsArr = data ? data : []
|
|
|
this.myDialog.uploadImgs = true;
|
|
|
}
|
|
|
//设备照片
|
|
|
- if (val == "LedgerParam.PhotoDoc.Pic") {
|
|
|
+ if (val == "infos.pic") {
|
|
|
let data = tools.dataForKey(this.tableData[row.row], val)
|
|
|
this.picsArr = data ? data : []
|
|
|
this.myDialog.pic = true;
|