| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 | <template>    <view>        <view class="search-box">            <My_search background="#fff" @onSearch="onSearch">                <view class="filtration-but" @click="openFiltrate">                    筛选                    <text class="iconfont icon-shaixuan" />                </view>            </My_search>        </view>        <view class="head">            <text>                门店            </text>            <text>                共{{ total }}个            </text>        </view>        <filtrate ref="Filtrate" :filtrateList="filtrateList" @onFiltration="onFiltration" />        <My_listbox ref="List" @getlist="getList" bottomHeight="70">            <store-list ref="storeList" :list="list" @onClick="onClick" />        </My_listbox>        <view class="footer">            <navigator class="invite" @click="onInsert" url="/store/insert/store">                新增门店            </navigator>        </view>    </view></template><script>import storeList from "../modules/storeList"export default {    components: { storeList },    data() {        return {            "content": {                "where": {                    "condition": ""                }            },            total: 0,            list: [],            uninitialized: true,            filtrateList: []        }    },    methods: {        init() {            this.getList(true)        },        openFiltrate() {            if (this.filtrateList.length == 0) {                Promise.all(['storetype'].map(v => this.getCustomClass(v))).then(res => {                    let filtrateList = [{                        title: "状态",                        key: 'status',                        showKey: "remarks",                        selected: "value",                        value: "",                        defaultVal: "",                        rang: [{ remarks: "新建", value: "新建" }, { remarks: "提交", value: "提交" }, { remarks: "审核", value: "审核" },],                    }, {                        title: "门店类型",                        key: 'storetype',                        showKey: "remarks",                        selected: "value",                        value: "",                        defaultVal: "",                        rang: [{ remarks: "直营", value: "直营" }, { remarks: "分销", value: "分销" }],                    }, {                        title: "门店卖场类型",                        key: 'markettype',                        showKey: "remarks",                        selected: "value",                        value: "",                        defaultVal: "",                        rang: res[0],                    }]                    this.filtrateList = filtrateList.map(v => {                        v.rang.unshift({ remarks: "全部", value: "" })                        return v                    })                    this.$refs.Filtrate.changeShow();                })            } else {                this.$refs.Filtrate.changeShow();            }        },        onFiltration(where) {            this.content.where = {                condition: this.content.where.condition,                ...where            };            this.getList(true);        },        getList(init = false) {            if (this.paging(this.content, init)) return;            this.$Http.basic({                "id": "20240410095602",                content: this.content            }).then(res => {                console.log("门店列表", res)                this.$refs.List.RefreshToComplete()                if (this.cutoff(res.msg)) return;                this.uninitialized = false;                this.$refs.List.setHeight()                res.data = this.$refs.storeList.handleList(res.data)                this.total = res.total;                this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data), this.colors;                this.content = this.$refs.List.paging(this.content, res)            })        },        onClick(item) {            this.onInsert();            uni.navigateTo({                url: '/store/center/detail?id=' + item.sa_storeid,            });        },        onInsert() {            this.$Http.uploadStoreList = function () {                if (this.content.pageNumber && this.content.pageNumber >= 2) {                    let content = this.paging(this.content, true, true)                    this.$Http.basic({                        "id": "20240410095602",                        content                    }).then(res => {                        console.log("更新门店列表", res)                        if (this.cutoff(res.msg)) return;                        this.$refs.List.setHeight()                        this.list = this.$refs.storeList.handleList(res.data);                    })                }            }.bind(this)        },        onSearch(condition) {            this.content.where.condition = condition;            this.getList(true)        }    },}</script><style lang="scss" scoped>.search-box {    margin-top: 10px;    padding: 0 10px;    box-sizing: border-box;    .filtration-but {        display: flex;        align-items: center;        font-family: PingFang SC, PingFang SC;        font-size: 14px;        color: #333333;        padding-left: 10px;        text {            color: #DDDDDD !important;            margin-left: 5px;        }    }}.head {    display: flex;    align-items: center;    justify-content: space-between;    height: 37px;    padding: 0 10px;    box-sizing: border-box;    font-family: Source Han Sans SC, Source Han Sans SC;    font-size: 12px;    color: #666666;}.footer {    position: fixed;    bottom: 0;    display: flex;    justify-content: space-between;    width: 100vw;    height: 65px;    background: #FFFFFF;    box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);    padding: 5px 10px;    box-sizing: border-box;    .invite {        display: flex;        align-items: center;        justify-content: center;        flex: 1;        height: 45px;        background: #C30D23;        border-radius: 5px;        font-family: PingFang SC, PingFang SC;        font-weight: 500;        font-size: 16px;        color: #FFFFFF;    }}</style>
 |