|
@@ -23,12 +23,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-row class="center">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- size="medium"
|
|
|
- @click="handleCreateTableData"
|
|
|
- class="create_button"
|
|
|
- >创建部件</el-button>
|
|
|
+ <el-button type="primary" size="medium" @click="handleCreateTableData" class="create_button">创建部件</el-button>
|
|
|
</el-row>
|
|
|
<!-- 二维码弹窗 -->
|
|
|
<qrcode :dialog="myDialog" :qrcodeUrl="qrcodeUrl" :addBody="true" ref="qrcode"></qrcode>
|
|
@@ -39,27 +34,11 @@
|
|
|
<!-- 供应商弹窗 -->
|
|
|
<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>
|
|
|
+ <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>
|
|
|
+ <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>
|
|
@@ -75,8 +54,8 @@ import handsonTable from "@/components/common/handsontable";
|
|
|
import {
|
|
|
getDataDictionary,
|
|
|
createPart,
|
|
|
- getEquipmentFamily,
|
|
|
- createPropertyData
|
|
|
+ createPropertyData,
|
|
|
+ getEquipBelongs
|
|
|
} from "@/api/scan/request";
|
|
|
import { mapGetters, mapActions } from "vuex";
|
|
|
|
|
@@ -142,7 +121,6 @@ export default {
|
|
|
picsArr: [], //临时设备图片keys数组
|
|
|
systemId: null,
|
|
|
graphyId: null,
|
|
|
- mess: {},
|
|
|
id: 0,
|
|
|
readArr: [
|
|
|
"A1",
|
|
@@ -160,7 +138,7 @@ export default {
|
|
|
"M"
|
|
|
],
|
|
|
EquipmentList: [],
|
|
|
- firmId: "" //品牌型号所需字段
|
|
|
+ firmId: "" //品牌型号所需字段--族id三位编码(传设备类id或部件类id)
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -169,18 +147,22 @@ export default {
|
|
|
created() {
|
|
|
this.category = this.$route.params;
|
|
|
this.category.ParentId = this.category.Code.substr(0, 4);
|
|
|
- this.mess = {
|
|
|
- deviceId: this.category.ParentId
|
|
|
- };
|
|
|
- this.getEquipmentFamilyList();
|
|
|
+ this.getBelongs();
|
|
|
this.getTableHeader();
|
|
|
},
|
|
|
methods: {
|
|
|
- getEquipmentFamilyList() {
|
|
|
- getEquipmentFamily(res => {
|
|
|
- this.EquipmentList = res.Content;
|
|
|
- this.changeCader();
|
|
|
- });
|
|
|
+ //查询部件类对应的 族
|
|
|
+ getBelongs() {
|
|
|
+ let params = {
|
|
|
+ data: {
|
|
|
+ Filters: `EquipCode='${this.category.Code}'`,
|
|
|
+ PageNumber: 1,
|
|
|
+ PageSize: 50
|
|
|
+ }
|
|
|
+ }
|
|
|
+ getEquipBelongs(params, res => {
|
|
|
+ this.firmId = res.Content[0].Family;
|
|
|
+ })
|
|
|
},
|
|
|
// 获取表头数据(初始化表格)
|
|
|
async getTableHeader() {
|
|
@@ -205,7 +187,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
let newK = Object.keys(item)
|
|
|
- if ((item.Checked&&newK.length>1) || (!item.Checked&&newK.length)) {
|
|
|
+ if ((item.Checked && newK.length > 1) || (!item.Checked && newK.length)) {
|
|
|
return item;
|
|
|
}
|
|
|
});
|
|
@@ -214,8 +196,8 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
let flag = false;
|
|
|
- newData.map(item=>{
|
|
|
- if(item.Checked&&!item.EquipLocalName){
|
|
|
+ newData.map(item => {
|
|
|
+ if (item.Checked && !item.EquipLocalName) {
|
|
|
flag = true;
|
|
|
}
|
|
|
})
|
|
@@ -225,17 +207,20 @@ export default {
|
|
|
}
|
|
|
|
|
|
for (let i = 0; i < newData.length; i++) {
|
|
|
- let params = { projectId: this.projectId }
|
|
|
+ let params = {
|
|
|
+ projectId: this.projectId
|
|
|
+ }
|
|
|
let data = {
|
|
|
ParentId: this.category.deviceId, //当前设备id
|
|
|
Category: this.category.Code //当前部件分类
|
|
|
};
|
|
|
params.data = Object.assign(data, newData[i]);
|
|
|
- if(newData[i].Checked){//同时创建资产
|
|
|
+ params.data.Family = this.firmId;
|
|
|
+ if (newData[i].Checked) {//同时创建资产
|
|
|
await createPropertyData(params, async res => {
|
|
|
params.data.PropertyId = res.Id
|
|
|
- await createPart(params, res=>{
|
|
|
- if(i==newData.length-1){
|
|
|
+ await createPart(params, res => {
|
|
|
+ if (i == newData.length - 1) {
|
|
|
this.$router.push({
|
|
|
path: "/ledger/partsmanage",
|
|
|
query: {
|
|
@@ -247,9 +232,9 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
- }else{
|
|
|
- await createPart(params, res=>{
|
|
|
- if(i==newData.length-1){
|
|
|
+ } else {
|
|
|
+ await createPart(params, res => {
|
|
|
+ if (i == newData.length - 1) {
|
|
|
this.$router.push({
|
|
|
path: "/ledger/partsmanage",
|
|
|
query: {
|
|
@@ -376,11 +361,10 @@ export default {
|
|
|
},
|
|
|
//选择型号修改
|
|
|
firmChange(data) {
|
|
|
- console.log(this.row)
|
|
|
- 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;
|
|
@@ -394,12 +378,12 @@ 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;
|
|
@@ -429,12 +413,12 @@ 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;
|
|
@@ -444,12 +428,12 @@ 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;
|
|
@@ -461,15 +445,6 @@ export default {
|
|
|
changePics(keys) {
|
|
|
this.setDataToMain(keys, this.messKey, this.row);
|
|
|
},
|
|
|
- setGraphyId(graphyId, assetGroupList) {
|
|
|
- this.graphyId = graphyId;
|
|
|
- this.assetGroupList = assetGroupList;
|
|
|
- },
|
|
|
- //触发父组件change
|
|
|
- getClose(val) {
|
|
|
- this.$emit("close", val);
|
|
|
- },
|
|
|
- reset() {},
|
|
|
//表格点击事件
|
|
|
handleTdClick(el, rowArr) {
|
|
|
//点击的是表头
|
|
@@ -575,11 +550,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: []
|
|
|
+ this.filesArr = data ? data : []
|
|
|
// this.filesArr = this.tableData[row.row].infos
|
|
|
// ? this.tableData[row.row].infos[val.split(".")[1]]
|
|
|
// ? [this.tableData[row.row].infos[val.split(".")[1]]]
|
|
@@ -595,7 +570,7 @@ export default {
|
|
|
val == "LedgerParam.PhotoDoc.Drawing"
|
|
|
) {
|
|
|
let data = tools.dataForKey(this.tableData[row.row], val)
|
|
|
- this.imgsArr = data? data: []
|
|
|
+ this.imgsArr = data ? data : []
|
|
|
// if (val == "LedgerParam.PhotoDoc.Nameplate") {
|
|
|
// this.imgsArr = this.tableData[row.row].infos
|
|
|
// ? this.tableData[row.row].infos[val.split(".")[1]]
|
|
@@ -614,7 +589,7 @@ export default {
|
|
|
//设备照片
|
|
|
if (val == "LedgerParam.PhotoDoc.Pic") {
|
|
|
let data = tools.dataForKey(this.tableData[row.row], val)
|
|
|
- this.picsArr = data? data: []
|
|
|
+ this.picsArr = data ? data : []
|
|
|
// this.picsArr = this.tableData[row.row].infos
|
|
|
// ? this.tableData[row.row].infos[val.split(".")[1]]
|
|
|
// ? this.tableData[row.row].infos[val.split(".")[1]]
|
|
@@ -625,18 +600,6 @@ export default {
|
|
|
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);
|