shaogen1995 4 лет назад
Родитель
Сommit
e7075a1a57

+ 0 - 1
src/views/holding/holding0.vue

@@ -177,7 +177,6 @@ export default {
   // 监控data中的数据变化
   watch: {
     time (val) {
-      // console.log(val)
       this.handleSelect(val)
     }
   },

+ 1 - 1
src/views/holding/holding0_result.vue

@@ -78,7 +78,7 @@
         </div>
         <!-- 最下面的按钮 -->
           <div class="button">
-              <el-button @click="$router.go(-1)">返回</el-button>
+              <el-button @click="$router.push('/layout/holding0')">返回</el-button>
           </div>
       </div>
     </div>

+ 1 - 1
src/views/holding/holding1_look.vue

@@ -82,7 +82,7 @@
         </div>
         <!-- 最下面的按钮 -->
           <div class="button">
-              <el-button @click="$router.go(-1)">返回</el-button>
+              <el-button @click="$router.push('/layout/holding1')">返回</el-button>
           </div>
       </div>
     </div>

+ 1 - 1
src/views/holding/holding2_look.vue

@@ -113,7 +113,7 @@
         <!-- 最下面的按钮 -->
         <div class="button">
           <el-button type="primary" @click="myExport">导 出</el-button>
-          <el-button @click="$router.go(-1)">返回</el-button>
+          <el-button @click="$router.push('/layout/holding2')">返回</el-button>
         </div>
       </div>
     </div>

+ 1 - 0
src/views/holding/holding3_DiaEdit.vue

@@ -474,6 +474,7 @@ export default {
           })
           // console.log(999, this.temp.join(','))
           this.ruleForm.fileIds = this.temp.join(',')
+          // console.log(9999, this.ruleForm.fileIds)
         }
         // deleteAffix(val.id)
         this.$message({

+ 1 - 1
src/views/holding/holding4_look.vue

@@ -47,7 +47,7 @@
         </div>
         <!-- 最下面的按钮 -->
         <div class="button">
-          <el-button @click="$router.go(-1)">返回</el-button>
+          <el-button @click="$router.push('/layout/holding4')">返回</el-button>
         </div>
       </div>
     </div>

+ 39 - 46
src/views/statistics/statistics0.vue

@@ -206,18 +206,17 @@ export default {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
-      }).then(() => {
-        remove(this.allList[this.arrowsShow].id)
-        this.arrowsShow = null
-        this.$nextTick(() => {
-          setTimeout(() => {
-            this.getTreeList()
-          }, 100)
-        })
-        this.$message({
-          type: 'success',
-          message: '删除成功!'
-        })
+      }).then(async () => {
+        const res = await remove(this.allList[this.arrowsShow].id)
+        if (res.code === 0) {
+          this.arrowsShow = null
+          this.$nextTick(() => {
+            setTimeout(() => {
+              this.getTreeList()
+            }, 100)
+          })
+          this.$message.success('删除成功!')
+        } else if (res.code === -1) this.$message.warning('此仓库已使用,不能删除!')
       }).catch(() => {
         this.$message({
           type: 'info',
@@ -235,7 +234,7 @@ export default {
     },
     async popupOneOK () {
       if (this.popupOneName.trim() === '') return this.$message.error('库区名称不能为空')
-      if (this.popupOneName.length > 8) return this.$message.error('库区名称不能超过15个字')
+      if (this.popupOneName.length > 8) return this.$message.error('库区名称不能超过15个字')
       await addEntrepot({
         level: 1,
         name: this.popupOneName,
@@ -254,26 +253,21 @@ export default {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
-      }).then(() => {
-        // console.log(666, this.allList[this.arrowsShow].children[this.entrepotShow].id)
-        remove(this.allList[this.arrowsShow].children[this.entrepotShow].id)
-        this.entrepotShow = 0
-        // this.arrowsShow = null
-        // this.towList.name = ''
-        this.$nextTick(() => {
-          setTimeout(() => {
-            this.getTreeList()
+      }).then(async () => {
+        const res = await remove(this.allList[this.arrowsShow].children[this.entrepotShow].id)
+        if (res.code === 0) {
+          this.entrepotShow = 0
+          this.$nextTick(() => {
             setTimeout(() => {
-              if (this.allList[this.arrowsShow].children) this.towList = this.allList[this.arrowsShow].children[0]
-              else this.towList.name = ''
-              // console.log(999, this.allList[this.arrowsShow].children.length)
+              this.getTreeList()
+              setTimeout(() => {
+                if (this.allList[this.arrowsShow].children) this.towList = this.allList[this.arrowsShow].children[0]
+                else this.towList.name = ''
+              }, 100)
             }, 100)
-          }, 100)
-        })
-        this.$message({
-          type: 'success',
-          message: '删除成功!'
-        })
+          })
+          this.$message.success('删除成功!')
+        } else if (res.code === -1) this.$message.warning('此仓库已使用,不能删除!')
       }).catch(() => {
         this.$message({
           type: 'info',
@@ -300,9 +294,9 @@ export default {
     },
     async popupTowOK () {
       if (this.popupTowNum.trim() === '') return this.$message.error('仓库编号不能为空')
-      if (this.popupTowNum.length > 8) return this.$message.error('仓库编号不能超过15个字')
+      if (this.popupTowNum.length > 8) return this.$message.error('仓库编号不能超过15个字')
       if (this.popupTowName.trim() === '') return this.$message.error('仓库名称不能为空')
-      if (this.popupTowName.length > 8) return this.$message.error('仓库名称不能超过15个字')
+      if (this.popupTowName.length > 8) return this.$message.error('仓库名称不能超过15个字')
       await addEntrepot({
         level: 2,
         name: this.popupTowName,
@@ -332,19 +326,18 @@ export default {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
-      }).then(() => {
-        remove(id)
-        // 刷新页面
-        this.$nextTick(() => {
-          setTimeout(() => {
-            this.getTreeList()
-            this.tableData = this.tableData.filter(v => v.id !== id)
-          }, 100)
-        })
-        this.$message({
-          type: 'success',
-          message: '删除成功!'
-        })
+      }).then(async () => {
+        const res = await remove(id)
+        if (res.code === 0) {
+          // 刷新页面
+          this.$nextTick(() => {
+            setTimeout(() => {
+              this.getTreeList()
+              this.tableData = this.tableData.filter(v => v.id !== id)
+            }, 100)
+          })
+          this.$message.success('删除成功!')
+        } else if (res.code === -1) this.$message.warning('此仓库已使用,不能删除!')
       }).catch(() => {
         this.$message({
           type: 'info',

+ 1 - 1
src/views/statistics/statistics2_look.vue

@@ -61,7 +61,7 @@
         </div>
         <!-- 最下面的按钮 -->
         <div class="button">
-          <el-button @click="$router.go(-1)">返回</el-button>
+          <el-button @click="$router.push('/layout/statistics2')">返回</el-button>
         </div>
       </div>
     </div>