@@ -213,7 +213,7 @@
placeholder="返回数量"
border="surround"
v-model="item.num"
- @blur="handleNum"
+ @blur="handleNum(item)"
>
@@ -221,6 +221,7 @@
+
@@ -324,7 +325,7 @@ export default {
},
// 日期选择器
confirmTime(e) {
- console.log('🚀 ~ confirmTime ~ e', e)
+ console.log('🚀 ~ confirmTime ~ e', e)
this.formData.backTime = this.formatTimestamp(e.value)
console.log('🚀 ~ confirmTime ~ this.formData.backTime:', this.formData.backTime)
this.showPickerTime = false
@@ -356,15 +357,14 @@ export default {
this.formData.fileList.splice(e.index, 1)
console.log('🚀 ~ deleteImg ~ this.formData.fileList:', this.formData.fileList)
},
- handleNum() {
+ handleNum(item) {
// 校验退回数量-只能是正整数
- this.detailList.forEach(item => {
- if (!/^[1-9]\d*$/.test(item.num)) {
- this.$modal.msg('退回数量只能是正整数')
- // 去除.后面的数字
- item.num = item.num.replace(/\.\d+/, '')
- }
- })
+ const reg = /^[1-9]\d*$/
+ if (!reg.test(item.num)) {
+ this.$modal.msg('退回数量只能是正整数')
+ // 去除.后面的数字
+ item.num = item.num.replace(/\.\d+/, '')
+ }
},
upload(path) {
uni.uploadFile({
@@ -458,23 +458,28 @@ export default {
.then(() => {
console.log('所有文件上传完成')
setTimeout(async () => {
- const params = {
- ...this.formData,
- detailList: this.detailList
+ try {
+ const params = {
+ ...this.formData,
+ detailList: this.detailList
+ }
+ delete params.fileList
+ console.log('🚀 ~ submit ~ params:', params)
+ const encryptedData = JSON.stringify(params)
+ const res = await addData({ encryptedData })
+ console.log('🚀 ~ submit ~ res:', res)
+ this.isLoading = false
+ this.$modal.msg('提交成功')
+ setTimeout(() => {
+ // 刷新页面
+ uni.reLaunch({
+ url: '/pages/returnInventory/index'
+ })
+ }, 200)
+ } catch (error) {
+ console.log('🚀 ~ submit ~ error', error)
+ this.isLoading = false
}
- delete params.fileList
- console.log('🚀 ~ submit ~ params:', params)
- const encryptedData = JSON.stringify(params)
- const res = await addData({ encryptedData })
- console.log('🚀 ~ submit ~ res:', res)
- this.isLoading = false
- this.$modal.msg('提交成功')
- setTimeout(() => {
- // 刷新页面
- uni.reLaunch({
- url: '/pages/returnInventory/index'
- })
- }, 200)
}, 600)
})
.catch(error => {
@@ -521,7 +526,7 @@ export default {
}
.uPopup {
width: 90vw;
- height: 80vh;
+ min-height: 80vh;
background-color: #fff;
border-radius: 8px;
padding: 15px;
diff --git a/pages/returnInventory/returnInventoryRecord.vue b/pages/returnInventory/returnInventoryRecord.vue
index 720b145..4725640 100644
--- a/pages/returnInventory/returnInventoryRecord.vue
+++ b/pages/returnInventory/returnInventoryRecord.vue
@@ -12,7 +12,7 @@
>
-
+
{{ item.proName }}
@@ -36,7 +36,7 @@
-
+
@@ -95,7 +95,15 @@ export default {
else this.status = 'nomore'
}, 500)
console.log('加载..', this.pageSize)
- }
+ },
+ goDetail(item) {
+ const params = {
+ ...item
+ }
+ uni.navigateTo({
+ url: `/pages/returnInventory/details?params=${JSON.stringify(params)}`
+ })
+ }
}
}
diff --git a/pages/stockTaking/index.vue b/pages/stockTaking/index.vue
new file mode 100644
index 0000000..53c63bd
--- /dev/null
+++ b/pages/stockTaking/index.vue
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
diff --git a/utils/request.js b/utils/request.js
index 75b6530..e84db67 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -99,7 +99,9 @@ const request = config => {
// res = JSON.parse(decryptCBC(res.data))
console.log('🚀 ~ request.js ~ line 100 ~ res', res)
const code = res.data.code || 200
+ console.log('🚀 ~ ~ code', code)
const msg = errorCode[code] || res.data.msg || errorCode['default']
+ console.log('🚀 ~ ~ msg', msg)
if (code === 401) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {