|
@@ -1,11 +1,19 @@
|
|
|
<template>
|
|
|
<div id="deviceList">
|
|
|
- <el-row class="right">
|
|
|
- <span style="float:left;">当前选择的部件类型:{{category.Name}}</span>
|
|
|
- <div style="width:200px;display:inline-block;text-align:left;color:gray;">
|
|
|
+ <el-row class="left">
|
|
|
+ <span style="float:right;">当前选择的部件类型:{{category.Name}}</span>
|
|
|
+ <!-- <div style="width:200px;display:inline-block;text-align:left;color:gray;">
|
|
|
<span>隐藏自动填充的信息</span>
|
|
|
<el-checkbox v-model="isWatch" @change="getTableHeader"></el-checkbox>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
+ <el-select v-model="showType" @change="initTable" style="width:100px;margin-right:10px;vertical-align:bottom;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in showTypes"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
<span>增加</span>
|
|
|
<el-input v-model="addNum" style="width:40px;" size="small"></el-input>
|
|
|
<span>个{{category.Name}}</span>
|
|
@@ -92,7 +100,12 @@ export default {
|
|
|
? session.get("partsAddData")
|
|
|
: [{ Checked: 1 }]
|
|
|
: [{ Checked: 1 }],
|
|
|
- isWatch: true,
|
|
|
+ showTypes: [
|
|
|
+ {value: "partInfo", label: '隐藏自动填充的信息点'},
|
|
|
+ {value: "all", label: '全部'},
|
|
|
+ {value: "Visible", label: '只看要采集的信息'}
|
|
|
+ ],
|
|
|
+ showType: "partInfo",
|
|
|
copyTableData: [],
|
|
|
category: "", //当前设备类
|
|
|
myDialog: {
|
|
@@ -119,21 +132,6 @@ export default {
|
|
|
systemId: null,
|
|
|
graphyId: null,
|
|
|
id: 0,
|
|
|
- readArr: [
|
|
|
- "A1",
|
|
|
- "A2",
|
|
|
- "B1",
|
|
|
- "C5",
|
|
|
- "D1",
|
|
|
- "D2",
|
|
|
- "E1",
|
|
|
- "F1",
|
|
|
- "F2",
|
|
|
- "L",
|
|
|
- "L1",
|
|
|
- "L2",
|
|
|
- "M"
|
|
|
- ],
|
|
|
EquipmentList: [],
|
|
|
firmId: "" //品牌型号所需字段--族id三位编码(传设备类id或部件类id)
|
|
|
};
|
|
@@ -164,9 +162,12 @@ export default {
|
|
|
// 获取表头数据(初始化表格)
|
|
|
async getTableHeader() {
|
|
|
let params = {
|
|
|
- PageNumber: 1,
|
|
|
- PageSize: 500,
|
|
|
- Filters: `type='Equipment' or type='${this.category.Code}'`
|
|
|
+ data: {
|
|
|
+ PageNumber: 1,
|
|
|
+ PageSize: 500
|
|
|
+ },
|
|
|
+ type: this.category.Code
|
|
|
+ // Filters: `type='Equipment' or type='${this.category.Code}'`
|
|
|
};
|
|
|
await getDataDictionary(params, res => {
|
|
|
this.tableHeader = res.Content;
|
|
@@ -209,9 +210,9 @@ export default {
|
|
|
params.Category = this.category.Code //当前部件分类
|
|
|
params.Family = this.firmId;
|
|
|
if (newData[i].Checked) {//同时创建资产
|
|
|
- await createPropertyData(params, async res => {
|
|
|
+ await createPropertyData([params], async res => {
|
|
|
params.PropertyId = res.Id
|
|
|
- await createPart(params, res => {
|
|
|
+ await createPart([params], res => {
|
|
|
if (i == newData.length - 1) {
|
|
|
this.$router.push({
|
|
|
path: "/ledger/partsmanage",
|
|
@@ -276,33 +277,15 @@ export default {
|
|
|
},
|
|
|
//格式化表头显示的数据
|
|
|
formatHeaderData(list) {
|
|
|
- let arr = tools.copyArr(list);
|
|
|
- arr.map(item => {
|
|
|
- item.Visible = true;
|
|
|
- });
|
|
|
- if (!this.onlyRead) {
|
|
|
- this.readArr.push("Own");
|
|
|
- }
|
|
|
- let data = showTools.tableHeadFilter(
|
|
|
- arr,
|
|
|
- this.readArr,
|
|
|
- this.onlyRead,
|
|
|
- this.isWatch,
|
|
|
- false
|
|
|
- );
|
|
|
- data.unshift("同时创建资产");
|
|
|
- return data;
|
|
|
+ let arr = tools.copyArr(list)
|
|
|
+ let data = showTools.headerTextFilter(arr, "parts", this.onlyRead, this.showType, true)
|
|
|
+ data.unshift("同时创建资产")
|
|
|
+ return data
|
|
|
},
|
|
|
formatHeaderType(list) {
|
|
|
//格式化表头头映射的数据
|
|
|
let arr = tools.copyArr(list);
|
|
|
- let data = showTools.tableHeaderTypes(
|
|
|
- arr,
|
|
|
- this.readArr,
|
|
|
- this.onlyRead,
|
|
|
- this.isWatch,
|
|
|
- false
|
|
|
- );
|
|
|
+ let data = showTools.headerTypeFilter(arr, "parts", this.onlyRead, this.showType, true)
|
|
|
data.unshift({
|
|
|
type: "checkbox",
|
|
|
checkedTemplate: 1,
|
|
@@ -353,36 +336,29 @@ 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)
|
|
|
- for (let key in data) {
|
|
|
- if (key == "venderId") {
|
|
|
- data[key] = data[key] + "-" + data.name + "/" + data.brand;
|
|
|
- this.utilToKey(key, "venderId", data, "DPManufacturerID");
|
|
|
- }
|
|
|
- }
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)
|
|
|
+ },
|
|
|
+ //供应商变更
|
|
|
+ supplierChange(data) {
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.Supplier", data.name)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "DPSupplierID", data.venderId)
|
|
|
+ },
|
|
|
+ //保险商变更
|
|
|
+ changeInsurer(data) {
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "LedgerParam.InsuranceDoc.Insurer", data.name)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "DPInsurerID", data.venderId)
|
|
|
+ },
|
|
|
+ //维修商变更
|
|
|
+ changeMaintainer(data) {
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "LedgerParam.OperationMainte.Maintainer", data.name)
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "DPMaintainerID", data.venderId)
|
|
|
},
|
|
|
supplyChange(data) {
|
|
|
let changeData = { id: data };
|
|
|
this.utilToKey("id", "id", changeData, "SupplierContractID");
|
|
|
},
|
|
|
- //如果选择供应商之后
|
|
|
- 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)
|
|
|
- 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) {
|
|
@@ -403,36 +379,6 @@ export default {
|
|
|
imgChange(keys) {
|
|
|
this.setDataToMain(keys, this.messKey, this.row);
|
|
|
},
|
|
|
- //维修商变更
|
|
|
- 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)
|
|
|
- for (let key in data) {
|
|
|
- if (key == "venderId") {
|
|
|
- data[key] = data[key] + "-" + data.name;
|
|
|
- this.utilToKey(key, "venderId", data, "DPMaintainerID");
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- //保险商变更
|
|
|
- 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)
|
|
|
- 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, this.row);
|