Просмотр исходного кода

修复不输入位置就能提交问题

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

+ 2 - 2
src/utils/request.js

@@ -1,8 +1,8 @@
 import axios from 'axios'
 // export const baseURL = '666初始地址'
 const service = axios.create({
-  baseURL: 'http://192.168.0.135:8006',
-  // baseURL: '',
+  // baseURL: 'http://192.168.0.135:8006',
+  baseURL: '',
   timeout: 5000
 })
 

+ 2 - 0
src/views/collect/collect1_add.vue

@@ -252,6 +252,7 @@ export default {
         cancelButtonText: '放弃',
         type: 'warning'
       }).then(async () => {
+        if (this.tableData.some(v => v.outPath === '')) return this.$message.warning('提用位置不能为空')
         if (this.fromData.textarea.trim() === '') return this.$message.warning('提用说明不能为空')
         // 发请求
         await holding1submit(obj)
@@ -270,6 +271,7 @@ export default {
     },
     // 点击提交
     async submit () {
+      if (this.tableData.some(v => v.outPath === '')) return this.$message.warning('提用位置不能为空')
       if (this.fromData.textarea.trim() === '') return this.$message.warning('提用说明不能为空')
       // 手动整理所有输入的出库位置信息
       this.tableData.forEach((v, i) => {

+ 2 - 0
src/views/holding/holding1_add.vue

@@ -237,6 +237,7 @@ export default {
         cancelButtonText: '放弃',
         type: 'warning'
       }).then(async () => {
+        if (this.tableData.some(v => v.location === '')) return this.$message.warning('藏品位置不能为空')
         if (this.fromData.textarea.trim() === '') return this.$message.warning('入库说明不能为空')
         // 发请求
         await holding1submit(obj)
@@ -255,6 +256,7 @@ export default {
     },
     // 点击提交
     async submit () {
+      if (this.tableData.some(v => v.location === '')) return this.$message.warning('藏品位置不能为空')
       if (this.fromData.textarea.trim() === '') return this.$message.warning('入库说明不能为空')
       const obj = { description: this.fromData.textarea, goodsIds: this.goodsIds.join(','), id: this.mydata.id, status: 1, location: this.location }
       // console.log(999, obj)

+ 2 - 0
src/views/holding/holding2_add.vue

@@ -252,6 +252,7 @@ export default {
         cancelButtonText: '放弃',
         type: 'warning'
       }).then(async () => {
+        if (this.tableData.some(v => v.outPath === '')) return this.$message.warning('出库位置不能为空')
         if (this.fromData.textarea.trim() === '') return this.$message.warning('出库说明不能为空')
         // 发请求
         await holding1submit(obj)
@@ -270,6 +271,7 @@ export default {
     },
     // 点击提交
     async submit () {
+      if (this.tableData.some(v => v.outPath === '')) return this.$message.warning('出库位置不能为空')
       if (this.fromData.textarea.trim() === '') return this.$message.warning('出库说明不能为空')
       // 手动整理所有输入的出库位置信息
       this.tableData.forEach((v, i) => {