From 3197b7146c4118247519f73c66d14e45fb567ec6 Mon Sep 17 00:00:00 2001
From: z_yu <1534695664@qq.com>
Date: Fri, 8 Jul 2022 17:37:42 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86=20?=
=?UTF-8?q?=E4=BB=A5=E5=8F=8Abug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/storeManage/deviceManage/device.js | 23 ++-
.../storeManage/deviceManage/deviceDetail.js | 78 ---------
src/api/storeManage/deviceManage/storeroom.js | 30 ++++
src/views/components/category/SettingForm.vue | 17 +-
src/views/storeManage/deviceManage/index.vue | 6 +-
.../deviceManage/module/deviceDetail.vue | 159 +++++++++++++++---
6 files changed, 195 insertions(+), 118 deletions(-)
delete mode 100644 src/api/storeManage/deviceManage/deviceDetail.js
create mode 100644 src/api/storeManage/deviceManage/storeroom.js
diff --git a/src/api/storeManage/deviceManage/device.js b/src/api/storeManage/deviceManage/device.js
index f0ef612..a968a00 100644
--- a/src/api/storeManage/deviceManage/device.js
+++ b/src/api/storeManage/deviceManage/device.js
@@ -1,30 +1,37 @@
import request from '@/utils/request'
+export function getSupplier() {
+ return request({
+ url: 'api/supplier/dropdown-list',
+ method: 'get'
+ })
+}
+
export function add(data) {
return request({
- url: 'api/storeroom/create',
+ url: 'api/dictrionary/edit',
method: 'post',
data
})
}
export function del(ids) {
- const params = {
+ const data = {
id: ids[0]
}
return request({
- url: 'api/storeroom/delete',
- method: 'delete',
- params
+ url: 'api/dictrionary/delete',
+ method: 'post',
+ data
})
}
export function edit(data) {
return request({
- url: 'api/storeroom/update',
- method: 'put',
+ url: 'api/dictrionary/edit',
+ method: 'post',
data
})
}
-export default { add, edit, del }
+export default { add, edit, del, getSupplier }
diff --git a/src/api/storeManage/deviceManage/deviceDetail.js b/src/api/storeManage/deviceManage/deviceDetail.js
deleted file mode 100644
index 2c2c914..0000000
--- a/src/api/storeManage/deviceManage/deviceDetail.js
+++ /dev/null
@@ -1,78 +0,0 @@
-import request from '@/utils/request'
-
-export function get(dictName) {
- const params = {
- dictName,
- page: 0,
- size: 9999
- }
- return request({
- url: 'api/dictDetail',
- method: 'get',
- params
- })
-}
-
-export function findSubsetById(id) {
- const params = {
- id,
- page: 0,
- size: 9999
- }
- return request({
- url: 'api/dictrionary/findSubsetById',
- method: 'get',
- params
- })
-}
-
-// 根据字典id查询子集
-export function FetchFindAllSubsetById(parameter) {
- return request({
- url: 'api/dictrionary/findAllSubsetById',
- method: 'get',
- params: parameter
- })
-}
-
-export function getDictMap(dictName) {
- const params = {
- dictName,
- page: 0,
- size: 9999
- }
- return request({
- url: 'api/dictDetail/map',
- method: 'get',
- params
- })
-}
-
-export function add(data) {
- return request({
- url: 'api/dictrionary/edit',
- method: 'post',
- data
- })
-}
-
-export function del(ids) {
- const data = {
- id: ids[0]
- }
- return request({
- url: 'api/dictrionary/delete',
- method: 'post',
- data
- })
-}
-
-export function edit(data) {
- return request({
- url: 'api/dictrionary/edit',
- method: 'post',
- data
- })
-}
-
-export default { add, edit, del }
diff --git a/src/api/storeManage/deviceManage/storeroom.js b/src/api/storeManage/deviceManage/storeroom.js
new file mode 100644
index 0000000..f0ef612
--- /dev/null
+++ b/src/api/storeManage/deviceManage/storeroom.js
@@ -0,0 +1,30 @@
+import request from '@/utils/request'
+
+export function add(data) {
+ return request({
+ url: 'api/storeroom/create',
+ method: 'post',
+ data
+ })
+}
+
+export function del(ids) {
+ const params = {
+ id: ids[0]
+ }
+ return request({
+ url: 'api/storeroom/delete',
+ method: 'delete',
+ params
+ })
+}
+
+export function edit(data) {
+ return request({
+ url: 'api/storeroom/update',
+ method: 'put',
+ data
+ })
+}
+
+export default { add, edit, del }
diff --git a/src/views/components/category/SettingForm.vue b/src/views/components/category/SettingForm.vue
index 042f4ef..a8c0afe 100644
--- a/src/views/components/category/SettingForm.vue
+++ b/src/views/components/category/SettingForm.vue
@@ -39,6 +39,7 @@
+
@@ -129,6 +130,8 @@ export default {
var checkEditLength = (rule, value, callback) => {
if (this.form.editLength && this.form.editLength > 510) {
callback(new Error('显示长度最大510'))
+ } else if (this.form.editLength && this.form.editLength < 46) {
+ callback(new Error('显示长度最小46'))
} else {
callback()
}
@@ -294,15 +297,17 @@ export default {
// 显示长度 input.value>200,则自动勾选上“显示一整行”
changEditLength(e) {
const value = e.target.value
- if (value < 46) {
- this.$message.error('显示长度最小46')
- }
+ // if (value < 46) {
+ // this.$message.error('显示长度最小46')
+ // this.form.editLength = 46
+ // }
if (value > 200) {
this.form.isLine = true
}
- if (value > 510) {
- this.$message.error('显示长度最大510')
- }
+ // if (value > 510) {
+ // this.$message.error('显示长度最大510')
+ // this.form.editLength = 510
+ // }
},
changeIsLine() {
if (!this.form.isLine) {
diff --git a/src/views/storeManage/deviceManage/index.vue b/src/views/storeManage/deviceManage/index.vue
index 245ab89..0da6171 100644
--- a/src/views/storeManage/deviceManage/index.vue
+++ b/src/views/storeManage/deviceManage/index.vue
@@ -63,7 +63,7 @@