Quellcode durchsuchen

管理后台-编辑页取值优化

panyong vor 3 Jahren
Ursprung
Commit
36dfab2ed5

+ 1 - 1
htmldev/manage/src/views/business/outlet/list/details.vue

@@ -167,7 +167,7 @@ export default {
       for (const key in this.exData) {
         if (this.form.hasOwnProperty(key)) {
           let value = this.exData[key]
-          if ((Array.isArray(value) && value.length > 0) || value) {
+          if ((Array.isArray(value) && value.length >= 1) || (Object.prototype.toString.call(value) === '[object Object]') || (typeof value === 'string' && value) || typeof value === 'number') {
             if (key === 'bar_status') {
               value = value.toString()
             }

+ 1 - 1
htmldev/manage/src/views/business/place/list/details.vue

@@ -167,7 +167,7 @@ export default {
       for (const key in this.exData) {
         if (this.form.hasOwnProperty(key)) {
           let value = this.exData[key]
-          if ((Array.isArray(value) && value.length > 0) || value === 0 || value) {
+          if ((Array.isArray(value) && value.length >= 1) || (Object.prototype.toString.call(value) === '[object Object]') || (typeof value === 'string' && value) || typeof value === 'number') {
             if (key === 'place_price') {
               value = fen2Yuan(value)
             }

+ 1 - 1
htmldev/manage/src/views/business/place/reserve/details.vue

@@ -102,7 +102,7 @@ export default {
       for (const key in this.exData) {
         if (this.form.hasOwnProperty(key)) {
           let value = this.exData[key]
-          if ((Array.isArray(value) && value.length > 0) || value === 0 || value) {
+          if ((Array.isArray(value) && value.length >= 1) || (Object.prototype.toString.call(value) === '[object Object]') || (typeof value === 'string' && value) || typeof value === 'number') {
             if (key === 'order_sign_status') {
               value = value.toString()
             }

+ 1 - 1
htmldev/manage/src/views/business/place/set/details.vue

@@ -221,7 +221,7 @@ export default {
       for (const key in this.exData) {
         if (this.form.hasOwnProperty(key)) {
           let value = this.exData[key]
-          if ((Array.isArray(value) && value.length > 0) || value === 0 || value) {
+          if ((Array.isArray(value) && value.length >= 1) || (Object.prototype.toString.call(value) === '[object Object]') || (typeof value === 'string' && value) || typeof value === 'number') {
             if (key === 'place_time') {
               value = new Date(`${value}`)
               console.log(value)

+ 1 - 1
htmldev/manage/src/views/business/pms/category/details.vue

@@ -91,7 +91,7 @@ export default {
       for (const key in this.exData) {
         if (this.form.hasOwnProperty(key)) {
           let value = this.exData[key]
-          if ((Array.isArray(value) && value.length > 0) || value === 0 || value) {
+          if ((Array.isArray(value) && value.length >= 1) || (Object.prototype.toString.call(value) === '[object Object]') || (typeof value === 'string' && value) || typeof value === 'number') {
             if (key === 'category_status') {
               value = value.toString()
             }

+ 1 - 1
htmldev/manage/src/views/business/pms/goodsAttr/details.vue

@@ -109,7 +109,7 @@ export default {
       for (const key in this.exData) {
         if (this.form.hasOwnProperty(key)) {
           let value = this.exData[key]
-          if ((Array.isArray(value) && value.length > 0) || value === 0 || value) {
+          if ((Array.isArray(value) && value.length >= 1) || (Object.prototype.toString.call(value) === '[object Object]') || (typeof value === 'string' && value) || typeof value === 'number') {
             if (key === 'attach_content') {
               value = value.split(',').map(item => ({
                 name: item

+ 1 - 1
htmldev/manage/src/views/business/sms/playList/details.vue

@@ -104,7 +104,7 @@ export default {
       for (const key in this.exData) {
         if (this.form.hasOwnProperty(key)) {
           let value = this.exData[key]
-          if ((Array.isArray(value) && value.length > 0) || value === 0 || value) {
+          if ((Array.isArray(value) && value.length >= 1) || (Object.prototype.toString.call(value) === '[object Object]') || (typeof value === 'string' && value) || typeof value === 'number') {
             if (key === 'song_price') {
               value = fen2Yuan(value)
             }