瀏覽代碼

'暂存--'

shaun-sheep 5 年之前
父節點
當前提交
b12cfbb39d
共有 2 個文件被更改,包括 1244 次插入831 次删除
  1. 345 0
      src/components/dialogs/list/batchDialog.vue
  2. 899 831
      src/components/ledger/handsontables/device.vue

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

@@ -0,0 +1,345 @@
+<template>
+    <el-dialog
+        title="批量维护信息点"
+        :visible.sync="batchDialog"
+        class="batchContainer"
+    >
+        <el-steps
+            :active="active"
+            align-center
+        >
+            <el-step
+                @click.native="active = 0"
+                description="填写需维护的信息点"
+            />
+            <el-step
+                @click.native="active = 1"
+                description="选择批量维护的对象实例"
+            />
+        </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-step__description {
+            margin-top: 2%;
+        }
+
+        .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;
+            }
+        }
+
+    }
+</style>

文件差異過大導致無法顯示
+ 899 - 831
src/components/ledger/handsontables/device.vue