zhangyu 4 lat temu
rodzic
commit
24b1ae8b0d

+ 11 - 1
src/components/ledger/lib/spaceSelect.vue

@@ -24,12 +24,15 @@ export default {
     isWidth: {
       type: Boolean,
       default: true
+    },
+    isAll:{
+        type: Boolean,
+        default: false
     }
   },
   data() {
     return {
       value:[null],
-      spaceVal: null,//值
       options: [],
       props: {
         isWidth:false
@@ -46,6 +49,13 @@ export default {
       let params1 = {Cascade: [{ Name: 'zoneType', Filters: `ProjectId='${this.projectId}'` }]}
       queryAllZoneType(params1, res => {
         this.options = res.Content;
+        if (this.isAll) {
+            this.options.unshift({
+                Code: "",
+                Name: "全部"
+            });
+            this.value = [''];
+        }
         this.changeVal(this.value);
       })
     },

+ 22 - 6
src/components/ledger/system/dialog/addSpaceDialog.vue

@@ -10,7 +10,7 @@
         <floor-cascader ref="floorcas" @change="changeFloor"></floor-cascader>
       </el-col>
       <el-col :span="7.5" style="padding:0 0;">
-        <space-select ref="spacesel" @change="changeSpace"></space-select>
+				<space-select ref="spacesel" :isAll="true" @change="changeSpace"></space-select>
       </el-col>
     </el-row>
     <el-row class="filters" :gutter="20"></el-row>
@@ -81,6 +81,7 @@ export default {
       inSpaceType: "业务空间",
       Buildfloor: ["all"], // 选中的建筑楼层
       Spacecategory: null, // 选中的业务空间类型
+			spaceValue: [""], //记录切换成功的业务空间值
       tableData: [],
       floorData: {}, //楼层
       spaceData: {}, //业务空间分区
@@ -114,13 +115,28 @@ export default {
     },
     //修改建筑楼层
     changeFloor(value) {
-      this.Buildfloor = value;
-      this.getTableData();
+			this.Buildfloor = value;
+			this.getTableData();
     },
     //修改空间类型
-    changeSpace(value) {
-      this.Spacecategory = value;
-      this.getTableData();
+    changeSpace(val, space, value) {
+			if (this.selections.length) {
+				this.$confirm('关联的业务空间未保存, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.Spacecategory = val;
+					this.spaceValue = value;
+      		this.getTableData();
+        }).catch(() => {
+          this.$refs.spacesel.value = this.spaceValue;  
+        });
+			} else {
+				this.Spacecategory = val;
+				this.spaceValue = value;
+      	this.getTableData();
+			}
     },
     getTableData() {
       let params = {