Explorar el Código

:bug:解决上下架问题

limengbo hace 4 años
padre
commit
231bddeed7

+ 7 - 7
src/views/courseList/index.vue

@@ -11,8 +11,8 @@
         </el-form-item>
         <el-form-item label="状态">
           <el-select v-model="formInline.status" placeholder="请选择状态">
-            <el-option label="未上架" value="NOT_ON_STOCK" />
-            <el-option label="上架" value="HAS_ON_STOCK" />
+            <el-option label="未上架" value="ABNORMAL" />
+            <el-option label="上架" value="NORMAL" />
           </el-select>
         </el-form-item>
         <el-form-item>
@@ -64,7 +64,7 @@
           width="100"
         >
           <template slot-scope="scope">
-            <span style="margin-left: 10px">{{ scope.row.status === 'NOT_ON_STOCK' ? '未上架' : '已上架' }}</span>
+            <span style="margin-left: 10px">{{ scope.row.status === 'ABNORMAL' ? '未上架' : '已上架' }}</span>
           </template>
         </el-table-column>
         <el-table-column
@@ -90,7 +90,7 @@
             <el-button
               size="mini"
               @click="handleDel(scope.$index, scope.row)"
-            >{{ scope.row.status === 'NOT_ON_STOCK' ? '上架' : '下架' }}</el-button>
+            >{{ scope.row.status === 'ABNORMAL' ? '上架' : '下架' }}</el-button>
             <el-button
               size="mini"
               @click="handleSet(scope.$index, scope.row)"
@@ -149,8 +149,8 @@
           </el-form-item>
           <el-form-item label="状态" :label-width="formLabelWidth">
             <el-select v-model="form.status" placeholder="请选择状态">
-              <el-option label="未上架" value="NOT_ON_STOCK" />
-              <el-option label="上架" value="HAS_ON_STOCK" />
+              <el-option label="未上架" value="ABNORMAL" />
+              <el-option label="上架" value="NORMAL" />
             </el-select>
           </el-form-item>
           <el-form-item label="优惠" :label-width="formLabelWidth">
