Forráskód Böngészése

1.冻存架删除不需要选择右边2.容器设置删除后右边刷新

hanmj 6 éve
szülő
commit
10acf99749

+ 34 - 30
src/dashoo.cn/frontend_star/src/pages/equipment/_opera/shelfset_new.vue

@@ -261,7 +261,7 @@
   export default {
     name: 'shelfset',
     components: {},
-    data() {
+    data () {
       return {
         downloading: true,
         imghost: '',
@@ -286,7 +286,7 @@
         ycolorTable: 4,
         xshelf: -1, // 点击空冻存架
         yshelf: -1,
-        shelfs: [], //选中冻存架
+        shelfs: [], // 选中冻存架
         colorTableWidth: 0, //  冰箱的相对尺寸
         colorTableHeight: 0,
         TableWidth: 0, // 每个冻存盒的尺寸
@@ -335,7 +335,7 @@
         iscopybox: true // 复制冻存架是是否同步复制冻存盒
       }
     },
-    created() {
+    created () {
       this.imghost = process.env.imgserverhost
       let eid = this.$route.params.opera
       this.operationform.eid = eid + ''
@@ -346,7 +346,7 @@
     },
     watch: {},
     methods: {
-      initData(eid) {
+      initData (eid) {
         let _this = this
         // 获取冻存架信息
         _this.$axios.get('/shelfset/equipmentdraw/' + eid, {})
@@ -361,7 +361,7 @@
             console.error(err)
           })
       },
-      getfridgeimg(eid) {
+      getfridgeimg (eid) {
         let _this = this
         // 获取容器信息
         _this.$axios.get('/equipment/getmodel/' + eid, {})
@@ -375,7 +375,7 @@
           })
           .catch({})
       },
-      getType() {
+      getType () {
         let _this = this
         _this.$axios.get('/sampleinput/slist/' + this.equipid, {})
           .then(res => {
@@ -392,7 +392,7 @@
             }
           })
       },
-      handleclk(xindex, yindex, xcolorTable, ycolorTable) {
+      handleclk (xindex, yindex, xcolorTable, ycolorTable) {
         let _this = this
         var inputstr = _this.equipid + ',' + ycolorTable + ',' + xcolorTable + ',' + (xindex + 1) + ',' + (yindex + 1)
         _this.$axios.get('/shelfset/boxdraw/' + inputstr, {})
@@ -419,7 +419,9 @@
         this.dchxtable = -1
         this.dchytable = -1
       },
-      shelfclk(x, y) {
+      shelfclk (x, y) {
+        this.selectedShelf.XStation = x
+        this.selectedShelf.YStation = y
         for (var i = 0; i < this.samplelist.length; i++) {
           if (x === this.samplelist[i].XStation && y === this.samplelist[i].YStation) {
             this.yshelf = -1
@@ -436,9 +438,9 @@
         this.shelfs = []
       },
       // 获取冰箱冻存架点击坐标
-      getEquipPosition(ycolor, xidx, yidx) {
-        for (var i = 0 ; i < this.samplelist.length; i ++){
-          if (xidx == this.samplelist[i].YStation && yidx == this.samplelist[i].XStation){
+      getEquipPosition (ycolor, xidx, yidx) {
+        for (var i = 0; i < this.samplelist.length; i++) {
+          if (xidx == this.samplelist[i].YStation && yidx == this.samplelist[i].XStation) {
             this.shelfs = this.samplelist[i]
           }
         }
@@ -447,8 +449,8 @@
         this.ycolor = ycolor + 1
         this.xcolor = -1
       },
-      
-      opforequip(seed) {
+  
+      opforequip (seed) {
         // seed----1:添加冻存盒;0:添加冻存架;2:编辑冻存架;3:编辑冻存盒
         if (seed === 1) {
           if (this.xidx === -1 && this.yidx === -1) {
@@ -480,8 +482,8 @@
             this.shelfCheckAll = true
             this.shelfVisible = true
             this.disableop = false
-            this.operationform.xshelf = this.xshelf //列
-            this.operationform.yshelf = this.yshelf //层
+            this.operationform.xshelf = this.xshelf // 
+            this.operationform.yshelf = this.yshelf // 
             this.operationform.eid = this.equipid + '_' + seed
             this.checkedsampetype = this.option2
             this.operationform.barcode = 'FF201710271534'
@@ -538,7 +540,7 @@
           }
         }
       },
-      savedata() {
+      savedata () {
         let _this = this
         if (this.disableop) { // 根据是否disable某些选项来判断为编辑或添加
           _this.operationform.sampletype = _this.checkedsampetype.join(',')
@@ -596,7 +598,7 @@
           }
         }
       },
-      havesample(val) {
+      havesample (val) {
         for (var i = 0; i < this.samplelist.length; i++) {
           if (this.selectedShelf.Id === this.samplelist[i].ShelfId) {
             if (val) { // 删除冻存盒
@@ -622,7 +624,7 @@
           }
         }
       },
-      moveforequip(seed) {
+      moveforequip (seed) {
         // seed: 0---冻存架; 1---冻存盒
         if (!seed) {
           if (this.xidx !== -1 && this.yidx !== -1) {
@@ -657,7 +659,7 @@
           }
         }
       },
-      copyforequip(seed) {
+      copyforequip (seed) {
         // seed: 0---冻存架; 1---冻存盒
         if (!seed) {
           if (this.yidx === -1 && this.xidx === -1) {
@@ -678,8 +680,8 @@
           } else {
             this.copyVisible = true
             this.copydialogtitle = '复制冻存架'
-            var empty;
-            this.sblist = [];
+            var empty
+            this.sblist = []
             this.sbcheckalllist = []
             for (var i = 1; i <= this.colorTableHeight; i++) {
               for (var j = 1; j <= this.colorTableWidth; j++) {
@@ -717,8 +719,8 @@
               message: '请先添加冻存盒!'
             })
           } else {
-            var num = 0;
-            this.sblist = [];
+            var num = 0
+            this.sblist = []
             this.sbcheckalllist = []
             for (var l = 0; l < this.samplelist.length; l++) {
               if (this.selectedShelf.Id === this.samplelist[l].ShelfId) {
@@ -751,7 +753,7 @@
           }
         }
       },
-      savecopy() {
+      savecopy () {
         if (this.copydialogtitle === '复制冻存架') {
           if (this.selectedsb.length === 0) {
             this.$message({
@@ -801,7 +803,7 @@
             copytostr2 = copytostr2.substring(0, copytostr2.length - 1)
             let _this = this
             _this.$axios.put('/shelfset/boxcopy/' + this.equipid + '_' + this.yidx + '_' + this.xidx + '_' + this
-                .xcolor +
+              .xcolor +
                 '_' + this.ycolor + '_' + copytostr2, {})
               .then(res => {
                 if (res.data.code === 0) {
@@ -825,7 +827,7 @@
           }
         }
       },
-      deletedata(val) {
+      deletedata (val) {
         // val--- 0: 删除冻存架;1:删除冻存盒
         let _this = this
         if (this.havesample(val)) {
@@ -851,6 +853,8 @@
                       message: res.data.message
                     })
                     _this.initData(_this.equipid)
+                    _this.shelfclk(-1, -1)
+                    _this.handleclk(this.xcolor - 1, this.ycolor - 1, this.xidx, this.yidx)
                   } else {
                     this.$message({
                       type: 'warning',
@@ -884,6 +888,7 @@
                       message: res.data.message
                     })
                     _this.initData(_this.equipid)
+                    _this.shelfclk(this.selectedShelf.XStation, this.selectedShelf.YStation)
                     _this.handleclk(this.xcolor - 1, this.ycolor - 1, this.xidx, this.yidx)
                   } else {
                     this.$message({
@@ -905,13 +910,13 @@
         }
       },
       // 全选框控制
-      handleCheckAllChange(val) {
+      handleCheckAllChange (val) {
         this.checkedsampetype = val ? this.option2 : []
         this.selectedsb = val ? this.sbcheckalllist : []
         this.issampetypecheckedall = false
         this.issbcheckall = false
       },
-      handlecheckedsampetypeChange(value) {
+      handlecheckedsampetypeChange (value) {
         let checkedCount = value.length
         this.shelfCheckAll = checkedCount === this.option2.length
         this.boxCheckAll = checkedCount === this.option2.length
@@ -919,7 +924,7 @@
         this.issampetypecheckedall = checkedCount > 0 && checkedCount < this.option2.length
         this.issbcheckall = checkedCount > 0 && checkedCount < this.sblist.length
       },
-      goback() {
+      goback () {
         if (this.$route.query.size) {
           this.$router.push({
             name: this.$route.query.pname,
@@ -935,7 +940,6 @@
       }
     }
   }
-
 </script>
 
 <style lang="scss" scoped>