|
@@ -18,7 +18,7 @@
|
|
|
/>
|
|
|
</el-steps>
|
|
|
<hr>
|
|
|
- <div v-if="active === 0">
|
|
|
+ <div v-show="active === 0">
|
|
|
<section>
|
|
|
<p class="text-message">维护只有单值的信息点</p>
|
|
|
<span class="small">请选择需维护的信息点</span>
|
|
@@ -57,56 +57,82 @@
|
|
|
<el-radio :label="2">以覆盖方式维护</el-radio>
|
|
|
</el-radio-group>
|
|
|
<div style="margin: 15px "></div>
|
|
|
- <!-- <el-checkbox-group-->
|
|
|
- <!-- v-model="checkedFile"-->
|
|
|
- <!-- @change="handleCheckedFileChange"-->
|
|
|
- <!-- >-->
|
|
|
- <!-- <el-checkbox-->
|
|
|
- <!-- v-for="(file,index) in newFolder"-->
|
|
|
- <!-- :label="file"-->
|
|
|
- <!-- :key="index"-->
|
|
|
-
|
|
|
- <!-- >-->
|
|
|
- <!-- <span @click="fourVendors(file)"> {{file.name}}:</span>-->
|
|
|
- <!-- <span v-for="name in file.img">{{name}} </span>-->
|
|
|
- <!-- </el-checkbox>-->
|
|
|
- <!-- </el-checkbox-group>-->
|
|
|
<div class="checkbox">
|
|
|
<p>
|
|
|
- <el-checkbox @change="multiple('archive')">
|
|
|
+ <el-checkbox
|
|
|
+ v-model="videoModel.archive"
|
|
|
+ @change="multiple('archive')"
|
|
|
+ > <!--设备文档-->
|
|
|
{{information.archive.name}}
|
|
|
</el-checkbox>
|
|
|
<span v-for="item in information.archive.Archive">{{item | filterImgName}}</span>
|
|
|
</p>
|
|
|
<p>
|
|
|
- <el-checkbox @change="multiple('checkPoint')">
|
|
|
- {{information.checkPoint.name}}
|
|
|
+ <el-checkbox
|
|
|
+ v-model="videoModel.checkReport"
|
|
|
+ @change="multiple('checkReport')"
|
|
|
+ ><!--安装质检报告-->
|
|
|
+ {{information.checkReport.name}}
|
|
|
</el-checkbox>
|
|
|
- <span v-for="item in information.checkPoint.CheckReport">{{item | filterImgName}}</span>
|
|
|
+ <span v-for="item in information.checkReport.CheckReport">{{item | filterImgName}}</span>
|
|
|
|
|
|
</p>
|
|
|
<p>
|
|
|
- <el-checkbox>{{information.drawing.name}}</el-checkbox>
|
|
|
+ <el-checkbox
|
|
|
+ v-model="videoModel.drawing"
|
|
|
+ @change="multiple('drawing')"
|
|
|
+ ><!--设备图纸-->
|
|
|
+ {{information.drawing.name}}
|
|
|
+ </el-checkbox>
|
|
|
+ <span v-for="item in information.drawing.Drawing">{{item.key | filterImgName}}</span>
|
|
|
+
|
|
|
</p>
|
|
|
<p>
|
|
|
- <el-checkbox>{{information.installDrawing.name}}</el-checkbox>
|
|
|
+ <el-checkbox
|
|
|
+ v-model="videoModel.installDrawing"
|
|
|
+ @change="multiple('installDrawing')"
|
|
|
+ ><!--安装图纸-->
|
|
|
+ {{information.installDrawing.name}}
|
|
|
+ </el-checkbox>
|
|
|
+ <span
|
|
|
+ v-for="item in information.installDrawing.InstallDrawing">{{item.key | filterImgName}}</span>
|
|
|
</p>
|
|
|
|
|
|
<p>
|
|
|
- <el-checkbox>{{information.installPic.name}}</el-checkbox>
|
|
|
+ <el-checkbox
|
|
|
+ v-model="videoModel.installPic"
|
|
|
+ @change="multiple('installPic')"
|
|
|
+ ><!--安装照片-->
|
|
|
+ {{information.installPic.name}}
|
|
|
+ </el-checkbox>
|
|
|
+ <span v-for="item in information.installPic.InstallPic">{{item.key | filterImgName}}</span>
|
|
|
</p>
|
|
|
<p>
|
|
|
- <el-checkbox @change="multiple('insuranceFile')">
|
|
|
+ <el-checkbox
|
|
|
+ v-model="videoModel.insuranceFile"
|
|
|
+ @change="multiple('insuranceFile')"
|
|
|
+ ><!--保险文件-->
|
|
|
{{information.insuranceFile.name}}
|
|
|
</el-checkbox>
|
|
|
<span v-for="item in information.insuranceFile.InsuranceFile">{{item | filterImgName}}</span>
|
|
|
|
|
|
</p>
|
|
|
<p>
|
|
|
- <el-checkbox>{{information.pic.name}}</el-checkbox>
|
|
|
+ <el-checkbox
|
|
|
+ v-model="videoModel.pic"
|
|
|
+ @change="multiple('pic')"
|
|
|
+ ><!--设备照片-->
|
|
|
+ {{information.pic.name}}
|
|
|
+ </el-checkbox>
|
|
|
+ <span v-for="item in information.pic.Pic">{{item.key | filterImgName}}</span>
|
|
|
</p>
|
|
|
<p>
|
|
|
- <el-checkbox>{{information.nameplate.name}}</el-checkbox>
|
|
|
+ <el-checkbox
|
|
|
+ v-model="videoModel.nameplate"
|
|
|
+ @change="multiple('nameplate')"><!--设备铭牌照片-->
|
|
|
+ {{information.nameplate.name}}
|
|
|
+ </el-checkbox>
|
|
|
+ <span v-for="item in information.nameplate.Nameplate">{{item.key | filterImgName}}</span>
|
|
|
</p>
|
|
|
</div>
|
|
|
</section>
|
|
@@ -117,11 +143,11 @@
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div
|
|
|
- v-if="active === 1"
|
|
|
+ v-show="active === 1"
|
|
|
class="all-message"
|
|
|
>
|
|
|
<el-table
|
|
|
- ref="nultipleTable"
|
|
|
+ ref="multipleTable"
|
|
|
:data="tableData"
|
|
|
tooltip-effect="dark"
|
|
|
style="width:100%;margin-bottom: 10px"
|
|
@@ -152,7 +178,6 @@
|
|
|
@change="getAllData"
|
|
|
:page="page"
|
|
|
></my-pagination>
|
|
|
- <el-button @click="maintenanceAll">维护所有</el-button>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
@click="maintenanceSelect"
|
|
@@ -195,12 +220,23 @@
|
|
|
num: 42
|
|
|
}
|
|
|
],
|
|
|
-
|
|
|
- radio: 1,
|
|
|
+ radio: 1, //1增加,2覆盖
|
|
|
checkedFile: [],//多项
|
|
|
multipleSelection: [],//checkbox选择的对象数组
|
|
|
filterList: [],//过滤单项选择的值
|
|
|
-
|
|
|
+ allMessage: {},//收集所有数据
|
|
|
+ deviceList: [],//过滤全选数据
|
|
|
+ onlySelect: [],//检测是否有勾选单值信息
|
|
|
+ videoModel: {
|
|
|
+ archive: false,
|
|
|
+ checkReport: false,
|
|
|
+ drawing: false,
|
|
|
+ installDrawing: false,
|
|
|
+ insuranceFile: false,
|
|
|
+ installPic: false,
|
|
|
+ nameplate: false,
|
|
|
+ pic: false
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
watch:{
|
|
@@ -210,7 +246,7 @@
|
|
|
},
|
|
|
computed: {
|
|
|
newFirm() {
|
|
|
- this.firm.map((item, index) => {
|
|
|
+ this.firm.map(item => {
|
|
|
if (item.num === this.firmName.num) {
|
|
|
item.rname = this.firmName.name
|
|
|
item.info = this.firmName
|
|
@@ -219,14 +255,6 @@
|
|
|
})
|
|
|
return this.firm
|
|
|
},
|
|
|
- // informationList() {
|
|
|
- // let {name, code} = this.fileDataType
|
|
|
- // if (this.information.archive.code === code) {
|
|
|
- // this.information.archive[name] = this.fileDataType.img
|
|
|
- // }
|
|
|
- // this.$forceUpdate()
|
|
|
- // return this.information
|
|
|
- // },
|
|
|
tableData() {
|
|
|
this.allObject.map(item => {
|
|
|
let build = ''
|
|
@@ -247,30 +275,43 @@
|
|
|
},
|
|
|
filters: {
|
|
|
filterImgName(value) {
|
|
|
- if (value.length > 20) {
|
|
|
- return value.substr(0, 15) + '...'
|
|
|
+ if (value.length > 16) {
|
|
|
+ return value.substring(0, 12) + '...'
|
|
|
+ } else {
|
|
|
+ return value
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- next() { //下一步
|
|
|
+ next() { //下一步按钮
|
|
|
// if (this.active++ > 1) this.active = 0
|
|
|
- // 如果单项全选
|
|
|
- if (this.checkAll) {
|
|
|
- let deviceList = this.firm.filter(item => item.info)
|
|
|
- if (deviceList.length < 4) {
|
|
|
+ this.deviceList = this.firm.filter(item => item.info)
|
|
|
+ if (!this.onlySelect.length) { //对单项全选进行过滤
|
|
|
+ this.$message({
|
|
|
+ message: '还没有选择单值信息哦',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (!this.deviceList.length) { //对单项全选进行过滤
|
|
|
+ this.$message({
|
|
|
+ message: '单值信息没有填写哦',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (this.checkAll) { // 如果单项全选
|
|
|
+ if (this.deviceList.length < 4) { //对单项全选进行过滤
|
|
|
this.$message({
|
|
|
- message: '单值的信息点有未填写',
|
|
|
+ message: '单值的信息点存在未填写',
|
|
|
type: 'warning'
|
|
|
});
|
|
|
+ return false
|
|
|
} else {
|
|
|
- this.$emit('deviceList', deviceList)
|
|
|
-
|
|
|
+ this.active++
|
|
|
}
|
|
|
} else {
|
|
|
- if (this.filterList.length) {
|
|
|
- this.$emit('deviceList', this.filterList)
|
|
|
- }
|
|
|
+ this.active++
|
|
|
}
|
|
|
},
|
|
|
handleCheckChange(val) { //全选
|
|
@@ -279,6 +320,7 @@
|
|
|
|
|
|
},
|
|
|
handleCheckedCitiesChange(value) { //维护单项触发
|
|
|
+ this.onlySelect = value
|
|
|
this.filterList = value.filter(item => item.info)
|
|
|
let checkCount = value.length
|
|
|
this.checkAll = checkCount === this.firm.length
|
|
@@ -291,27 +333,127 @@
|
|
|
},
|
|
|
// 选择维护方式
|
|
|
maintenance(val) {
|
|
|
- if (val === 1) { //增量
|
|
|
+ },
|
|
|
|
|
|
+ maintenanceSelect() { //维护已选
|
|
|
+ if (!this.multipleSelection.length) {
|
|
|
+ this.$message({
|
|
|
+ message: '还没有选择实例哦',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return false
|
|
|
}
|
|
|
- if (val === 2) { //覆盖
|
|
|
+ // this.multipleSelection 实例对象
|
|
|
+ let arr = []
|
|
|
+ // DPSupplierID 供应商 DPManufacturerID 生产商 DPBrandID 品牌
|
|
|
+ // DPSpecificationID 型号 DPInsurerID 保险商 DPMaintainerID 维修商
|
|
|
+ this.multipleSelection.forEach(item => {
|
|
|
+ let EquipID = item.EquipID
|
|
|
+ arr.push({EquipID})
|
|
|
+ })
|
|
|
|
|
|
+ let single = {
|
|
|
+ EquipManufactor: {
|
|
|
+ Manufacturer: '', //生产商
|
|
|
+ // venderId: '',
|
|
|
+ Brand: '',//品牌
|
|
|
+ brandId: '',
|
|
|
+ Specification: '',//型号
|
|
|
+ specificationId: ''
|
|
|
+ },
|
|
|
+ SupplyPurchase: { //供应商
|
|
|
+ SupplierWeb: '',
|
|
|
+ Supplier: '',
|
|
|
+ // venderId: ''
|
|
|
+ // PurchasePrice: ''
|
|
|
+ },
|
|
|
+ OperationMainte: { //维修商
|
|
|
+ Maintainer: '',
|
|
|
+ // venderId: ''
|
|
|
+ },
|
|
|
+ InsuranceDoc: {
|
|
|
+ Insurer: '',
|
|
|
+ InsurerWeb: '',
|
|
|
+ // venderId: '',
|
|
|
+ InsuranceFile: this.information.insuranceFile.InsuranceFile
|
|
|
+ }
|
|
|
+ };
|
|
|
+ // this.deviceList 单选数组,取到需要数据
|
|
|
+ // 过滤数组,取对象
|
|
|
+ this.deviceList.filter(item => item.num === 2).forEach(i => { //型号
|
|
|
+ let {venderName, brandName, Specification, venderId, brandId, specificationId} = i.info
|
|
|
+ single.EquipManufactor.Manufacturer = venderName
|
|
|
+ // single.EquipManufactor.venderId = venderId
|
|
|
+ single.EquipManufactor.Brand = brandName
|
|
|
+ // single.EquipManufactor.brandId = brandId
|
|
|
+ single.EquipManufactor.Specification = Specification
|
|
|
+ // single.EquipManufactor.specificationId = specificationId
|
|
|
+ })
|
|
|
+ this.deviceList.filter(item => item.num === 8).forEach(i => { //供应商8
|
|
|
+ let {website, name, venderId} = i.info
|
|
|
+ single.SupplyPurchase.SupplierWeb = website
|
|
|
+ single.SupplyPurchase.Supplier = name
|
|
|
+ // single.SupplyPurchase.venderId = venderId
|
|
|
+ })
|
|
|
+ this.deviceList.filter(item => item.num === 35).forEach(i => { //维修商
|
|
|
+ let {name, venderId} = i.info
|
|
|
+ single.OperationMainte.Maintainer = name
|
|
|
+ // single.OperationMainte.venderId = venderId
|
|
|
+ })
|
|
|
+ this.deviceList.filter(item => item.num === 42).forEach(i => { //保险
|
|
|
+ let {website, name, venderId} = i.info
|
|
|
+ single.InsuranceDoc.Insurer = name
|
|
|
+ single.InsuranceDoc.InsurerWeb = website
|
|
|
+ // single.InsuranceDoc.venderId = venderId
|
|
|
+ })
|
|
|
+ // this.information 多选信息
|
|
|
+ let {archive, checkReport, drawing, installDrawing, installPic, insuranceFile, nameplate, pic} = this.information
|
|
|
+ let multiple = {
|
|
|
+ InsuranceDoc: {
|
|
|
+ InsuranceFile: insuranceFile.InsuranceFile
|
|
|
+ },
|
|
|
+ PhotoDoc: {
|
|
|
+ Archive: archive.Archive,
|
|
|
+ Drawing: drawing.Drawing,
|
|
|
+ Nameplate: nameplate.Nameplate,
|
|
|
+ Pic: pic.Pic
|
|
|
+ },
|
|
|
+ Siteinstall: {
|
|
|
+ InstallPic: installPic.InstallPic,
|
|
|
+ InstallDrawing: installDrawing.InstallDrawing,
|
|
|
+ CheckReport: checkReport.CheckReport
|
|
|
+ }
|
|
|
}
|
|
|
- },
|
|
|
- maintenanceAll() { //维护所有
|
|
|
- console.log(this.tableData)
|
|
|
- // this.closeDialog()
|
|
|
- },
|
|
|
- maintenanceSelect() { //维护已选
|
|
|
- console.log(this.multipleSelection)
|
|
|
- // this.closeDialog()
|
|
|
+ let LedgerParam = {}
|
|
|
+ if (this.radio === 1) { //组装数据,根据是覆盖该是增量,1是增量
|
|
|
+ // 1:单选数据
|
|
|
+ let arr1 = this.deepCopy(arr)
|
|
|
+ arr1.forEach(item => (item.LedgerParam = {...single}))
|
|
|
+ // 2:多选数据
|
|
|
+ let arr2 = this.deepCopy(arr)
|
|
|
+ arr2.forEach(item => (item.LedgerParam = {...multiple}))
|
|
|
+ console.log(arr1, arr2)
|
|
|
+ this.$emit('upDataDevice', 1, arr1, arr2)
|
|
|
+
|
|
|
+ }
|
|
|
+ if (this.radio === 2) {
|
|
|
+ let {InsuranceDoc, ...multiples} = multiple
|
|
|
+ LedgerParam = {
|
|
|
+ ...single,
|
|
|
+ ...multiples
|
|
|
+
|
|
|
+ };
|
|
|
+ let arr3 = this.deepCopy(arr)
|
|
|
+ arr3.forEach(item => item.LedgerParam = {...LedgerParam})
|
|
|
+ this.$emit('upDataDevice', 2, arr3)
|
|
|
+ }
|
|
|
+ this.closeDialog()
|
|
|
},
|
|
|
closeDialog() { //关闭弹窗,返回初始状态
|
|
|
this.batchDialog = false
|
|
|
this.active = 0
|
|
|
},
|
|
|
- handleSelectionChange(val) { //表格复选
|
|
|
- console.log(val, this.multipleSelection, '表格按钮checkbox')
|
|
|
+ handleSelectionChange(val) {
|
|
|
this.multipleSelection = val
|
|
|
},
|
|
|
getAllData() {
|
|
@@ -319,6 +461,10 @@
|
|
|
},
|
|
|
multiple(val) {
|
|
|
this.$emit('multiple',val)
|
|
|
+ },
|
|
|
+
|
|
|
+ deepCopy(obj) {
|
|
|
+ return JSON.parse(JSON.stringify(obj))
|
|
|
}
|
|
|
}
|
|
|
}
|