@@ -221,7 +221,7 @@ export default {
     },
     handleDel(index, row) {
       const id = row.id
-      const status = row.status === 'NOT_ON_STOCK' ? 'HAS_ON_STOCK' : 'NOT_ON_STOCK'
+      const status = row.status === 'ABNORMAL' ? 'NORMAL' : 'ABNORMAL'
       this.$store.dispatch('courseList/setCourseLists', {
         id,
         status

+ 3 - 3
src/views/courseWareList/index.vue

@@ -47,7 +47,7 @@
           width="100"
         >
           <template slot-scope="scope">
-            <span style="margin-left: 10px">{{ scope.row.status === 'NOT_ON_STOCK' ? '未上架' : '已上架' }}</span>
+            <span style="margin-left: 10px">{{ scope.row.status === 'ABNORMAL' ? '未上架' : '已上架' }}</span>
           </template>
         </el-table-column>
         <el-table-column
@@ -81,7 +81,7 @@
             <el-button
               size="mini"
               @click="handleDel(scope.$index, scope.row)"
-            >{{ scope.row.status === 'NOT_ON_STOCK' ? '上架' : '下架' }}</el-button>
+            >{{ scope.row.status === 'ABNORMAL' ? '上架' : '下架' }}</el-button>
             <el-button
               size="mini"
               @click="handleSet(scope.$index, scope.row)"
@@ -171,7 +171,7 @@ export default {
     },
     handleDel(index, row) {
       const id = row.id
-      const status = row.status === 'NOT_ON_STOCK' ? 'HAS_ON_STOCK' : 'NOT_ON_STOCK'
+      const status = row.status === 'ABNORMAL' ? 'NORMAL' : 'ABNORMAL'
       this.$store.dispatch('courseWareList/setCourseWareLists', {
         id,
         status

+ 5 - 5
src/views/dashboardBlockRow/index.vue

@@ -37,7 +37,7 @@
           width="80"
         >
           <template slot-scope="scope">
-            <span>{{ scope.row.status === 'HAS_ON_STOCK' ? '上架' : '下架' }}</span>
+            <span>{{ scope.row.status === 'NORMAL' ? '上架' : '下架' }}</span>
           </template>
         </el-table-column>
         <el-table-column
@@ -66,7 +66,7 @@
               size="mini"
               :disabled="disableBtn(scope.row.templateCode)"
               @click="handleUp(scope.$index, scope.row)"
-            >{{ scope.row.status === 'HAS_ON_STOCK' ? '下架' : '上架' }}</el-button>
+            >{{ scope.row.status === 'NORMAL' ? '下架' : '上架' }}</el-button>
             <el-button
               size="mini"
               @click="handleDetail(scope.$index, scope.row)"
@@ -94,8 +94,8 @@
           </el-form-item>
           <el-form-item v-if="type === 'add'" label="状态" :label-width="formLabelWidth" prop="status">
             <el-select v-model="form.status" placeholder="请选择">
-              <el-option value="NOT_ON_STOCK" label="下架" />
-              <el-option value="HAS_ON_STOCK" label="上架" />
+              <el-option value="ABNORMAL" label="下架" />
+              <el-option value="NORMAL" label="上架" />
             </el-select>
           </el-form-item>
         </el-form>
@@ -220,7 +220,7 @@ export default {
     handleUp(index, row) {
       console.log(index, row)
       this.setForm(row)
-      this.form.status = row.status === 'NOT_ON_STOCK' ? 'HAS_ON_STOCK' : 'NOT_ON_STOCK'
+      this.form.status = row.status === 'ABNORMAL' ? 'NORMAL' : 'ABNORMAL'
       this.$store.dispatch('dashboard/setBlockRowList', this.form).then(() => {
         this.$store.dispatch('dashboard/getBlockRowList', {
           id: this.$route.query.id

+ 5 - 5
src/views/dashboardRowItem/index.vue

@@ -50,7 +50,7 @@
           width="80"
         >
           <template slot-scope="scope">
-            <span>{{ scope.row.status === 'HAS_ON_STOCK' ? '上架' : '下架' }}</span>
+            <span>{{ scope.row.status === 'NORMAL' ? '上架' : '下架' }}</span>
           </template>
         </el-table-column>
         <el-table-column
@@ -78,7 +78,7 @@
             <el-button
               size="mini"
               @click="handleUp(scope.$index, scope.row)"
-            >{{ scope.row.status === 'HAS_ON_STOCK' ? '下架' : '上架' }}</el-button>
+            >{{ scope.row.status === 'NORMAL' ? '下架' : '上架' }}</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -124,8 +124,8 @@
           </el-form-item>
           <el-form-item v-if="type === 'add'" label="状态" :label-width="formLabelWidth" prop="status">
             <el-select v-model="form.status" placeholder="请选择">
-              <el-option value="NOT_ON_STOCK" label="下架" />
-              <el-option value="HAS_ON_STOCK" label="上架" />
+              <el-option value="ABNORMAL" label="下架" />
+              <el-option value="NORMAL" label="上架" />
             </el-select>
           </el-form-item>
         </el-form>
@@ -381,7 +381,7 @@ export default {
     handleUp(index, row) {
       console.log(index, row)
       this.setForm(row)
-      this.form.status = row.status === 'NOT_ON_STOCK' ? 'HAS_ON_STOCK' : 'NOT_ON_STOCK'
+      this.form.status = row.status === 'ABNORMAL' ? 'NORMAL' : 'ABNORMAL'
       this.$store.dispatch('dashboard/setRowItemList', this.form).then(() => {
         this.$store.dispatch('dashboard/getRowItemList', {
           id: this.$route.query.id

+ 3 - 3
src/views/schoolDetail/index.vue

@@ -152,7 +152,7 @@ export default {
     codeStatus(type) {
       let status = ''
       switch (type) {
-        case 'HAS_ON_STOCK':
+        case 'NORMAL':
           status = '上架'
           break
         default :
@@ -164,7 +164,7 @@ export default {
     codeStatusUp(type) {
       let status = ''
       switch (type) {
-        case 'HAS_ON_STOCK':
+        case 'NORMAL':
           status = '下架'
           break
         default :
@@ -209,7 +209,7 @@ export default {
     handleDelete(index, row) {
       console.log(index, row)
       this.setForm(row)
-      this.form.status = row.status === 'NOT_ON_STOCK' ? 'HAS_ON_STOCK' : 'NOT_ON_STOCK'
+      this.form.status = row.status === 'ABNORMAL' ? 'NORMAL' : 'ABNORMAL'
       if (this.form.title !== '' || this.form.subTitle !== '' || this.form.url !== '' || this.form.free !== '') {
         this.$store.dispatch('schoolTimetable/setScheduleWare', this.form).then(() => {
           this.$store.dispatch('schoolTimetable/getScheduleWare', {

+ 4 - 4
src/views/tempateList/index.vue

@@ -26,7 +26,7 @@
           width="80"
         >
           <template slot-scope="scope">
-            <span>{{ scope.row.status === 'HAS_ON_STOCK' ? '上架' : '下架' }}</span>
+            <span>{{ scope.row.status === 'NORMAL' ? '上架' : '下架' }}</span>
           </template>
         </el-table-column>
         <el-table-column
@@ -55,7 +55,7 @@
             <el-button
               size="mini"
               @click="handleDetail(scope.$index, scope.row)"
-            >{{ scope.row.status === 'HAS_ON_STOCK' ? '下架' : '上架' }}</el-button>
+            >{{ scope.row.status === 'NORMAL' ? '下架' : '上架' }}</el-button>
             -->
           </template>
         </el-table-column>
@@ -80,8 +80,8 @@
           </el-form-item>
           <el-form-item v-if="type === 'add'" label="状态" :label-width="formLabelWidth">
             <el-select v-model="form.status" placeholder="请选择">
-              <el-option value="NOT_ON_STOCK" label="下架" />
-              <el-option value="HAS_ON_STOCK" label="上架" />
+              <el-option value="ABNORMAL" label="下架" />
+              <el-option value="NORMAL" label="上架" />
             </el-select>
           </el-form-item>
         </el-form>

+ 7 - 7
src/views/topicList/index.vue

@@ -11,8 +11,8 @@
         </el-form-item>
         <el-form-item label="状态">
           <el-select v-model="formInline.status" placeholder="请选择状态">
-            <el-option label="未上架" value="NOT_ON_STOCK" />
-            <el-option label="上架" value="HAS_ON_STOCK" />
+            <el-option label="未上架" value="ABNORMAL" />
+            <el-option label="上架" value="NORMAL" />
           </el-select>
         </el-form-item>
         <el-form-item>
@@ -56,7 +56,7 @@
           width="100"
         >
           <template slot-scope="scope">
-            <span style="margin-left: 10px">{{ scope.row.status === 'NOT_ON_STOCK' ? '未上架' : '已上架' }}</span>
+            <span style="margin-left: 10px">{{ scope.row.status === 'ABNORMAL' ? '未上架' : '已上架' }}</span>
           </template>
         </el-table-column>
         <el-table-column
@@ -82,7 +82,7 @@
             <el-button
               size="mini"
               @click="handleDel(scope.$index, scope.row)"
-            >{{ scope.row.status === 'NOT_ON_STOCK' ? '上架' : '下架' }}</el-button>
+            >{{ scope.row.status === 'ABNORMAL' ? '上架' : '下架' }}</el-button>
             <el-button
               size="mini"
               @click="handleDetail(scope.$index, scope.row)"
@@ -103,8 +103,8 @@
           </el-form-item>
           <el-form-item label="状态" :label-width="formLabelWidth" prop="status">
             <el-select v-model="form.status" placeholder="请选择状态">
-              <el-option label="未上架" value="NOT_ON_STOCK" />
-              <el-option label="上架" value="HAS_ON_STOCK" />
+              <el-option label="未上架" value="ABNORMAL" />
+              <el-option label="上架" value="NORMAL" />
             </el-select>
           </el-form-item>
         </el-form>
@@ -168,7 +168,7 @@ export default {
     },
     handleDel(index, row) {
       const id = row.id
-      const status = row.status === 'NOT_ON_STOCK' ? 'HAS_ON_STOCK' : 'NOT_ON_STOCK'
+      const status = row.status === 'ABNORMAL' ? 'NORMAL' : 'ABNORMAL'
       this.$store.dispatch('topicList/setTopicLists', {
         id,
         status

+ 5 - 5
src/views/topicRelation/index.vue

@@ -56,7 +56,7 @@
           width="100"
         >
           <template slot-scope="scope">
-            <span style="margin-left: 10px">{{ scope.row.status === 'NOT_ON_STOCK' ? '未上架' : '已上架' }}</span>
+            <span style="margin-left: 10px">{{ scope.row.status === 'ABNORMAL' ? '未上架' : '已上架' }}</span>
           </template>
         </el-table-column>
         <el-table-column
@@ -82,7 +82,7 @@
             <el-button
               size="mini"
               @click="handleDel(scope.$index, scope.row)"
-            >{{ scope.row.status === 'NOT_ON_STOCK' ? '上架' : '下架' }}</el-button>
+            >{{ scope.row.status === 'ABNORMAL' ? '上架' : '下架' }}</el-button>
             <el-button
               size="mini"
               @click="handSet(scope.$index, scope.row)"
@@ -112,8 +112,8 @@
           </el-form-item>
           <el-form-item v-if="type === 'add'" label="状态" :label-width="formLabelWidth" prop="status">
             <el-select v-model="form.status" placeholder="请选择状态">
-              <el-option label="未上架" value="NOT_ON_STOCK" />
-              <el-option label="上架" value="HAS_ON_STOCK" />
+              <el-option label="未上架" value="ABNORMAL" />
+              <el-option label="上架" value="NORMAL" />
             </el-select>
           </el-form-item>
         </el-form>
@@ -170,7 +170,7 @@ export default {
     },
     handleDel(index, row) {
       const id = row.id
-      const status = row.status === 'NOT_ON_STOCK' ? 'HAS_ON_STOCK' : 'NOT_ON_STOCK'
+      const status = row.status === 'ABNORMAL' ? 'NORMAL' : 'ABNORMAL'
       this.$store.dispatch('topicList/setTopicRelationLists', {
         id,
         status