shaun-sheep 5 years ago
parent
commit
d60847e25f

+ 18 - 2
src/api/relation/api.js

@@ -1,9 +1,25 @@
 import httpUtil from "../scan/httpUtil";
 
 export default {
+    //查询总览
     graphic: function (param,success) {
         let url = '/api/datacenter/graphic/page-query'
-        let data = param
-        httpUtil.postJson(url, data,success)
+        httpUtil.postJson(url, param, success)
+    },
+// 查询总览数量
+    graphicNumber: function (param, success) {
+        let url = '/api/datacenter/graphic/query-count'
+        httpUtil.postJson(url, param, success)
+
+    },
+// 下载报告
+    reportDownloads: function (param, success) {
+        let url = '/api/datacenter/graphic/report-downloads'
+        httpUtil.getJson(url, param, success)
+    },
+// 下载模板
+    templateDownloads: function (param, success) {
+        let url = '/api/datacenter/graphic/template-downloads'
+        httpUtil.getJson(url, param, success)
     }
 }

+ 344 - 0
src/components/dialogs/list/batchDialog.vue

@@ -0,0 +1,344 @@
+<template>
+    <el-dialog
+        title="批量维护信息点"
+        :visible.sync="batchDialog"
+        class="batchContainer"
+    >
+        <el-steps
+            :active="active"
+            finish-status="success"
+        >
+            <el-step
+                @click.native="active = 0"
+                title="填写需维护的信息点"
+            />
+            <el-step
+                @click.native="active = 1"
+                title="选择批量维护的对象实例"
+            />
+        </el-steps>
+        <hr>
+        <div v-if="active === 0">
+            <section>
+                <p class="text-message">维护只有单值的信息点</p>
+                <span class="small">请选择需维护的信息点</span>
+                <el-checkbox
+                    :indeterminate="isIndeterminate"
+                    v-model="checkAll"
+                    @change="handleCheckChange"
+                >
+                    全部选择
+                </el-checkbox>
+
+                <div style="margin: 15px "></div>
+                <el-checkbox-group
+                    v-model="checkedCities"
+                    @change="handleCheckedCitiesChange"
+                >
+                    <el-checkbox
+                        v-for="(city,index) in newFirm"
+                        :label="city"
+                        :key="index"
+
+                    >
+                        <span @click="fourVendors(city)"> {{city.name}}:</span>
+                        <span>{{city.rname}}</span>
+                    </el-checkbox>
+                </el-checkbox-group>
+            </section>
+            <!--维护有多个值的信息-->
+            <section>
+                <p class="text-message">维护只有单值的信息点</p>
+                <span class="small">选择值的更新方式</span>
+                <el-radio-group
+                    v-model="radio"
+                    @change="maintenance"
+                >
+                    <el-radio :label="1">以增量方式维护</el-radio>
+                    <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 folder"
+                        :label="file"
+                        :key="index"
+
+                    >
+                        <span @click="fourVendors(file)"> {{file.name}}:</span>
+                        <span>已上传:</span>
+                    </el-checkbox>
+                </el-checkbox-group>
+            </section>
+            <el-button
+                style="margin-top: 12px"
+                @click="next"
+            >下一步
+            </el-button>
+        </div>
+        <div
+            v-if="active === 1"
+            class="all-message"
+        >
+            <el-table
+                ref="nultipleTable"
+                :data="tableData"
+                tooltip-effect="dark"
+                style="width:100%;margin-bottom: 10px"
+                @selection-change="handleSelectionChange"
+            >
+                <el-table-column
+                    type="selection"
+                    width="55"
+                />
+                <el-table-column
+                    label="设备本地名称"
+                    width="120"
+                >
+                    <template slot-scope="scope">{{scope.row.date}}</template>
+                </el-table-column>
+                <el-table-column
+                    prop="name"
+                    label="设备本地编码"
+                    width="120"
+                />
+                <el-table-column
+                    prop="address"
+                    label="所属建筑楼层"
+                    show-overflow-tooltip
+                />
+            </el-table>
+
+            <el-button @click="maintenanceAll">维护所有</el-button>
+            <el-button
+                type="primary"
+                @click="maintenanceSelect"
+            >维护已选
+            </el-button>
+        </div>
+    </el-dialog>
+</template>
+
+<script>
+
+    export default {
+        name: "batchDialog",
+        props: ['firmName'],
+        data() {
+            return {
+                batchDialog: false,//dialog
+                active: 0,//进度条
+                checkAll: false,//全选
+                isIndeterminate: true,
+                checkedCities: [],//选择的项,单项
+                firm: [{
+                    name: "品牌型号",
+                    code: "DPManufacturerID",
+                    num: 2,
+                }, {
+                    name: "供应商信息",
+                    code: "DPSupplierID",
+                    num: 8
+                }, {
+                    name: "维修商信息",
+                    code: "DPMaintainerID",
+                    num: 35
+                }, {
+                    name: "保险公司信息",
+                    code: "DPInsurerID",
+                    num: 42
+                }],
+                folder: [{
+                    name: '保险文件',
+                    code: 'LedgerParam.InsuranceDoc.InsuranceFile',
+                    num: 11
+                },
+                    {
+                        name: '设备铭牌照片',
+                        code: 'LedgerParam.PhotoDoc.Nameplate',
+                        num: 12
+                    },
+                    {
+                        name: '设备图纸',
+                        code: 'LedgerParam.PhotoDoc.Drawing',
+                        num: 13
+                    },
+                    {
+                        name: '设备文档',
+                        code: 'LedgerParam.PhotoDoc.Archive',
+                        num: 14
+                    },
+                    {
+                        name: '设备照片',
+                        code: 'LedgerParam.PhotoDoc.Pic',
+                        num: 15
+                    },
+                    {
+                        name: '安装图纸',
+                        code: 'LedgerParam.Siteinstall.InstallDrawing',
+                        num: 16
+                    },
+                    {
+                        name: '安装照片',
+                        code: 'LedgerParam.Siteinstall.InstallPic',
+                        num: 17
+                    },
+                    {
+                        name: '安装质检报告',
+                        code: 'LedgerParam.Siteinstall.CheckReport',
+                        num: 18
+                    }
+                ],
+                radio: 1,
+                checkedFile: [],//多项
+                tableData: [{
+                    date: '2016-05-03',
+                    name: '王小虎',
+                    address: '上海市普陀区金沙江路 1518 弄'
+                }, {
+                    date: '2016-05-02',
+                    name: '王小虎',
+                    address: '上海市普陀区金沙江路 1518 弄'
+                }, {
+                    date: '2016-05-04',
+                    name: '王小虎',
+                    address: '上海市普陀区金沙江路 1518 弄'
+                }, {
+                    date: '2016-05-01',
+                    name: '王小虎',
+                    address: '上海市普陀区金沙江路 1518 弄'
+                }, {
+                    date: '2016-05-08',
+                    name: '王小虎',
+                    address: '上海市普陀区金沙江路 1518 弄'
+                }, {
+                    date: '2016-05-06',
+                    name: '王小虎',
+                    address: '上海市普陀区金沙江路 1518 弄'
+                }, {
+                    date: '2016-05-07',
+                    name: '王小虎',
+                    address: '上海市普陀区金沙江路 1518 弄'
+                }],
+                multipleSelection: []
+
+            }
+        },
+        computed: {
+            newFirm() {
+                this.firm.map((item, index) => {
+                    if (item.num === this.firmName.num) {
+                        item.rname = this.firmName.name
+                    }
+                    return item
+                })
+                return this.firm
+            }
+        },
+        methods: {
+            next() {
+                if (this.active++ > 1) this.active = 0
+            },
+            handleCheckChange(val) { //全选
+                this.checkedCities = val ? this.firm : []
+                this.isIndeterminate = false
+                if (val === true) { //全部选择
+
+                }
+
+            },
+            handleCheckedCitiesChange(value) { //维护单项触发
+                //value instanceof Array
+                value.forEach(item => {
+                    console.log(item.code)
+                })
+                let checkCount = value.length
+                this.checkAll = checkCount === this.firm.length
+                this.isIndeterminate = checkCount > 0 && checkCount < this.firm.length
+            },
+            handleCheckedFileChange(value,) { //维护多项触发
+                console.log(value, '----')
+            },
+            fourVendors(code) {
+                this.$emit('code', code.code)
+            },
+            //    选择维护方式
+            maintenance(val) {
+                if (val === 1) { //增量
+
+                }
+                if (val === 2) { //覆盖
+
+                }
+            },
+            maintenanceAll() { //维护所有
+                this.closeDialog()
+            },
+            maintenanceSelect() { //维护已选
+                this.closeDialog()
+            },
+            closeDialog() {  //关闭弹窗,返回初始状态
+                this.batchDialog = false
+                this.active = 0
+            },
+            handleSelectionChange(val) { //表格复选
+                this.multipleSelection = val
+            }
+        }
+    }
+</script>
+
+<style scoped lang="less">
+    .batchContainer {
+        .el-steps--horizontal {
+            margin: 0 auto;
+            width: 70%;
+        }
+
+        .el-checkbox-group {
+            display: flex;
+            justify-content: space-between;
+            flex-direction: row;
+            flex-wrap: wrap;
+
+            .el-checkbox {
+                width: 43%;
+            }
+
+            .el-checkbox:last-of-type {
+                margin-right: 30px;
+            }
+        }
+
+        .text-message {
+            overflow: hidden;
+            margin-top: 10px;
+            color: #333;
+            border-left: 8px solid #333;
+            text-indent: 10px;
+            font-weight: 600;
+        }
+
+        .small {
+            font-size: 12px;
+            color: #555;
+        }
+
+        .all-message {
+            overflow: hidden;
+
+            button {
+                float: right;
+                padding: 10px;
+                margin-left: 5px;
+            }
+        }
+
+        /*/deep/ .is-wait {*/
+        /*    margin-left: -150px;*/
+        /*}*/
+    }
+</style>

