shaun-sheep 5 years ago
parent
commit
7cd6a1684a

+ 37 - 8
src/components/dialogs/list/batchDialog.vue

@@ -232,6 +232,8 @@
                 this.firm.map((item, index) => {
                     if (item.num === this.firmName.num) {
                         item.rname = this.firmName.name
+                        item = {...item, info: this.firmName}
+                        debugger
                     }
                     return item
                 })
@@ -239,27 +241,54 @@
             }
         },
         methods: {
-            next() {
-                if (this.active++ > 1) this.active = 0
+            next() { //下一步
+                // if (this.active++ > 1) this.active = 0
+                // 如果单项全选
+                if (this.checkAll) {
+                    let arr = this.firm.filter(item => item.info)
+                    console.log(arr, 'arr')
+                }
+                // if (this.checkAll) {
+                //     console.log(this.maintenanceList, 'maintenanceList')
+                //     let all = ['supplier', 'firm', 'insurer', 'maintainer']
+                //     let sw = false
+                //     for (let i = 0; i < all.length; i++) {
+                //         let element = all[i]
+                //         if (!JSON.stringify(this.maintenanceList) || !this.maintenanceList.hasOwnProperty(element)) {
+                //             this.$message({
+                //                 message: '存在着未填写项',
+                //                 type: 'warning'
+                //             });
+                //             sw = false
+                //             break;
+                //         } else {
+                //             sw = true
+                //         }
+                //     }
+                //     if (sw) {
+                //         // 把参数传给父组件
+                //         this.$emit('deviceList', this.maintenanceList)
+                //     }
+                //
+                // } else { //单项部分选择
+                //     console.log(this.checkedCities)
+                //     // this.$emit('deviceList', this.maintenanceList)
+                // }
             },
             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)
-                })
+                console.log(value, '选择的项')
                 let checkCount = value.length
                 this.checkAll = checkCount === this.firm.length
                 this.isIndeterminate = checkCount > 0 && checkCount < this.firm.length
             },
             handleCheckedFileChange(value,) { //维护多项触发
+                console.log(this.checkAll, 'checkAll')
                 console.log(value, '----')
             },
             fourVendors(code) {

+ 89 - 85
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">
@@ -51,94 +51,98 @@
   </el-dialog>
 </template>
 <script>
-import myPagination from "@/components/ledger/lib/myPagination";
-import paramDetails from "@/components/dialogs/list/paramDetails"
-import { getSpecList } from "@/api/scan/request"
+    import myPagination from "@/components/ledger/lib/myPagination";
+    import paramDetails from "@/components/dialogs/list/paramDetails"
+    import {getSpecList} from "@/api/scan/request"
 
-export default {
-  components: {
+    export default {
+        components: {
     myPagination,
     paramDetails
   },
-  props: {
-    dialog: {
-      type: Object,
-      default: function () {
-        return {
-          firm: false
-        };
-      }
-    },
-    mess: {
-      type: [Object, String]
-    }
-  },
-  data() {
-    return {
-      search: "", //搜索文案
-      radio: "",
-      tableData: [
-      ],
-      data: {},
-      isLoad: {
-        paramShow: false
-      },
-      page: {
-        size: 50,
-        sizes: [10, 30, 50, 100, 150, 200],
-        total: 0,
-        currentPage: 1
-      },
-    };
-  },
-  created() { },
-  mounted() { },
-  methods: {
-    changed() {
-      this.getData()
-    },
-    //查询技术参数
-    lookParam(data) {
-      this.data = data
-      this.isLoad.paramShow = true
-    },
-    getChange() {
-      if (!!this.radio) {
-        this.$emit("changeFirm", this.radio)
-        this.dialog.firm = false
-        this.radio = ''
-      } else {
-        this.$message("请选择型号")
-      }
-    },
-    searchKey() {
-      this.changePage()
-    },
-    changePage() {
-      this.page = {
-        size: 50,
-        sizes: [10, 30, 50, 100, 150, 200],
-        total: 0,
-        currentPage: 1
-      }
-      this.getData()
-    },
-    getData() {
-      getSpecList({
-        limit: {
-          skip: this.page.size * (this.page.currentPage - 1),
-          count: this.page.size
+        props: {
+            dialog: {
+                type: Object,
+                default: function () {
+                    return {
+                        firm: false
+                    };
+                }
+            },
+            mess: {
+                type: [Object, String]
+            },
+            firmDataType: {
+                type: String
+            }
         },
-        eqFamily: this.mess.deviceId,
-        name: this.search
-      }, res => {
-        this.page.total = res.totalCount
-        this.tableData = res.content
-        console.log(this.tableData)
-      })
-    }
-  },
-  watch: {
+        data() {
+            return {
+                search: "", //搜索文案
+                radio: "",
+                tableData: [],
+                data: {},
+                isLoad: {
+                    paramShow: false
+                },
+                page: {
+                    size: 50,
+                    sizes: [10, 30, 50, 100, 150, 200],
+                    total: 0,
+                    currentPage: 1
+                },
+            };
+        },
+        created() {
+        },
+        mounted() {
+        },
+        methods: {
+            changed() {
+                this.getData()
+            },
+            //查询技术参数
+            lookParam(data) {
+                this.data = data
+                this.isLoad.paramShow = true
+            },
+            getChange() {
+                if (!!this.radio) {
+                    this.$emit("changeFirm", this.radio,this.firmDataType)
+                    this.dialog.firm = false
+                    this.radio = ''
+                } else {
+                    this.$message("请选择型号")
+                }
+            },
+            searchKey() {
+                this.changePage()
+            },
+            changePage() {
+                this.page = {
+                    size: 50,
+                    sizes: [10, 30, 50, 100, 150, 200],
+                    total: 0,
+                    currentPage: 1
+                }
+                this.getData()
+            },
+            getData() {
+                getSpecList({
+                    limit: {
+                        skip: this.page.size * (this.page.currentPage - 1),
+                        count: this.page.size
+                    },
+                    eqFamily: this.mess.deviceId,
+                    name: this.search
+                }, res => {
+                    this.page.total = res.totalCount
+                    this.tableData = res.content
+                    console.log(this.tableData)
+                })
+            }
+        },
+        watch: {
     dialog: {
       deep: true,
       handler: function () {

+ 111 - 107
src/components/dialogs/list/insurerDialog.vue

@@ -38,7 +38,7 @@
                 <i style="color:#46B0FF;cursor: pointer;">厂家库</i>维护吧
             </p>
             <my-pagination :page="page" @change="changePage" style="margin-top:10px;"></my-pagination>
-        </div>         
+        </div>
       </div>
     </div>
     <div slot="footer">
@@ -50,120 +50,124 @@
   </el-dialog>
 </template>
 <script>
-import myPagination from "@/components/ledger/lib/myPagination";
-import { getLib } from "@/api/scan/request"
-import { mapGetters, mapActions } from "vuex";
-import tools from "@/utils/scan/tools"
+    import myPagination from "@/components/ledger/lib/myPagination";
+    import {getLib} from "@/api/scan/request"
+    import {mapGetters} from "vuex";
+    import tools from "@/utils/scan/tools"
 
-export default {
-  components: {
+    export default {
+        components: {
     myPagination
   },
-  props: {
-    dialog: {
-      type: Object,
-      default: function () {
-        return {
-          insurer: true
-        };
-      }
-    }
-  },
-  computed: {
-    ...mapGetters("layout", ["projectId", "secret", "userId"]),
-  },
-  data() {
-    return {
-      search: "", //搜索文案
-      radio: "",
-      tableData: [],
-      page: {
-        size: 50,
-        sizes: [10, 30, 50, 100, 150, 200],
-        total: 0,
-        currentPage: 1
-      }
-    };
-  },
-  created() {
-    // this.getData()
-  },
-  mounted() { },
-  methods: {
-    //过滤
-    filterSearch() {
-      this.tableData = this.allData.map(item => {
-        if (item.name.indexOf(this.search) != -1) {
-          return item
-        } else {
-          return undefined
-        }
-      }).filter(cb => cb)
-    },
-    getData() {
-      console.log("insurer")
-      this.page = {
-        size: 50,
-        sizes: [10, 30, 50, 100, 150, 200],
-        total: 0,
-        currentPage: 1
-      }
-      getLib({ "type": ["insurance"] }).then(res => {
-        if (res.data.result == "success") {
-          let data = res.data.content.insurance.map(item => {
-            if (item.contacts && item.contacts.length) {
-              item.contacts.map(child => {
-                if (child.projectId == this.projectId) {
-                  item.phone = child.phone
-                  item.man = child.name
-                  item.fox = child.fox
-                  item.email = child.email
+        props: {
+            dialog: {
+                type: Object,
+                default: function () {
+                    return {
+                        insurer: true
+                    };
                 }
-                return child
-              })
-            }
-            if (!item.man) {
-              item.man = "--"
-              item.phone = "--"
-              item.fox = "--"
-              item.email = "--"
+            },
+            firmDataType: {
+                type: String
             }
-            return item
-          })
-          this.allData = tools.deepCopy(data)
-          this.tableData = this.pagination(this.page.currentPage, this.page.size, this.allData)
-          this.page.total = data.length
-        } else {
-          this.$message.error("请求失败:" + res.data.resultMsg)
-        }
-      })
-    },
+        },
+        computed: {
+            ...mapGetters("layout", ["projectId", "secret", "userId"]),
+        },
+        data() {
+            return {
+                search: "", //搜索文案
+                radio: "",
+                tableData: [],
+                page: {
+                    size: 50,
+                    sizes: [10, 30, 50, 100, 150, 200],
+                    total: 0,
+                    currentPage: 1
+                }
+            };
+        },
+        created() {
+            // this.getData()
+        },
+        mounted() {
+        },
+        methods: {
+            //过滤
+            filterSearch() {
+                this.tableData = this.allData.map(item => {
+                    if (item.name.indexOf(this.search) != -1) {
+                        return item
+                    } else {
+                        return undefined
+                    }
+                }).filter(cb => cb)
+            },
+            getData() {
+                console.log("insurer")
+                this.page = {
+                    size: 50,
+                    sizes: [10, 30, 50, 100, 150, 200],
+                    total: 0,
+                    currentPage: 1
+                }
+                getLib({"type": ["insurance"]}).then(res => {
+                    if (res.data.result == "success") {
+                        let data = res.data.content.insurance.map(item => {
+                            if (item.contacts && item.contacts.length) {
+                                item.contacts.map(child => {
+                                    if (child.projectId == this.projectId) {
+                                        item.phone = child.phone
+                                        item.man = child.name
+                                        item.fox = child.fox
+                                        item.email = child.email
+                                    }
+                                    return child
+                                })
+                            }
+                            if (!item.man) {
+                                item.man = "--"
+                                item.phone = "--"
+                                item.fox = "--"
+                                item.email = "--"
+                            }
+                            return item
+                        })
+                        this.allData = tools.deepCopy(data)
+                        this.tableData = this.pagination(this.page.currentPage, this.page.size, this.allData)
+                        this.page.total = data.length
+                    } else {
+                        this.$message.error("请求失败:" + res.data.resultMsg)
+                    }
+                })
+            },
 
-    //分页改变
-    changePage() {
-      this.pagination(this.page.currentPage, this.page.size, this.allData)
-    },
+            //分页改变
+            changePage() {
+                this.pagination(this.page.currentPage, this.page.size, this.allData)
+            },
 
-    //发生修改
-    getChange() {
-      if (!!this.radio) {
-        this.$emit("changeInsurer", this.radio)
-        this.dialog.insurer = false
-        this.radio = ''
-      } else {
-        this.$message("请选择一个生产厂商")
-      }
-    },
+            //发生修改
+            getChange() {
+                if (!!this.radio) {
+                    this.$emit("changeInsurer", this.radio,this.firmDataType)
+                    this.dialog.insurer = false
+                    this.radio = ''
+                } else {
+                    this.$message("请选择一个生产厂商")
+                }
+            },
 
-    //分页事件
-    pagination(pageNo, pageSize, array) {
-      let offset = (pageNo - 1) * pageSize;
-      return offset + pageSize >= array.length
-        ? array.slice(offset, array.length)
-        : array.slice(offset, offset + pageSize);
-    }
-  },
-  watch: {
+            //分页事件
+            pagination(pageNo, pageSize, array) {
+                let offset = (pageNo - 1) * pageSize;
+                return offset + pageSize >= array.length
+                    ? array.slice(offset, array.length)
+                    : array.slice(offset, offset + pageSize);
+            }
+        },
+        watch: {
     dialog: {
       deep: true,
       handler: function () {

+ 111 - 107
src/components/dialogs/list/maintainerDialog.vue

@@ -1,5 +1,5 @@
 <!--
-    maintenance 选择供应
+    maintenance 选择维修
 
 -->
 <template>
@@ -38,7 +38,7 @@
                 <i style="color:#46B0FF;cursor: pointer;">厂家库</i>维护吧
             </p>
             <my-pagination :page="page" @change="changePage" style="margin-top:10px;"></my-pagination>
-        </div>         
+        </div>
       </div>
     </div>
     <div slot="footer">
@@ -50,119 +50,123 @@
   </el-dialog>
 </template>
 <script>
-import myPagination from "@/components/ledger/lib/myPagination";
-import { mapGetters, mapActions } from "vuex";
-import { getLib } from "@/api/scan/request"
-import tools from "@/utils/scan/tools"
+    import myPagination from "@/components/ledger/lib/myPagination";
+    import {mapGetters} from "vuex";
+    import {getLib} from "@/api/scan/request"
+    import tools from "@/utils/scan/tools"
 
-export default {
-  components: {
+    export default {
+        components: {
     myPagination
   },
-  props: {
-    dialog: {
-      type: Object,
-      default: function () {
-        return {
-          maintainer: true
-        };
-      }
-    }
-  },
-  computed: {
-    ...mapGetters("layout", ["projectId", "secret", "userId"]),
-  },
-  data() {
-    return {
-      search: "", //搜索文案
-      radio: "",
-      tableData: [],
-      page: {
-        size: 50,
-        sizes: [10, 30, 50, 100, 150, 200],
-        total: 0,
-        currentPage: 1
-      }
-    };
-  },
-  created() {
-    // this.getData()
-  },
-  mounted() { },
-  methods: {
-    //过滤
-    filterSearch() {
-      this.tableData = this.allData.map(item => {
-        if (item.name.indexOf(this.search) != -1) {
-          return item
-        } else {
-          return undefined
-        }
-      }).filter(cb => cb)
-    },
-    getData() {
-      this.page = {
-        size: 50,
-        sizes: [10, 30, 50, 100, 150, 200],
-        total: 0,
-        currentPage: 1
-      }
-      getLib({ "type": ["maintenance"] }).then(res => {
-        if (res.data.result == "success") {
-          let data = res.data.content.maintenance.map(item => {
-            if (item.contacts && item.contacts.length) {
-              item.contacts.map(child => {
-                if (child.projectId == this.projectId) {
-                  item.phone = child.phone
-                  item.man = child.name
-                  item.fox = child.fox
-                  item.email = child.email
+        props: {
+            dialog: {
+                type: Object,
+                default: function () {
+                    return {
+                        maintainer: true
+                    };
                 }
-                return child
-              })
-            }
-            if (!item.man) {
-              item.man = "--"
-              item.phone = "--"
-              item.fox = "--"
-              item.email = "--"
+            },
+            firmDataType: {
+                type: String
             }
-            return item
-          })
-          this.allData = tools.deepCopy(data)
-          this.tableData = this.pagination(this.page.currentPage, this.page.size, this.allData)
-          this.page.total = data.length
-        } else {
-          this.$message.error("请求失败:" + res.data.resultMsg)
-        }
-      })
-    },
+        },
+        computed: {
+            ...mapGetters("layout", ["projectId", "secret", "userId"]),
+        },
+        data() {
+            return {
+                search: "", //搜索文案
+                radio: "",
+                tableData: [],
+                page: {
+                    size: 50,
+                    sizes: [10, 30, 50, 100, 150, 200],
+                    total: 0,
+                    currentPage: 1
+                }
+            };
+        },
+        created() {
+            // this.getData()
+        },
+        mounted() {
+        },
+        methods: {
+            //过滤
+            filterSearch() {
+                this.tableData = this.allData.map(item => {
+                    if (item.name.indexOf(this.search) != -1) {
+                        return item
+                    } else {
+                        return undefined
+                    }
+                }).filter(cb => cb)
+            },
+            getData() {
+                this.page = {
+                    size: 50,
+                    sizes: [10, 30, 50, 100, 150, 200],
+                    total: 0,
+                    currentPage: 1
+                }
+                getLib({"type": ["maintenance"]}).then(res => {
+                    if (res.data.result == "success") {
+                        let data = res.data.content.maintenance.map(item => {
+                            if (item.contacts && item.contacts.length) {
+                                item.contacts.map(child => {
+                                    if (child.projectId == this.projectId) {
+                                        item.phone = child.phone
+                                        item.man = child.name
+                                        item.fox = child.fox
+                                        item.email = child.email
+                                    }
+                                    return child
+                                })
+                            }
+                            if (!item.man) {
+                                item.man = "--"
+                                item.phone = "--"
+                                item.fox = "--"
+                                item.email = "--"
+                            }
+                            return item
+                        })
+                        this.allData = tools.deepCopy(data)
+                        this.tableData = this.pagination(this.page.currentPage, this.page.size, this.allData)
+                        this.page.total = data.length
+                    } else {
+                        this.$message.error("请求失败:" + res.data.resultMsg)
+                    }
+                })
+            },
 
-    //分页改变
-    changePage() {
-      this.pagination(this.page.currentPage, this.page.size, this.allData)
-    },
+            //分页改变
+            changePage() {
+                this.pagination(this.page.currentPage, this.page.size, this.allData)
+            },
 
-    //发生修改
-    getChange() {
-      if (!!this.radio) {
-        this.$emit("changeMaintainer", this.radio)
-        this.dialog.maintainer = false
-        this.radio = ''
-      } else {
-        this.$message("请选择一个生产厂商")
-      }
-    },
+            //发生修改
+            getChange() {
+                if (!!this.radio) {
+                    this.$emit("changeMaintainer", this.radio,this.firmDataType)
+                    this.dialog.maintainer = false
+                    this.radio = ''
+                } else {
+                    this.$message("请选择一个生产厂商")
+                }
+            },
 
-    //分页事件
-    pagination(pageNo, pageSize, array) {
-      let offset = (pageNo - 1) * pageSize;
-      return offset + pageSize >= array.length
-        ? array.slice(offset, array.length)
-        : array.slice(offset, offset + pageSize);
-    }
-  },
-  watch: {
+            //分页事件
+            pagination(pageNo, pageSize, array) {
+                let offset = (pageNo - 1) * pageSize;
+                return offset + pageSize >= array.length
+                    ? array.slice(offset, array.length)
+                    : array.slice(offset, offset + pageSize);
+            }
+        },
+        watch: {
     dialog: {
       deep: true,
       handler: function () {

+ 110 - 106
src/components/dialogs/list/supplierDialog.vue

@@ -38,7 +38,7 @@
                 <i style="color:#46B0FF;cursor: pointer;">厂家库</i>维护吧
             </p>
             <my-pagination :page="page" @change="changePage" style="margin-top:10px;"></my-pagination>
-        </div>        
+        </div>
       </div>
     </div>
     <div slot="footer" class="footer">
@@ -50,119 +50,123 @@
   </el-dialog>
 </template>
 <script>
-import myPagination from "@/components/ledger/lib/myPagination";
-import { mapGetters } from "vuex";
-import { getLib } from "@/api/scan/request"
-import tools from "@/utils/scan/tools"
+    import myPagination from "@/components/ledger/lib/myPagination";
+    import {mapGetters} from "vuex";
+    import {getLib} from "@/api/scan/request"
+    import tools from "@/utils/scan/tools"
 
-export default {
-  components: {
+    export default {
+        components: {
     myPagination
   },
-  props: {
-    dialog: {
-      type: Object,
-      default: function () {
-        return {
-          supplier: true
-        };
-      }
-    }
-  },
-  data() {
-    return {
-      search: "", //搜索文案
-      radio: "",
-      tableData: [],
-      page: {
-        size: 50,
-        sizes: [10, 30, 50, 100, 150, 200],
-        total: 0,
-        currentPage: 1
-      }
-    };
-  },
-  computed: {
-    ...mapGetters("layout", ["projectId", "secret", "userId"]),
-  },
-  created() {
-    // this.getData()
-  },
-  mounted() { },
-  methods: {
-    //过滤
-    filterSearch() {
-      this.tableData = this.allData.map(item => {
-        if (item.name.indexOf(this.search) != -1) {
-          return item
-        } else {
-          return undefined
-        }
-      }).filter(cb => cb)
-    },
-    getData() {
-      this.page = {
-        size: 50,
-        sizes: [10, 30, 50, 100, 150, 200],
-        total: 0,
-        currentPage: 1
-      }
-      getLib({ "type": ["supplier"] }).then(res => {
-        if (res.data.result == "success") {
-          let data = res.data.content.supplier.map(item => {
-            if (item.contacts && item.contacts.length) {
-              item.contacts.map(child => {
-                if (child.projectId == this.projectId) {
-                  item.phone = child.phone
-                  item.man = child.name
-                  item.fox = child.fox
-                  item.email = child.email
+        props: {
+            dialog: {
+                type: Object,
+                default: function () {
+                    return {
+                        supplier: true
+                    };
                 }
-                return child
-              })
-            }
-            if (!item.man) {
-              item.man = "--"
-              item.phone = "--"
-              item.fox = "--"
-              item.email = "--"
+            },
+            firmDataType: {
+                type: String
             }
-            return item
-          })
-          this.allData = tools.deepCopy(data)
-          this.tableData = this.pagination(this.page.currentPage, this.page.size, this.allData)
-          this.page.total = data.length
-        } else {
-          this.$message.error("请求失败:" + res.data.resultMsg)
-        }
-      })
-    },
+        },
+        data() {
+            return {
+                search: "", //搜索文案
+                radio: "",
+                tableData: [],
+                page: {
+                    size: 50,
+                    sizes: [10, 30, 50, 100, 150, 200],
+                    total: 0,
+                    currentPage: 1
+                }
+            };
+        },
+        computed: {
+            ...mapGetters("layout", ["projectId", "secret", "userId"]),
+        },
+        created() {
+            // this.getData()
+        },
+        mounted() {
+        },
+        methods: {
+            //过滤
+            filterSearch() {
+                this.tableData = this.allData.map(item => {
+                    if (item.name.indexOf(this.search) != -1) {
+                        return item
+                    } else {
+                        return undefined
+                    }
+                }).filter(cb => cb)
+            },
+            getData() {
+                this.page = {
+                    size: 50,
+                    sizes: [10, 30, 50, 100, 150, 200],
+                    total: 0,
+                    currentPage: 1
+                }
+                getLib({"type": ["supplier"]}).then(res => {
+                    if (res.data.result == "success") {
+                        let data = res.data.content.supplier.map(item => {
+                            if (item.contacts && item.contacts.length) {
+                                item.contacts.map(child => {
+                                    if (child.projectId == this.projectId) {
+                                        item.phone = child.phone
+                                        item.man = child.name
+                                        item.fox = child.fox
+                                        item.email = child.email
+                                    }
+                                    return child
+                                })
+                            }
+                            if (!item.man) {
+                                item.man = "--"
+                                item.phone = "--"
+                                item.fox = "--"
+                                item.email = "--"
+                            }
+                            return item
+                        })
+                        this.allData = tools.deepCopy(data)
+                        this.tableData = this.pagination(this.page.currentPage, this.page.size, this.allData)
+                        this.page.total = data.length
+                    } else {
+                        this.$message.error("请求失败:" + res.data.resultMsg)
+                    }
+                })
+            },
 
-    //分页改变
-    changePage() {
-      this.pagination(this.page.currentPage, this.page.size, this.allData)
-    },
+            //分页改变
+            changePage() {
+                this.pagination(this.page.currentPage, this.page.size, this.allData)
+            },
 
-    //发生修改
-    getChange() {
-      if (!!this.radio) {
-        this.$emit("changeSupplier", this.radio)
-        this.dialog.supplier = false
-        this.radio = ''
-      } else {
-        this.$message("请选择一个生产厂商")
-      }
-    },
+            //发生修改
+            getChange() {
+                if (!!this.radio) {
+                    this.$emit("changeSupplier", this.radio, this.firmDataType)
+                    this.dialog.supplier = false
+                    this.radio = ''
+                } else {
+                    this.$message("请选择一个生产厂商")
+                }
+            },
 
-    //分页事件
-    pagination(pageNo, pageSize, array) {
-      let offset = (pageNo - 1) * pageSize;
-      return offset + pageSize >= array.length
-        ? array.slice(offset, array.length)
-        : array.slice(offset, offset + pageSize);
-    }
-  },
-  watch: {
+            //分页事件
+            pagination(pageNo, pageSize, array) {
+                let offset = (pageNo - 1) * pageSize;
+                return offset + pageSize >= array.length
+                    ? array.slice(offset, array.length)
+                    : array.slice(offset, offset + pageSize);
+            }
+        },
+        watch: {
     dialog: {
       deep: true,
       handler: function () {

+ 93 - 63
src/components/ledger/handsontables/device.vue

@@ -22,18 +22,22 @@
     <!-- 二维码弹窗 -->
     <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}" :firmDataType="firmDataType" 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>
+      <supplier-dialog ref="supplier" :firmDataType="firmDataType" @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>
-    <maintainer-dialog @changeMaintainer="changeMaintainer" ref="maintainer" :dialog="myDialog"></maintainer-dialog>
-    <insurer-dialog @changeInsurer="changeInsurer" ref="insurer" :dialog="myDialog"></insurer-dialog>
+      <!--      维修商信息-->
+      <maintainer-dialog @changeMaintainer="changeMaintainer" :firmDataType="firmDataType" ref="maintainer"
+                         :dialog="myDialog"></maintainer-dialog>
+    <insurer-dialog @changeInsurer="changeInsurer" :firmDataType="firmDataType" 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>
@@ -83,7 +87,7 @@
       </span>
     </el-dialog>
       <!--      维护信息弹窗-->
-      <batchDialog ref="batchDialogs" @code="fourVendors" :firmName="firmName"/>
+      <batchDialog ref="batchDialogs"  @code="fourVendors" :firmName="firmName" @deviceList="deviceList"/>
   </div>
 </template>
 <script>
@@ -225,6 +229,8 @@ export default {
             updateInfoPoint: '',//临时维护信息点
             updateInput: '', //临时维护信息点值
             firmName: '',//维护信息显示厂家名称
+            firmDataType: 'row',
+            // maintenanceList: {},//批量信息维护信息统计
         };
     },
     methods: {
@@ -708,6 +714,9 @@ export default {
 
             }
         },
+        deviceList(data) {
+            console.log(data,'我是单项传来的对象')
+        },
         //获取到了正确的信息
         getInfors(infos, row, el) {
             let val = this.hot.colToProp(row.col);
@@ -884,20 +893,25 @@ export default {
             return a;
         },
         //如果选择供应商之后
-        supplierChange(data) {
-            let firm = {...data, num: 8}
-            this.firmName = firm
-            console.log(data, '供应商')
-            tools.setDataForKey(this.tableData[this.row], "DPSupplierID", data.venderId)
-            tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.Supplier", data.name)
-            this.handleUpdataTable(
-                [
-                    [this.row, "DPSupplierID", null, data.venderId],
-                    [this.row, "LedgerParam.SupplyPurchase.Supplier", null, data.name]
-                ],
-                "edit"
-            )
-            // this.handleUpdataTable([[this.row, "LedgerParam.SupplyPurchase.Supplier", null, data.name]], "edit")
+        supplierChange(data, type) {
+            if (type === 'dialog') {
+                let firm = {...data, num: 8}
+                this.firmName = firm
+                console.log(data, '供应商')
+                // this.maintenanceList.supplier = data
+            } else {
+                tools.setDataForKey(this.tableData[this.row], "DPSupplierID", data.venderId)
+                tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.Supplier", data.name)
+                this.handleUpdataTable(
+                    [
+                        [this.row, "DPSupplierID", null, data.venderId],
+                        [this.row, "LedgerParam.SupplyPurchase.Supplier", null, data.name]
+                    ],
+                    "edit"
+                )
+                // this.handleUpdataTable([[this.row, "LedgerParam.SupplyPurchase.Supplier", null, data.name]], "edit")
+            }
+
         },
         //供应合同编号
         supplyChange(data) {
@@ -916,53 +930,68 @@ export default {
             }
         },
         //选择型号修改
-        firmChange(data) {
-            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)
-            this.handleUpdataTable(
-                [
-                    [this.row, "DPManufacturerID", null, data.venderId],
-                    [this.row, "LedgerParam.EquipManufactor.Brand", null, data.brand],
-                    [this.row, "LedgerParam.EquipManufactor.Specification", null, data.name]
-                ],
-                "edit"
-            )
-            // this.handleUpdataTable([[this.row, "LedgerParam.EquipManufactor.Brand", null, data.brand]], "edit")
-            // this.handleUpdataTable([[this.row, "LedgerParam.EquipManufactor.Specification", null, data.name]], "edit")
+        firmChange(data, type) {
+            if (type === 'dialog') { // 如果是批量信息维护
+                console.log(data, type, '=====')
+                let firm = {...data, num: 2, name: `${data.brand}/${data.name}`}
+                this.firmName = firm //批量维护dialog显示对象的字段
+                // this.maintenanceList.firm = data
+                // console.log(this.maintenanceList, 'array')
+            } else {  //如果是表格操作
+                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)
+                this.handleUpdataTable(
+                    [
+                        [this.row, "DPManufacturerID", null, data.venderId],
+                        [this.row, "LedgerParam.EquipManufactor.Brand", null, data.brand],
+                        [this.row, "LedgerParam.EquipManufactor.Specification", null, data.name]
+                    ],
+                    "edit"
+                )
+                // this.handleUpdataTable([[this.row, "LedgerParam.EquipManufactor.Brand", null, data.brand]], "edit")
+                // this.handleUpdataTable([[this.row, "LedgerParam.EquipManufactor.Specification", null, data.name]], "edit")
+            }
         },
         //保险商变更
-        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(
-                [
-                    [this.row, "DPInsurerID", null, data.venderId],
-                    [this.row, "LedgerParam.InsuranceDoc.Insurer", null, data.name]
-                ],
-                "edit"
-            )
-            // this.handleUpdataTable([[this.row, "LedgerParam.InsuranceDoc.Insurer", null, data.name]], "edit")
+        changeInsurer(data, type) {
+            if (type === 'dialog') {
+                let firm = {...data, num: 42}
+                this.firmName = firm
+                // this.maintenanceList.insurer = data
+            } else {
+                tools.setDataForKey(this.tableData[this.row], "DPInsurerID", data.venderId)
+                tools.setDataForKey(this.tableData[this.row], "LedgerParam.InsuranceDoc.Insurer", data.name)
+                this.handleUpdataTable(
+                    [
+                        [this.row, "DPInsurerID", null, data.venderId],
+                        [this.row, "LedgerParam.InsuranceDoc.Insurer", null, data.name]
+                    ],
+                    "edit"
+                )
+                // this.handleUpdataTable([[this.row, "LedgerParam.InsuranceDoc.Insurer", null, data.name]], "edit")
+            }
+
         },
         //维修商变更
-        changeMaintainer(data) {
-            let firm = {...data, num: 35}
-            this.firmName = firm
-            tools.setDataForKey(this.tableData[this.row], "DPMaintainerID", data.venderId)
-            tools.setDataForKey(this.tableData[this.row], "LedgerParam.OperationMainte.Maintainer", data.name)
-            this.handleUpdataTable(
-                [
-                    [this.row, "DPMaintainerID", null, data.venderId],
-                    [this.row, "LedgerParam.OperationMainte.Maintainer", null, data.name]
-                ],
-                "edit"
-            )
-            // this.handleUpdataTable([[this.row, "LedgerParam.OperationMainte.Maintainer", null, data.name]], "edit")
+        changeMaintainer(data, type) {
+            if (type === 'dialog') {
+                let firm = {...data, num: 35}
+                this.firmName = firm
+                // this.maintenanceList.maintainer = data
+            } else {
+                tools.setDataForKey(this.tableData[this.row], "DPMaintainerID", data.venderId)
+                tools.setDataForKey(this.tableData[this.row], "LedgerParam.OperationMainte.Maintainer", data.name)
+                this.handleUpdataTable(
+                    [
+                        [this.row, "DPMaintainerID", null, data.venderId],
+                        [this.row, "LedgerParam.OperationMainte.Maintainer", null, data.name]
+                    ],
+                    "edit"
+                )
+                // this.handleUpdataTable([[this.row, "LedgerParam.OperationMainte.Maintainer", null, data.name]], "edit")
+            }
+
         },
         //修改关联的资产
         changeProperty(val) {
@@ -1006,8 +1035,9 @@ export default {
         },
         //    批量信息维护
         Batch() {
+            this.firmDataType = 'dialog'
             this.$refs.batchDialogs.batchDialog = true
-        }
+        },
     },
     watch: {
     projectId() {