|
@@ -264,15 +264,15 @@ export default {
|
|
|
//生成要修改字段列表
|
|
|
change.map(item => {
|
|
|
if (item[1] && param.data.Projection.indexOf(item[1]) == -1) {
|
|
|
- param.data.Projection.push(item[1].split('.')[0]);
|
|
|
+ param.data.Projection.push(item[1].split(".")[0]);
|
|
|
}
|
|
|
});
|
|
|
//生成对应修改数据
|
|
|
data.map((item, index) => {
|
|
|
- param.data.Projection.map((value) => {
|
|
|
- let itemData = tools.dataForKey(item,value)
|
|
|
- tools.setDataForKey(item, value, itemData == ""?null:itemData)
|
|
|
- })
|
|
|
+ param.data.Projection.map(value => {
|
|
|
+ let itemData = tools.dataForKey(item, value);
|
|
|
+ tools.setDataForKey(item, value, itemData == "" ? null : itemData);
|
|
|
+ });
|
|
|
// let keyarr = change[index][1].split(".");
|
|
|
// if (keyarr && keyarr.length > 1) {
|
|
|
// item[keyarr[0]][keyarr[1]] =
|
|
@@ -284,7 +284,6 @@ export default {
|
|
|
// }
|
|
|
param.data.Content.push(item);
|
|
|
});
|
|
|
- console.log(param)
|
|
|
await updateParts(param).then(res => {});
|
|
|
},
|
|
|
// 删除表格数据
|
|
@@ -472,10 +471,26 @@ export default {
|
|
|
},
|
|
|
//选择型号修改
|
|
|
firmChange(data) {
|
|
|
- tools.setDataForKey(this.tableData[this.row],"DPSpecificationID",data.specificationId)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.EquipManufactor.Brand",data.brand)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.EquipManufactor.Specification",data.name)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.EquipManufactor.Manufacturer",data.venderName)
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "DPSpecificationID",
|
|
|
+ data.specificationId
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.EquipManufactor.Brand",
|
|
|
+ data.brand
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.EquipManufactor.Specification",
|
|
|
+ data.name
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.EquipManufactor.Manufacturer",
|
|
|
+ data.venderName
|
|
|
+ );
|
|
|
for (let key in data) {
|
|
|
if (key == "venderId") {
|
|
|
data[key] = data[key] + "-" + data.name + "/" + data.brand;
|
|
@@ -489,12 +504,36 @@ export default {
|
|
|
},
|
|
|
//如果选择供应商之后
|
|
|
supplierChange(data) {
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.SupplyPurchase.Supplier",data.name)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.SupplyPurchase.SupplierWeb",data.website)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.SupplyPurchase.SupplierContactor",data.man)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.SupplyPurchase.SupplierPhone",data.phone)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.SupplyPurchase.SupplierFax",data.fox)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.SupplyPurchase.SupplierEmail",data.email)
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.SupplyPurchase.Supplier",
|
|
|
+ data.name
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.SupplyPurchase.SupplierWeb",
|
|
|
+ data.website
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.SupplyPurchase.SupplierContactor",
|
|
|
+ data.man
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.SupplyPurchase.SupplierPhone",
|
|
|
+ data.phone
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.SupplyPurchase.SupplierFax",
|
|
|
+ data.fox
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.SupplyPurchase.SupplierEmail",
|
|
|
+ data.email
|
|
|
+ );
|
|
|
for (let key in data) {
|
|
|
if (key == "venderId") {
|
|
|
data[key] = data[key] + "-" + data.name;
|
|
@@ -524,12 +563,36 @@ export default {
|
|
|
},
|
|
|
//维修商变更
|
|
|
changeMaintainer(data) {
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.OperationMainte.Maintainer",data.name)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.OperationMainte.MaintainerWeb",data.website)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.OperationMainte.MaintainerContactor",data.man)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.OperationMainte.MaintainerPhone",data.phone)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.OperationMainte.MaintainerFax",data.fox)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.OperationMainte.MaintainerEmail",data.email)
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.OperationMainte.Maintainer",
|
|
|
+ data.name
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.OperationMainte.MaintainerWeb",
|
|
|
+ data.website
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.OperationMainte.MaintainerContactor",
|
|
|
+ data.man
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.OperationMainte.MaintainerPhone",
|
|
|
+ data.phone
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.OperationMainte.MaintainerFax",
|
|
|
+ data.fox
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.OperationMainte.MaintainerEmail",
|
|
|
+ data.email
|
|
|
+ );
|
|
|
for (let key in data) {
|
|
|
if (key == "venderId") {
|
|
|
data[key] = data[key] + "-" + data.name;
|
|
@@ -539,12 +602,36 @@ export default {
|
|
|
},
|
|
|
//保险商变更
|
|
|
changeInsurer(data) {
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.InsuranceDoc.InsurerEmail",data.email)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.InsuranceDoc.InsurerFax",data.fox)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.InsuranceDoc.InsurerPhone",data.phone)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.InsuranceDoc.InsurerContactor",data.man)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.InsuranceDoc.InsurerWeb",data.website)
|
|
|
- tools.setDataForKey(this.tableData[this.row],"LedgerParam.InsuranceDoc.Insurer",data.name)
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.InsuranceDoc.InsurerEmail",
|
|
|
+ data.email
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.InsuranceDoc.InsurerFax",
|
|
|
+ data.fox
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.InsuranceDoc.InsurerPhone",
|
|
|
+ data.phone
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.InsuranceDoc.InsurerContactor",
|
|
|
+ data.man
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.InsuranceDoc.InsurerWeb",
|
|
|
+ data.website
|
|
|
+ );
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.tableData[this.row],
|
|
|
+ "LedgerParam.InsuranceDoc.Insurer",
|
|
|
+ data.name
|
|
|
+ );
|
|
|
for (let key in data) {
|
|
|
if (key == "venderId") {
|
|
|
data[key] = data[key] + "-" + data.name;
|
|
@@ -622,11 +709,11 @@ export default {
|
|
|
}
|
|
|
//设备二维码图片
|
|
|
if (val == "EquipQRCode") {
|
|
|
- this.qrcodeUrl = this.tableData[row.row].EquipQRCode
|
|
|
+ this.qrcodeUrl = this.tableData[row.row].EquipQRCode;
|
|
|
if (!!this.qrcodeUrl) {
|
|
|
this.myDialog.qrcode = true;
|
|
|
} else {
|
|
|
- this.$message("此设备没有设备二维码")
|
|
|
+ this.$message("此设备没有设备二维码");
|
|
|
}
|
|
|
}
|
|
|
//关联系统
|
|
@@ -654,6 +741,9 @@ export default {
|
|
|
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;
|
|
@@ -665,7 +755,10 @@ export default {
|
|
|
if (val == "LedgerParam.InsuranceDoc.InsuranceNum") {
|
|
|
//选择保单
|
|
|
let falg = null;
|
|
|
- let data = this.tableData[row.row].DPInsurerID
|
|
|
+ let data = this.tableData[row.row].DPInsurerID;
|
|
|
+ if (data) {
|
|
|
+ falg = data.split("-")[0];
|
|
|
+ }
|
|
|
if (!!falg) {
|
|
|
this.id = falg;
|
|
|
this.myDialog.guarantee = true;
|
|
@@ -676,11 +769,11 @@ export default {
|
|
|
//保险文件--设备文档--安装质检报告
|
|
|
if (
|
|
|
val == "LedgerParam.InsuranceDoc.InsuranceFile" ||
|
|
|
- val == "LedgerParam.PhotoDoc.Archive" ||
|
|
|
+ val == "LedgerParam.PhotoDoc.Archive" ||
|
|
|
val == "LedgerParam.Siteinstall.CheckReport"
|
|
|
) {
|
|
|
- let data = tools.dataForKey(this.tableData[row.row], val)
|
|
|
- this.filesArr = data? data: []
|
|
|
+ let data = tools.dataForKey(this.tableData[row.row], val);
|
|
|
+ this.filesArr = data ? data : [];
|
|
|
this.myDialog.uploadFiles = true;
|
|
|
}
|
|
|
//安装照片--安装图纸--设备铭牌照片--设备图纸
|
|
@@ -690,14 +783,14 @@ export default {
|
|
|
val == "LedgerParam.PhotoDoc.Nameplate" ||
|
|
|
val == "LedgerParam.PhotoDoc.Drawing"
|
|
|
) {
|
|
|
- let data = tools.dataForKey(this.tableData[row.row], val)
|
|
|
- this.imgsArr = data? data: []
|
|
|
+ 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: []
|
|
|
+ let data = tools.dataForKey(this.tableData[row.row], val);
|
|
|
+ this.picsArr = data ? data : [];
|
|
|
this.myDialog.pic = true;
|
|
|
}
|
|
|
this.row = row.row;
|
|
@@ -722,17 +815,16 @@ export default {
|
|
|
},
|
|
|
//判断是否有值,有值赋值
|
|
|
setDataToMain(data, key, row) {
|
|
|
- console.log(111111)
|
|
|
if (!!data && data != "--") {
|
|
|
if (!!this.tableData[row]) {
|
|
|
- tools.setDataForKey(this.tableData[row], key, data)
|
|
|
+ tools.setDataForKey(this.tableData[row], key, data);
|
|
|
this.handleUpdataTable([[row, key, null, data]], "edit");
|
|
|
} else {
|
|
|
this.tableData[row] = {};
|
|
|
- tools.setDataForKey(this.tableData[row], key, data)
|
|
|
+ tools.setDataForKey(this.tableData[row], key, data);
|
|
|
}
|
|
|
} else {
|
|
|
- tools.setDataForKey(this.tableData[row], key, "")
|
|
|
+ tools.setDataForKey(this.tableData[row], key, "");
|
|
|
}
|
|
|
}
|
|
|
}
|