案例

\views\bc-couponcenter\coupon-main\components\page\index.vue

index.vue

data() {
      return {
        // #region 临时交互数据
        selectedDataV: {},
        changeField: {
          changed: false,
        },
        selectedOpUser: {},
        selectedUserType: [],
        selectedError: '',
        data: {},
        dialog: {
          // view: {
          //   fromMkey: "report-view",
          //   data: {},
          //   show: false,
          //   title: "详情"
          // }
        },
        // #endregion 临时交互数据
        // #region 分页进度条
        currentRate: 90,
        gradientColor: {
          '0%': '#3fecff',
          '100%': '#6149f6',
        },
        mapperTypes: {
          current: 11,
          // 未完成工单
          "11": {}
        },
        // #endregion 分页进度条
        num: 3,
        footConfig: {
          // selected: "couponcenter-coupon-main",
        },
        //公共必须参数 start
        scrollId: "",
        rootMeta: {
          mkey: null,
          field: null
        },
        filter: {
          pageIndex: 1,
          pageSize: 21,
          word: '',
          status: -1,
          // _menuId: null,
          _nodejs: "common-data",
        },
        dimData: {
          status: []
        },
        //公共参数 end
        //===========公共部分  start
        userActions: [],
        descriptionEmpty: "数据加载中",
        firstLoad: true,
        loading: false,
        merc: {
          data: [],
          value: null,
        },
        used: {
          data: [],
          paging: {}
        },
        pullToBottom: {
          loading: true,
          finished: false,
          error: false,
          errorText: "请求失败,点击重新加载",
          finishedText: "没有更多了",
        },
        //===========公共部分 end
      };
    },
      handleToAdd(item) {
        // this.$link.toLinkUrl(`/company/add/${item["icId"]}`, this, {
        //   query: { icId: item["icId"] },
        // });
        let that = this;
        that.changeField.changed = true;
        that.dataSaveT = {
          changed: true,
          // productTaskId: that.selectedDataV.productTaskId,
          // status: {
          //   value: 4,
          //   name: "已取消"
          // },
          rmt: "add"
        };

method.js


import methodData from "../data/method-data";
// import methodPlugin from "../data/method-plugin";
import methodRulesChanges from '../data/method-rules-changes';
// import methodSave from '../save/method';
//,"paging":{"pageSize":15,"totalCount":13,"totalPage":0,"pageIndex":1,"currentCount":13,"currentRate":100,"limtStartIndex":0}
/* eslint-disable no-unused-vars */
/* eslint-disable no-undef */
export default {
    init(that) {
        // this.loadDataComm(that);
        that.rules = methodRulesChanges.rules;
        that.changeEvents = methodRulesChanges.changes(that);
        that.fieldAttrs = methodRulesChanges.attrs;
        // that.dimData.status = methodData.dimData.status.map(temp => {
        //     return {
        //         "value": temp.value,
        //         "text": temp.name,
        //     }
        // });
        // methodPlugin.getUserFunction(that);
        that.handleLoadMyBiz();
    },
    loadDataComm(that, filterT = {}, filter = {}, meta = {}, dataCol = {}) {
        // 数据二次处理
        let thisT = this;
        const callback = (thatN, dataColN, methodDataN) => {
            thisT.callbackMyBiz(thatN, dataColN, methodDataN);
        }
        that.$bsAjax.getBizPage(that, methodData, {...filter,...filterT}, meta, dataCol, callback);
    },
    callbackMyBiz(that, dataCol, methodData) {
        // const auditStatusClass = methodData.auditStatusClass;
        // const statusClass = methodData.statusClass;
        // const levelClass = methodData.levelClass;
        let usedN = {};
        if (dataCol.data) {
            usedN = that.used[dataCol.data].data
        } else {
            usedN = that.used.data;
        }
        usedN.forEach(element => {

        });
    },
    onSubmitAdd(values, that, valuesN) {
        const doRequestCallback = function (thatN, primarysT, dataT) {
            let primaryField = primarysT[0].field;
            // if (that.dataSaveT.status.value === 1) {
            //     // 已延期 重新打开
            //     // dataT.productTaskId = that.dataSaveT.productTaskId;
            //     // dataT.status = that.dataSaveT.status;
            //     // dataT.opinion = dataT["opinion1"];
            // } 
        };
        const doResponseCallback = function (thatN, primarysT) {
            that.handleSearchRemote(that.filter.word);
            that.$msgBox.success('领取成功,请到我的优惠卷查看和使用。');
        };
        const methodDataT = {
            options: {
                primarys: [
                    {
                        field: methodData.options.primarys[0].field
                    }
                ],
                rootMeta: {
                    mkey: methodData.options.rootMeta.mkey,
                    field: methodData.options.rootMeta.field,
                },
                filter: {
                    _menuId: methodData.options.filter._menuId,
                }
            }
        }
        that.$bsAjax.doBizAdd(that, methodDataT, doRequestCallback, doResponseCallback, {}, {}, valuesN);
    },
}
文档更新时间: 2022-10-07 05:40   作者:admin