+ 7 - 4
src/components/dialogs/list/firm.vue

@@ -37,8 +37,8 @@
                 <i style="color:#46B0FF;cursor: pointer;">厂家库</i>维护吧
             </p>
             <my-pagination :page="page" @change="changed" style="margin-top:10px;"></my-pagination>
-        </div> 
-        
+        </div>
+
       </div>
     </div>
     <div slot="footer" class="dialog-footer">
@@ -71,7 +71,10 @@ export default {
     },
     mess: {
       type: [Object, String]
-    }
+    },
+      dataFirmType:{
+        type:String
+}
   },
   data() {
     return {
@@ -104,7 +107,7 @@ export default {
     },
     getChange() {
       if (!!this.radio) {
-        this.$emit("changeFirm", this.radio)
+        this.$emit("changeFirm", this.radio, this.dataFirmType)
         this.dialog.firm = false
         this.radio = ''
       } else {

+ 139 - 70
src/components/ledger/handsontables/device.vue

@@ -7,38 +7,43 @@
         </span> -->
         <span>当前筛选条件下共{{page.total || '--'}}设备</span>
       </div>
+        <!--        编辑模式,只读模式-->
       <el-select v-model="onlyRead" @change="getHeaderData(mess)" style="width:100px;margin-right:20px;vertical-align:bottom;">
         <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
       </el-select>
+        <!--        只看采集信息,全部-->
       <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>
       <!-- <el-button size="small" style='width: 80px;' @click="download" icon="iconfont icon-xiazai">下载</el-button> -->
       <el-button size="small" style='width: 80px;' @click="addDevice">添加设备</el-button>
-      <el-button size="small" style='width: 80px;' @click="reset">刷新</el-button>
+        <el-button size="small" @click="Batch" :disabled="batchDate">批量维护信息点</el-button>
+        <el-button size="small" style='width: 80px;' @click="reset">刷新</el-button>
       <el-button size="small" style='width: 80px;' v-show="!onlyRead" @click="undo">撤销</el-button>
     </div>
     <!-- 二维码弹窗 -->
     <qrcode :dialog="myDialog" :qrcodeUrl="qrcodeUrl" :addBody="true" ref="qrcode"></qrcode>
     <!-- 型号弹窗 -->
-    <firm :mess="{deviceId: deviceType.assetType}" ref="firm" @changeFirm="firmChange" :dialog="myDialog"></firm>
+    <firm :mess="{deviceId: deviceType.assetType}" :dataFirmType='dataFirmType' ref="firm" @changeFirm="firmChange" :dialog="myDialog"></firm>
     <!-- 供应商合同弹窗 -->
     <supply-dialog ref="supply" @change="supplyChange" :id="id" :dialog="myDialog"></supply-dialog>
     <!-- 供应商弹窗 -->
     <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-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>
     <div class=" middle_sty" style="height: 91%; text-align:center" v-show="!mess.deviceId && (!tableData || !tableData.length)">
-      <p>
-        <i class="icon-wushuju iconfont"></i>
-        请选择设备族
-      </p>
+        <p><i class="icon-wushuju iconfont"></i>请选择设备族</p>
     </div>
 
     <div class="center middle_sty" style="height: 91%" v-show="mess.deviceId && (!tableData || !tableData.length)">
@@ -81,73 +86,72 @@
         <el-button type="primary" @click="toAddDevice">下 一 步</el-button>
       </span>
     </el-dialog>
+      <!--维护信息弹窗-->
+      <batchDialog ref="batchDialogs" @code="fourVendors" :firmName="firmName"/>
   </div>
 </template>
 <script>
-import {
-  getTableHeader,//表头
-  getEquipmentFamily,//获取族
-  getBillEquipList,//获取表数据
-  BeatchQueryParam,//通过标号功能号获取值
-  delBatchList,//删除选中设备
-  updateEquip,//更新设备
-  getDataDictionary,//新表头
-  getEquipTableCon,//获取表数据
-  deleteEquip,//删除选中设备
-  getEquipBelongs,//获取族
-} from "@/api/scan/request";
+    import {
+        BeatchQueryParam,
+        deleteEquip,
+        getDataDictionary,
+        getEquipBelongs,
+        getEquipTableCon,
+        updateEquip,
+    } from "@/api/scan/request";
 
 
-import tools from "@/utils/scan/tools"
-import handsonUtils from "@/utils/hasontableUtils"
-import showTools from "@/utils/handsontable/notShow"
-import text from "@/utils/handsontable/mainText"
-import myCascader from "@/components/ledger/lib/cascader"
-import buildFloor from '@/utils/handsontable/buildFloorData'
+    import tools from "@/utils/scan/tools"
+    import handsonUtils from "@/utils/hasontableUtils"
+    import showTools from "@/utils/handsontable/notShow"
+    import text from "@/utils/handsontable/mainText"
+    import myCascader from "@/components/ledger/lib/cascader"
+    import buildFloor from '@/utils/handsontable/buildFloorData'
 
-import qrcode from "@/components/ledger/lib/qrcode"
-import firm from "@/components/dialogs/list/firm"
-import supplyDialog from "@/components/dialogs/list/supplyDialog"
-import supplierDialog from "@/components/dialogs/list/supplierDialog"
-import maintainerDialog from "@/components/dialogs/list/maintainerDialog"
-import insurerDialog from "@/components/dialogs/list/insurerDialog"
-import guaranteeDialog from "@/components/dialogs/list/guaranteeDialog"
-import uploadFilesDialog from "@/components/dialogs/list/filesDialog"
-import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog"
-import picDialog from "@/components/dialogs/list/picDialog"
-import systemType from "@/components/dialogs/list/systemType"
-import myPagination from "@/components/ledger/lib/myPagination"
-import detailsDialog from "@/components/ledger/lib/detailsDia"
-import changeRea from "@/components/dialogs/changeRea"
-import { mapGetters, mapActions } from "vuex"
-//图片查看
-import lookPic from "@/components/ledger/lib/lookImages"
-import Handsontable from "handsontable-pro"
-import 'handsontable-pro/dist/handsontable.full.css'
-import zhCN from 'handsontable-pro/languages/zh-CN'
-//下拉插件
+    import qrcode from "@/components/ledger/lib/qrcode"
+    import firm from "@/components/dialogs/list/firm"
+    import supplyDialog from "@/components/dialogs/list/supplyDialog"
+    import supplierDialog from "@/components/dialogs/list/supplierDialog"
+    import maintainerDialog from "@/components/dialogs/list/maintainerDialog"
+    import insurerDialog from "@/components/dialogs/list/insurerDialog"
+    import guaranteeDialog from "@/components/dialogs/list/guaranteeDialog"
+    import uploadFilesDialog from "@/components/dialogs/list/filesDialog"
+    import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog"
+    import picDialog from "@/components/dialogs/list/picDialog"
+    import systemType from "@/components/dialogs/list/systemType"
+    import myPagination from "@/components/ledger/lib/myPagination"
+    import detailsDialog from "@/components/ledger/lib/detailsDia"
+    import changeRea from "@/components/dialogs/changeRea"
+    import {mapGetters} from "vuex"
+    //图片查看
+    import lookPic from "@/components/ledger/lib/lookImages"
+    import Handsontable from "handsontable-pro"
+    import 'handsontable-pro/dist/handsontable.full.css'
+    import batchDialog from "../../dialogs/list/batchDialog";
+    //下拉插件
 // import "@/assets/js/chosen.jquery.min";
 // import "@/assets/js/handsontable-chosen-editor";
 
 export default {
   props: ["myParam"],
   components: {
-    qrcode, //二维码页面
-    firm, //
-    supplyDialog,
-    supplierDialog,
-    guaranteeDialog,
-    uploadFilesDialog,
-    maintainerDialog,
-    insurerDialog,
-    uploadImgDialog,
-    picDialog,
-    myPagination,
-    systemType,
-    detailsDialog,
-    changeRea,
-    lookPic,
-    myCascader
+      qrcode, //二维码页面
+      firm, //
+      supplyDialog,
+      supplierDialog,
+      guaranteeDialog,
+      uploadFilesDialog,
+      maintainerDialog,
+      insurerDialog,
+      uploadImgDialog,
+      picDialog,
+      myPagination,
+      systemType,
+      detailsDialog,
+      changeRea,
+      lookPic,
+      myCascader,
+      batchDialog
   },
   created() {
     buildFloor.getData(this.buildFloorData)
@@ -158,11 +162,14 @@ export default {
       return this.onlyRead ?
         [{ value: "Visible", label: '只看采集信息' }, { value: "all", label: '全部' }] :
         [{ value: "partInfo", label: '隐藏信息点' }, { value: "all", label: '全部' }, { value: "Visible", label: '只看采集信息' }]
-    }
+    },
+      batchDate() {
+          return !(!this.onlyRead && this.copyMain)
+      }
   },
   data() {
     return {
-      options: [{
+        options: [{
         value: true,
         label: '只读模式'
       }, {
@@ -215,12 +222,14 @@ export default {
       floorData: [],
       curDevice: '',//当前点击的设备id
       addData: {}, //添加设备选择的设备类型
+        dataFirmType:'row',
       inputMap: {
         flowBuild: 'D1'
       }, //信息点和输入方式映射表
       updateInputShow: false, //是否显示临时维护输入框
       updateInfoPoint: '',//临时维护信息点
       updateInput: '', //临时维护信息点值
+        firmName: '',//维护信息显示厂家名称
     };
   },
   methods: {
@@ -593,6 +602,7 @@ export default {
     },
     // 更新
     updateBusiness(data, change) {
+        debugger
       let param = {
         Content: [],
         Projection: []
@@ -657,9 +667,49 @@ export default {
         })
       }
     },
+      //  接受维护信息传来的四大厂商对应code,显示弹窗
+      fourVendors(code) {
+          switch (code) {
+              //品牌型号弹窗
+              case 'DPManufacturerID':
+                  this.dataFirmType = 'dia'
+                  this.myDialog.firm = true;
+                  break;
+              //供应商信息弹窗
+              case 'DPSupplierID':
+                  this.myDialog.supplier = true;
+                  break;
+              //维修商信息弹窗
+              case 'DPMaintainerID':
+                  this.myDialog.maintainer = true;
+                  break;
+              //保险公司信息
+              case 'DPInsurerID':
+                  this.myDialog.insurer = true;
+                  break;
+              //保险文件--设备文档--安装质检报告
+              case 'LedgerParam.InsuranceDoc.InsuranceFile':
+              case 'LedgerParam.PhotoDoc.Archive':
+              case 'LedgerParam.Siteinstall.CheckReport':
+                  this.myDialog.uploadFiles = true;
+                  break;
+              //安装照片--安装图纸--设备铭牌照片--设备图纸
+              case 'LedgerParam.Siteinstall.InstallPic':
+              case 'LedgerParam.Siteinstall.InstallDrawing':
+              case 'LedgerParam.PhotoDoc.Nameplate':
+              case 'LedgerParam.PhotoDoc.Drawing':
+                  this.myDialog.uploadImgs = true;
+                  break;
+              //设备照片
+              case 'LedgerParam.PhotoDoc.Pic':
+                  this.myDialog.pic = true;
+                  break;
+
+          }
+      },
     //获取到了正确的信息
     getInfors(infos, row, el) {
-      let val = this.hot.colToProp(row.col);
+        let val = this.hot.colToProp(row.col);
       let inputMode = this.inputMap[val];
       this.row = row.row;
       this.messKey = val;
@@ -695,6 +745,7 @@ export default {
         //品牌型号弹窗
         case 'DPManufacturerID':
           if (!this.onlyRead) {
+              this.dataFirmType = 'row'
             this.myDialog.firm = true;
           }
           return false
@@ -831,6 +882,10 @@ export default {
     },
     //如果选择供应商之后
     supplierChange(data) {
+        let firm = {...data, num: 8}
+        this.firmName = firm
+        console.log(data, '供应商')
+        debugger
       tools.setDataForKey(this.tableData[this.row], "DPSupplierID", data.venderId)
       tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.Supplier", data.name)
       this.handleUpdataTable(
@@ -846,7 +901,7 @@ export default {
     supplyChange(data) {
       tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.SupplierContractID", { id: data })
     },
-    //保险单号-保险文件 
+      //保险单号-保险文件
     guaranteeChange(data) {
       for (let key in data) {
         this.utilToKey(key, "insuranceNo", data, "InsuranceNum")
@@ -859,7 +914,10 @@ export default {
       }
     },
     //选择型号修改
-    firmChange(data) {
+    firmChange(data,type) {
+        let firm = {...data, num: 2, name: `${data.brand}/${data.name}`}
+        console.log(firm, '型号')
+        this.firmName = firm
       tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)
       tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Brand", data.brand)
       tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Specification", data.name)
@@ -876,6 +934,8 @@ export default {
     },
     //保险商变更
     changeInsurer(data) {
+        let firm = {...data, num: 42}
+        this.firmName = firm
       tools.setDataForKey(this.tableData[this.row], "DPInsurerID", data.venderId)
       tools.setDataForKey(this.tableData[this.row], "LedgerParam.InsuranceDoc.Insurer", data.name)
       this.handleUpdataTable(
@@ -889,6 +949,9 @@ export default {
     },
     //维修商变更
     changeMaintainer(data) {
+        let firm = {...data, num: 35}
+        this.firmName = firm
+        console.log(data)
       tools.setDataForKey(this.tableData[this.row], "DPMaintainerID", data.venderId)
       tools.setDataForKey(this.tableData[this.row], "LedgerParam.OperationMainte.Maintainer", data.name)
       this.handleUpdataTable(
@@ -907,7 +970,9 @@ export default {
     },
     //上传文件弹窗触发事件
     fileChange(keys) {
-      this.setDataToMain(keys, this.messKey, this.row);
+        console.log(keys, '===key====', keys.length, this.messKey)
+        this.setDataToMain(keys, this.messKey, this.row);
+
     },
     //上传图片弹窗触发事件
     imgChange(keys) {
@@ -940,6 +1005,10 @@ export default {
         tools.setDataForKey(this.tableData[row], key, "");
       }
     },
+      //    批量信息维护
+      Batch() {
+          this.$refs.batchDialogs.batchDialog = true
+      }
   },
   watch: {
     projectId() {

+ 125 - 111
src/components/relation/overview/CardList.vue

@@ -1,130 +1,137 @@
 <template>
     <div>
         <div
-            v-for="(item,index) in content"
             :key="index"
+            v-for="(item,index) in content"
         >
             <p class="slave-relation-title">{{item.GraphTypeName}}</p>
             <section
+                :key="child.GraphTypeId"
                 class="container"
                 v-for="(child,childIndex) in item.ChildGraphicTypeList"
-                :key="child.GraphTypeId"
             >
-            <p class="relation-text">
-                {{child.GraphTypeName}}
-                <span class="pic-code">图编码{{child.GraphTypeCode}}</span>
-                <el-tooltip
-                    :content="child.Note"
-                    placement="top">
-                    <i
-                        class="icon-shuoming iconfont"
-                        @click="explain"
-                    />
-                </el-tooltip>
-            </p>
+                <p class="relation-text">
+                    {{child.GraphTypeName}}
+                    <span class="pic-code">图编码{{child.GraphTypeCode}}</span>
+                    <el-tooltip
+                        :content="child.Note"
+                        placement="top">
+                        <i
+                            @click="explain"
+                            class="icon-shuoming iconfont"
+                        />
+                    </el-tooltip>
+                </p>
 
                 <el-row :gutter="24">
                     <el-col
+                        :key="relation.Id"
                         :span="8"
                         v-for="(relation,relIndex) in child.RelationTypeProjectList"
-                        :key="relation.Id"
                     >
                         <el-card
+                            class="card"
                             shadow="hover"
                             style="position: relative;"
-                            class="card"
                         >
                             <!-- border:none-->
                             <!--<div class="mask"></div>-->
-                        <p class="relation-title">
-                            {{relation.RelationTypeName}}
-                            <span class="asc">{{relation.RelationTypeCode}}</span>
-                            <el-tooltip
-                                :content="relation.Note"
-                                placement="top"
-                                style="z-index: 3;position:relative;"
-                            >
-                                <i class="iconfont icon-warn icon"/>
-                            </el-tooltip>
-                        </p>
-                        <article>
-                            <el-col
-                                :span="13"
-                                class="main-object "
-                            >
-                                <p class="object">主要连接对象</p>
-                                <p class="group">{{relation.ConneObject}}</p>
-                            </el-col>
-                            <el-col
-                                :span="1"
-                                class="main-object ">&nbsp;
-                            </el-col>
-                            <el-col
-                                :span="10"
-                                class="main-object"
-                            >
-                                <p class="line-number">连接数量</p>
-                                <p class="line-number">0</p>
-                            </el-col>
-                        </article>
+                            <p class="relation-title">
+                                {{relation.RelationTypeName}}
+                                <span class="asc">{{relation.RelationTypeCode}}</span>
+                                <el-tooltip
+                                    :content="relation.Note"
+                                    placement="top"
+                                    style="z-index: 3;position:relative;"
+                                >
+                                    <i class="iconfont icon-warn icon"/>
+                                </el-tooltip>
+                            </p>
+                            <article>
+                                <el-col
+                                    :span="13"
+                                    class="main-object "
+                                >
+                                    <p class="object">主要连接对象</p>
+                                    <p class="group">{{relation.ConneObject}}</p>
+                                </el-col>
+                                <el-col
+                                    :span="1"
+                                    class="main-object ">&nbsp;
+                                </el-col>
+                                <el-col
+                                    :span="10"
+                                    class="main-object"
+                                >
+                                    <p class="line-number">连接数量</p>
+                                    <p class="line-number">{{relation.count}}</p>
+                                </el-col>
+                            </article>
                             <p class="last-computed">
                                 <span v-show="relation.ComputingTime">最后一次计算时间 {{relation.ComputingTime}}</span>
-                            <el-tooltip
-                                content="启动计算"
-                                placement="top"
-                            >
-                                <el-badge
-                                    is-dot
-                                    class="item float-right"
+                                <el-tooltip
+                                    content="启动计算"
+                                    placement="top"
+                                >
+                                    <el-badge
+                                        class="item float-right"
+                                        is-dot
+                                    >
+                                        <el-button
+                                            @click="computed"
+                                            circle
+                                            type="primary"
+                                            plain
+                                            icon="iconfont icon-changyongtubiao-mianxing-"
+
+                                        >
+                                            <!--style="background: #000;color: #fff"-->
+                                        </el-button>
+                                    </el-badge>
+                                </el-tooltip>
+                                <el-tooltip
+                                    content="手动编辑"
+                                    placement="top"
                                 >
                                     <el-button
+                                        :disabled="relation.Manual === 1"
+                                        :style="{'border':(relation.Manual=== 1? '1px solid #DCDFE6' :'')}"
+                                        @click="manual(relation)"
                                         circle
-                                        icon="iconfont icon-changyongtubiao-mianxing-"
-                                        @click="computed"
-
+                                        class="float-right"
+                                        type="primary"
+                                        plain
+                                        icon="iconfont icon-bianji"
                                     >
-                                        <!--style="background: #000;color: #fff"-->
                                     </el-button>
-                                </el-badge>
-                            </el-tooltip>
-                            <el-tooltip
-                                content="手动编辑"
-                                placement="top"
-                            >
-                                <el-button
-                                    circle
-                                    class="float-right"
-                                    icon="iconfont icon-bianji"
-                                    @click="manual(relation.Manual,relation.Prompting,relation.RelationTypeName,relation.ComputingTime)"
-                                    :disabled="relation.Manual === 1"
-                                    :style="{'border':(relation.Manual===1? '1px solid #DCDFE6' :'')}"
-                                >
-                                </el-button>
 
-                            </el-tooltip>
-                            <el-tooltip
-                                content="设定设备对象源/末端"
-                                placement="top"
-                                v-if="relation.IsSource"
-                            >
-                                <el-button
-                                    circle
-                                    class="float-right"
-                                    icon="iconfont icon-23 "
-                                    style="transform: rotate(90deg);"
-                                    @click="equipment"
+                                </el-tooltip>
+                                <el-tooltip
+                                    content="设定设备对象源/末端"
+                                    placement="top"
+                                    v-if="relation.IsSource"
                                 >
-                                </el-button>
-                            </el-tooltip>
-                        </p>
-                    </el-card>
-                </el-col>
-            </el-row>
-        </section>
-    </div>
+                                    <el-button
+                                        @click="equipment"
+                                        type="primary"
+                                        plain
+                                        circle
+                                        class="float-right"
+                                        icon="iconfont icon-23 "
+                                        style="transform: rotate(90deg);"
+                                    >
+                                    </el-button>
+                                </el-tooltip>
+                            </p>
+                        </el-card>
+                    </el-col>
+                </el-row>
+            </section>
+        </div>
         <RelationMaintain
-            ref="maintain"
             :values="values"
+            ref="maintain"
+            @template="templateDown"
         />
     </div>
 
@@ -144,7 +151,7 @@
                     title: '关系维护',
                     cancel: '取消',
                     confirm: '确定',
-                    back:'返回',
+                    back: '返回',
                     promptly: '立即计算',
                     placeholder: '请选择',
                     download: '下载模板(含数据)',
@@ -182,18 +189,24 @@
             equipment() {
                 this.$refs.maintain.dialogEquipment = true
             },
-            manual(type, tips, typeName, lastTime) {
-                if (type === 2) {
-                    this.values.device = tips.split(',')
-                    this.values.tips = `请前往以下功能页面维护 <${typeName}>`
+            manual(relation) {
+                let {Manual, Prompting, RelationTypeName, ComputingTime} = relation;
+                let device = Prompting && Prompting.split(','),
+                    tips= `请前往以下功能页面维护 <${RelationTypeName}>`,
+                    optionTips= `请下载最新最新 <${RelationTypeName}> 数据进行手动维护`,
+                    lastTime=`最后更新时间为 ${ComputingTime ? ComputingTime : ''}`
+
+                if (Manual === 2) {
+                    this.values={...this.values,device,tips}
                     this.$refs.maintain.dialogManualTip = true
-                }
-                if (type === 3) {
-                    this.values.optionTips = `请下载最新最新 <${typeName}> 数据进行手动维护`
-                    this.values.lastTime = `最后更新时间为 ${lastTime}`
+                    }
+                if (Manual === 3) {
+                    this.values={...this.values,optionTips,lastTime}
                     this.$refs.maintain.dialogManualOption = true
-                }
-
+                    }
+            },
+            templateDown() { //下载模板
+                this.$emit('template')
             }
         },
         components: {RelationMaintain}
@@ -212,24 +225,25 @@
     .slave-relation-title {
         color: @font-code;
         font-weight: 600;
-        border-bottom: 2px dashed @font-code;
+        border-bottom: 1px dashed @font-code;
         padding-bottom: @5px;
     }
+
     .container {
         .el-card {
-            border: 1px solid #000;
+            /*border: 1px solid #000;*/
             margin: 10px 0;
         }
 
-        .el-button {
-            border: 1px solid #000;
-        }
+        /*.el-button {*/
+        /*    border: 1px solid #000;*/
+        /*}*/
 
         .relation-text {
             overflow: hidden;
             margin-top: 10px;
             color: @color-text;
-            border-left: 3px solid @color-text;
+            border-left: 8px solid @color-text;
             text-indent: 10px;
             font-weight: @font-big;
 

+ 16 - 6
src/components/relation/overview/Modal/RelationMaintain.vue

@@ -117,11 +117,14 @@
                         <i class="iconfont icon-doc-line"/>
                         {{values.currentNum}} 0
                     </p>
+                    <a href="/api/datacenter/graphic/template-downloads">
                     <el-button
                         type="primary"
                         class="mt-10"
-                    >{{values.download}}
+                    >
+                        {{values.download}}
                     </el-button>
+                    </a>
                 </el-col>
                 <el-col :span="10">
                     {{values.lastTime}}
@@ -130,8 +133,9 @@
             <el-upload
                 class="upload-demo"
                 drag
-                action="https://jsonplaceholder.typicode.com/posts/"
+                action="/api/datacenter/graphic/import"
                 multiple
+                name="fileName"
                 :on-progress="progress"
                 :on-success="success"
                 :on-error="error"
@@ -163,7 +167,10 @@
                     </el-timeline-item>
                 </el-timeline>
             </div>
-            <el-button>{{values.downloadFile}}</el-button>
+<!--            下载报告-->
+            <a href="/api/datacenter//graphic/report-downloads">
+                <el-button>{{values.downloadFile}}</el-button>
+            </a>
             <footer
                 slot="footer"
                 class="dialog-footer "
@@ -208,13 +215,13 @@
                     label: '北京烤鸭'
                 }],
                 activities: [{
-                    content: '支持使用图标',
+                    content: '数据文件处理中..',
                     size: 'large',
                     type: 'primary',
                     icon: 'el-icon-check',
                     color: '#0bbd87'
                 }, {
-                    content: '支持自定义颜色',
+                    content: '数据处理失败',
                     color: '#0bbd87',
                     icon: 'el-icon-check',
                     size: 'large',
@@ -229,7 +236,7 @@
             success(event, file, fileList) {
                 this.dialogManualOption = true
                 this.dialogProcess = true
-                console.log(event.file, fileList)
+                console.log(event.file, fileList,' file success')
 
             },
             error(event, file, fileList) {
@@ -244,6 +251,9 @@
             finish() {
                 this.dialogProcess = false
                 this.dialogManualOption = false
+            },
+            templateDownload() {
+                this.$emit('template')
             }
         }
     }

+ 98 - 1
src/views/relation/overview/index.vue

@@ -2,6 +2,7 @@
     <div>
         <cardList
             :content="content"
+            @template="templateDown"
         />
     </div>
 </template>
@@ -48,6 +49,47 @@
                 //         },
                 //     ]
                 // },
+            ],
+            countNumber: [
+                //     {
+                //     "GraphTypeId": "3243215",
+                //     "GraphTypeName": "从属关系",
+                //     "GraphTypeCode": "ksaajdk",
+                //     "RelationTypeProjectList": [
+                //         {
+                //             "Id": "f3bed766a5ba45868d3a744fb8aaa0c8",
+                //             "RelationTypeName": "项目下的建筑体",
+                //             "RelationTypeCode": "关系类型编码",
+                //             "GraphicCode": "图类型code",
+                //             "ProjectId": "Pj5432532",
+                //             "count": "123"
+                //         },
+                //         {
+                //             "Id": "6b4c9f042d344eb99dd64e8e444ad2b0",
+                //             "RelationTypeName": "项目下的建筑体",
+                //             "RelationTypeCode": "关系类型编码",
+                //             "GraphicCode": "图类型code",
+                //             "ProjectId": "Pj5432532",
+                //             "count": "456"
+                //         },
+                //         {
+                //             "Id": "305170f91eae4bf991be9284e80a9cf4",
+                //             "RelationTypeName": "项目下的建筑体",
+                //             "RelationTypeCode": "关系类型编码",
+                //             "GraphicCode": "图类型code",
+                //             "ProjectId": "Pj5432532",
+                //             "count": "789"
+                //         },
+                //         {
+                //             "Id": "cd7a30cf0f2548a99d4dc99a7948c0db",
+                //             "RelationTypeName": "项目下的建筑体",
+                //             "RelationTypeCode": "关系类型编码",
+                //             "GraphicCode": "图类型code",
+                //             "ProjectId": "Pj5432532",
+                //             "count": "321"
+                //         }
+                //     ]
+                // }
             ]
         }
     },
@@ -65,16 +107,71 @@
                 "PageNumber": 1,
                 "PageSize": 1000
             }
+            let dataNumber = {
+                projectId: this.projectId
+            }
+            api.graphicNumber(dataNumber, resCount => {
+                this.countNumber = resCount.Content
+            })
             api.graphic(data, res => {
+                res.Content.forEach(item => {
+                    // 二级从属关系
+                    item.ChildGraphicTypeList.forEach(child => {
+                        this.countNumber.forEach(number => {
+                            if (number.GraphTypeName === child.GraphTypeName) { //二级名字
+                                number.RelationTypeProjectList.forEach(counts => {
+                                    //对应子集
+                                    child.RelationTypeProjectList.forEach(relation => {
+                                        if (relation.Id === counts.Id) {
+                                            relation.count = counts.Count
+                                        }
+                                    })
+                                })
+                            }
+                        })
+                    })
+                })
+                this.$forceUpdate()
+                console.log(this.content,'res')
                 this.content = res.Content
+                // this.transform(this.content, this.num)
+
             })
+
         },
         computed: {
             ...mapGetters('layout', ['projectId'])
         },
         mounted() {
         },
-        components: {CardList}
+        components: {CardList},
+        methods: {
+            transform(list1, list2) {
+                let countInfo = {} // { GraphTypeName: { Id: count } }
+                list2.forEach(item => {
+                    countInfo[item.GraphTypeName] = countInfo[item.GraphTypeName] || {}
+                    let rList = item.RelationTypeProjectList
+                    rList.forEach(r => {
+                        countInfo[item.GraphTypeName][r.Id] = r.Count
+                    })
+                })
+
+                let changeList = []
+                list1.forEach(item => {
+                    // 这里保存的是引用
+                    changeList.push(...item.ChildGraphicTypeList)
+                })
+                changeList.forEach(item => {
+                    let name = item.GraphTypeName
+                    let rList = item.RelationTypeProjectList
+                    rList.forEach(r => {
+                        r.count = countInfo[name][r.Id]
+                    })
+                })
+            },
+            templateDown() { //下载模板
+            }
+        }
 }
 </script>
 <style lang="less" scoped>