shaogen1995 il y a 4 ans
Parent
commit
e4854cd2b6

+ 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 - 2
src/views/collect/collect1_add.vue

@@ -271,13 +271,13 @@ export default {
     },
     // 点击提交
     submit () {
+      if (this.tableData.some(v => v.outPath === '')) return this.$message.warning('提用位置不能为空')
+      if (this.fromData.textarea.trim() === '') return this.$message.warning('提用说明不能为空')
       this.$confirm('是否确认提交?', '提示', {
         confirmButtonText: '确定',
         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('提用说明不能为空')
         // 手动整理所有输入的出库位置信息
         this.tableData.forEach((v, i) => {
           this.locations[v.id] = this.tableData[i].outPath

+ 18 - 6
src/views/collect/collect1_audit.vue

@@ -139,12 +139,24 @@ export default {
     async submit () {
       try {
         await this.$refs.fromData.validate()
-        const obj = { id: this.myData.id, reason: this.fromData.textarea, status: this.fromData.result }
-        const res = await holding1Audit(obj)
-        if (res.code === 0) {
-          this.$message.success('审核成功')
-          this.$router.push('/layout/collect1')
-        } else this.$message.warning(res.msg)
+
+        this.$confirm('是否确认提交?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          const obj = { id: this.myData.id, reason: this.fromData.textarea, status: this.fromData.result }
+          const res = await holding1Audit(obj)
+          if (res.code === 0) {
+            this.$message.success('审核成功')
+            this.$router.push('/layout/collect1')
+          } else this.$message.warning(res.msg)
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消提交'
+          })
+        })
       } catch (error) {
         console.log(error)
       }

+ 1 - 1
src/views/collect/collect2_add.vue

@@ -253,12 +253,12 @@ export default {
     },
     // 点击提交
     submit () {
+      if (this.fromData.textarea.trim() === '') return this.$message.warning('注销说明不能为空')
       this.$confirm('是否确认提交?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(async () => {
-        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 }
         // console.log(999, obj)
         await holding1submit(obj)

+ 18 - 6
src/views/collect/collect2_audit.vue

@@ -159,12 +159,24 @@ export default {
     async submit () {
       try {
         await this.$refs.fromData.validate()
-        const obj = { id: this.myData.id, reason: this.fromData.textarea, status: this.fromData.result }
-        const res = await holding1Audit(obj)
-        if (res.code === 0) {
-          this.$message.success('审核成功')
-          this.$router.push('/layout/collect2')
-        } else this.$message.warning(res.msg)
+
+        this.$confirm('是否确认提交?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          const obj = { id: this.myData.id, reason: this.fromData.textarea, status: this.fromData.result }
+          const res = await holding1Audit(obj)
+          if (res.code === 0) {
+            this.$message.success('审核成功')
+            this.$router.push('/layout/collect2')
+          } else this.$message.warning(res.msg)
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消提交'
+          })
+        })
       } catch (error) {
         console.log(error)
       }

+ 3 - 3
src/views/holding/holding0_add.vue

@@ -192,14 +192,14 @@ export default {
     },
     // 点击提交
     submit (id) {
+      if (this.tableData.length === 0) return this.$message.warning('至少添加一条藏品信息')
+      if (this.fromData.unit.trim() === '') return this.$message.warning('单位或个人不能为空')
+      if (this.fromData.description.trim() === '') return this.$message.warning('登记说明不能为空')
       this.$confirm('是否确认提交?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(async () => {
-        if (this.tableData.length === 0) return this.$message.warning('至少添加一条藏品信息')
-        if (this.fromData.unit.trim() === '') return this.$message.warning('单位或个人不能为空')
-        if (this.fromData.description.trim() === '') return this.$message.warning('登记说明不能为空')
         this.fromData.status = 1
         const res = await addSubmit({ ...this.fromData, id: this.mydata.id })
         if (res.code === 0) {

+ 17 - 6
src/views/holding/holding0_audit.vue

@@ -167,12 +167,23 @@ export default {
     async submit () {
       try {
         await this.$refs.fromData.validate()
-        const obj = { id: this.myData.id, status: this.myresult, reason: this.fromData.textarea, isStorages: this.mySrt }
-        const res = await auditH0Tow(obj)
-        if (res.code === 0) {
-          this.$message.success('提交成功')
-          this.$router.push('/layout/holding0')
-        }
+        this.$confirm('是否确认提交?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          const obj = { id: this.myData.id, status: this.myresult, reason: this.fromData.textarea, isStorages: this.mySrt }
+          const res = await auditH0Tow(obj)
+          if (res.code === 0) {
+            this.$message.success('提交成功')
+            this.$router.push('/layout/holding0')
+          }
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消提交'
+          })
+        })
       } catch (error) {
         console.log(error)
       }

+ 3 - 3
src/views/holding/holding1_add.vue

@@ -259,14 +259,14 @@ export default {
     },
     // 点击提交
     submit () {
+      if (this.tableData.length === 0) return this.$message.warning('至少添加一条藏品信息')
+      if (this.tableData.some(v => v.location === '')) return this.$message.warning('藏品位置不能为空')
+      if (this.fromData.textarea.trim() === '') return this.$message.warning('入库说明不能为空')
       this.$confirm('是否确认提交?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(async () => {
-        if (this.tableData.length === 0) return this.$message.warning('至少添加一条藏品信息')
-        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)
         await holding1submit(obj)

+ 19 - 7
src/views/holding/holding1_audit.vue

@@ -152,13 +152,25 @@ export default {
     async submit () {
       try {
         await this.$refs.fromData.validate()
-        const obj = { id: this.myData.id, reason: this.fromData.textarea, status: this.fromData.result }
-        const res = await holding1Audit(obj)
-        console.log(6666, res)
-        if (res.code === 0) {
-          this.$message.success('审核成功')
-          this.$router.push('/layout/holding1')
-        } else this.$message.warning(res.msg)
+
+        this.$confirm('是否确认提交?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          const obj = { id: this.myData.id, reason: this.fromData.textarea, status: this.fromData.result }
+          const res = await holding1Audit(obj)
+          // console.log(6666, res)
+          if (res.code === 0) {
+            this.$message.success('审核成功')
+            this.$router.push('/layout/holding1')
+          } else this.$message.warning(res.msg)
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消提交'
+          })
+        })
       } catch (error) {
         console.log(error)
       }

+ 3 - 3
src/views/holding/holding2_add.vue

@@ -272,14 +272,14 @@ export default {
     },
     // 点击提交
     submit () {
+      if (this.tableData.length === 0) return this.$message.warning('至少添加一条藏品信息')
+      if (this.tableData.some(v => v.outPath === '')) return this.$message.warning('出库位置不能为空')
+      if (this.fromData.textarea.trim() === '') return this.$message.warning('出库说明不能为空')
       this.$confirm('是否确认提交?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(async () => {
-        if (this.tableData.length === 0) return this.$message.warning('至少添加一条藏品信息')
-        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) => {
           this.locations[v.id] = this.tableData[i].outPath

+ 18 - 6
src/views/holding/holding2_audit.vue

@@ -139,12 +139,24 @@ export default {
     async submit () {
       try {
         await this.$refs.fromData.validate()
-        const obj = { id: this.myData.id, reason: this.fromData.textarea, status: this.fromData.result }
-        const res = await holding1Audit(obj)
-        if (res.code === 0) {
-          this.$message.success('审核成功')
-          this.$router.push('/layout/holding2')
-        } else this.$message.warning(res.msg)
+
+        this.$confirm('是否确认提交?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          const obj = { id: this.myData.id, reason: this.fromData.textarea, status: this.fromData.result }
+          const res = await holding1Audit(obj)
+          if (res.code === 0) {
+            this.$message.success('审核成功')
+            this.$router.push('/layout/holding2')
+          } else this.$message.warning(res.msg)
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消提交'
+          })
+        })
       } catch (error) {
         console.log(error)
       }

+ 27 - 15
src/views/holding/holding3_DiaEdit.vue

@@ -543,23 +543,35 @@ export default {
     },
     // 点击确定
     async btnOK () {
-      this.ruleForm.registerId = this.registerId
       try {
         await this.$refs.ruleForm.validate()
-        if (this.ruleForm.qualityScope === '请选择') this.ruleForm.qualityScope = ''
-        if (this.ruleForm.checkInScope === '请选择') this.ruleForm.checkInScope = ''
-        if (this.ruleForm.goodsTypeId === '') return this.$message.warning('文物类别没有选择!')
-        if (this.ruleForm.level === '') return this.$message.warning('文物级别没有选择!')
-        if (this.ruleForm.textureType === '') return this.$message.warning('文物质地没有选择!')
-        if (this.ruleForm.integrity === '') return this.$message.warning('完残程度没有选择!')
-        // console.log(this.ruleForm)
-        this.ruleForm.amount = Number(this.ruleForm.amount)
-        await getHolding3Edit(this.ruleForm)
-        // console.log(6666, res)
-        this.$message.success('申请成功')
-        this.cancel()
-        // 通知父组件更新界面
-        this.$emit('updateUI')
+        this.$confirm('是否确认提交?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          this.ruleForm.registerId = this.registerId
+          if (this.ruleForm.qualityScope === '请选择') this.ruleForm.qualityScope = ''
+          if (this.ruleForm.checkInScope === '请选择') this.ruleForm.checkInScope = ''
+          if (this.ruleForm.goodsTypeId === '') return this.$message.warning('文物类别没有选择!')
+          if (this.ruleForm.level === '') return this.$message.warning('文物级别没有选择!')
+          if (this.ruleForm.textureType === '') return this.$message.warning('文物质地没有选择!')
+          if (this.ruleForm.integrity === '') return this.$message.warning('完残程度没有选择!')
+
+          // console.log(this.ruleForm)
+          this.ruleForm.amount = Number(this.ruleForm.amount)
+          await getHolding3Edit(this.ruleForm)
+          // console.log(6666, res)
+          this.$message.success('申请成功')
+          this.cancel()
+          // 通知父组件更新界面
+          this.$emit('updateUI')
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消提交'
+          })
+        })
       } catch (error) {
         console.log(error)
         this.$message.warning('有输入不符合表单要求!')

+ 17 - 6
src/views/holding/holding4_audit.vue

@@ -150,12 +150,23 @@ export default {
     async submit () {
       try {
         await this.$refs.fromData.validate()
-        const res = await clickAudit(this.fromData)
-        // console.log(99999999, res)
-        if (res.code === 0) {
-          this.$message.success('审核成功')
-          this.$router.push('/layout/holding4')
-        }
+        this.$confirm('是否确认提交?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          const res = await clickAudit(this.fromData)
+          // console.log(99999999, res)
+          if (res.code === 0) {
+            this.$message.success('审核成功')
+            this.$router.push('/layout/holding4')
+          }
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消提交'
+          })
+        })
       } catch (error) {
         console.log(error)
       }

+ 2 - 2
src/views/holding/holding5_add.vue

@@ -254,13 +254,13 @@ export default {
     },
     // 点击提交
     async submit () {
+      if (this.tableData.length === 0) return this.$message.warning('至少添加一条藏品信息')
+      if (this.fromData.textarea.trim() === '') return this.$message.warning('注销说明不能为空')
       this.$confirm('是否确认提交?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(async () => {
-        if (this.tableData.length === 0) 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 }
         // console.log(999, obj)
         await holding1submit(obj)

+ 18 - 6
src/views/holding/holding5_audit.vue

@@ -159,12 +159,24 @@ export default {
     async submit () {
       try {
         await this.$refs.fromData.validate()
-        const obj = { id: this.myData.id, reason: this.fromData.textarea, status: this.fromData.result }
-        const res = await holding1Audit(obj)
-        if (res.code === 0) {
-          this.$message.success('审核成功')
-          this.$router.push('/layout/holding5')
-        } else this.$message.warning(res.msg)
+
+        this.$confirm('是否确认提交?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          const obj = { id: this.myData.id, reason: this.fromData.textarea, status: this.fromData.result }
+          const res = await holding1Audit(obj)
+          if (res.code === 0) {
+            this.$message.success('审核成功')
+            this.$router.push('/layout/holding5')
+          } else this.$message.warning(res.msg)
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消提交'
+          })
+        })
       } catch (error) {
         console.log(error)
       }