quanwei
2025-10-29 76ed09d116f484b261d44219de300b79eb2013b3
shop_vue/src/views/plus/business/grade/index.vue
@@ -87,7 +87,7 @@
</template>
<script>
import PlusApi from '@/api/plus.js';
import BusinessApi from '@/api/business.js';
export default {
  data() {
@@ -124,7 +124,7 @@
    // 加载数据
    loadData() {
      this.loading = true;
      PlusApi.gradeIndex().then(res => {
      BusinessApi.gradeList().then(res => {
        this.loading = false;
        this.listData = res.data.list || [];
        console.log(this.listData);
@@ -172,7 +172,7 @@
          
          if (params.grade_id) {
            // 编辑
            PlusApi.gradeEdit(params).then(res => {
            BusinessApi.gradeEdit(params).then(res => {
              if (res.code === 1) {
                this.$message.success('编辑成功');
                this.dialogVisible = false;
@@ -185,7 +185,7 @@
            });
          } else {
            // 添加
            PlusApi.gradeAdd(params).then(res => {
            BusinessApi.gradeAdd(params).then(res => {
              if (res.code === 1) {
                this.$message.success('添加成功');
                this.dialogVisible = false;
@@ -208,7 +208,7 @@
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        PlusApi.gradeDelete({ grade_id: row.grade_id }).then(res => {
        BusinessApi.gradeDelete({ grade_id: row.grade_id }).then(res => {
          if (res.code === 1) {
            this.$message.success('删除成功');
            this.loadData();
@@ -230,7 +230,7 @@
        price: row.price
      };
      
      PlusApi.gradeEdit(params).then(res => {
      BusinessApi.gradeEdit(params).then(res => {
        if (res.code !== 1) {
          this.$message.error(res.msg || '更新权重失败');
          this.loadData(); // 重新加载数据