|
@@ -1,18 +1,18 @@
|
|
|
<template>
|
|
|
<div class="goodList">
|
|
|
+ <Form ref="pagination" :model="formValidate" @submit.native.prevent>
|
|
|
+ <FormItem label="员工姓名:" label-for="title">
|
|
|
+ <Input v-model="formValidate.name" placeholder="请输入员工姓名" class="input-add mr14" />
|
|
|
+ <Button type="primary" @click="userSearchs()">查询</Button>
|
|
|
+ </FormItem>
|
|
|
+ </Form>
|
|
|
<Table ref="table" no-data-text="暂无数据" @on-select-all="selectAll" @on-select-all-cancel="cancelAll"
|
|
|
@on-select="TableSelectRow" @on-select-cancel="TableSelectCancelRow" no-filtered-data-text="暂无筛选结果"
|
|
|
:columns="columns4" :data="tableList" :loading="loading" class="mr-20" height="500">
|
|
|
- <!-- <template slot-scope="{ row }" slot="store_name">
|
|
|
- <Tooltip max-width="200" placement="bottom">
|
|
|
- <span class="line2">{{ row.store_name }}{{row.suk}}</span>
|
|
|
- <p slot="content">{{ row.store_name }}{{row.suk}}</p>
|
|
|
- </Tooltip>
|
|
|
- </template> -->
|
|
|
<template slot-scope="{ row }" slot="avatar">
|
|
|
<viewer>
|
|
|
<div class="tabBox_img">
|
|
|
- <img v-lazy="row.avatar" />
|
|
|
+ <img v-lazy="row.avatar||row.user.avatar" />
|
|
|
</div>
|
|
|
</viewer>
|
|
|
</template>
|
|
@@ -30,100 +30,27 @@
|
|
|
import {
|
|
|
mapState
|
|
|
} from "vuex";
|
|
|
- import {
|
|
|
- cascaderListApi,
|
|
|
- changeListApi,
|
|
|
- allLabelApi
|
|
|
- } from "@/api/product";
|
|
|
import {
|
|
|
getYgList
|
|
|
} from '@/api/store'
|
|
|
- import {
|
|
|
- liveGoods
|
|
|
- } from "@/api/live";
|
|
|
export default {
|
|
|
name: "index",
|
|
|
- props: {
|
|
|
- serviceProject: {
|
|
|
- type: Number,
|
|
|
- default: 0,
|
|
|
- },
|
|
|
- serviceCard: {
|
|
|
- type: Number,
|
|
|
- default: 0,
|
|
|
- },
|
|
|
- goodsType: {
|
|
|
- type: Number,
|
|
|
- default: 0,
|
|
|
- },
|
|
|
- storeType: {
|
|
|
- type: Number,
|
|
|
- default: 0,
|
|
|
- },
|
|
|
- is_new: {
|
|
|
- type: String,
|
|
|
- default: "",
|
|
|
- },
|
|
|
- diy: {
|
|
|
- type: Boolean,
|
|
|
- default: false,
|
|
|
- },
|
|
|
- isdiy: {
|
|
|
- type: Boolean,
|
|
|
- default: false,
|
|
|
- },
|
|
|
- ischeckbox: {
|
|
|
- type: Boolean,
|
|
|
- default: false,
|
|
|
- },
|
|
|
- liveStatus: {
|
|
|
- type: Boolean,
|
|
|
- default: false,
|
|
|
- },
|
|
|
- isLive: {
|
|
|
- type: Boolean,
|
|
|
- default: false,
|
|
|
- },
|
|
|
- datas: {
|
|
|
- type: Object,
|
|
|
- default: function() {
|
|
|
- return {};
|
|
|
- },
|
|
|
- },
|
|
|
- },
|
|
|
data() {
|
|
|
return {
|
|
|
//选中商品集合
|
|
|
selectEquips: [],
|
|
|
// 选中的id集合
|
|
|
selectEquipsIds: [],
|
|
|
- labelSelect: [],
|
|
|
cateIds: [],
|
|
|
modal_loading: false,
|
|
|
- treeSelect: [],
|
|
|
formValidate: {
|
|
|
- service_project: this.serviceProject,
|
|
|
- service_card: this.serviceCard,
|
|
|
page: 1,
|
|
|
limit: 10,
|
|
|
- cate_id: "",
|
|
|
- store_name: "",
|
|
|
- is_new: this.is_new,
|
|
|
- store_label_id: ""
|
|
|
+ is_reservation:1
|
|
|
},
|
|
|
total: 0,
|
|
|
- modals: false,
|
|
|
loading: false,
|
|
|
- grid: {
|
|
|
- xl: 10,
|
|
|
- lg: 10,
|
|
|
- md: 12,
|
|
|
- sm: 24,
|
|
|
- xs: 24,
|
|
|
- },
|
|
|
tableList: [],
|
|
|
- currentid: 0,
|
|
|
- productRow: {},
|
|
|
columns4: [{
|
|
|
type: 'selection',
|
|
|
width: 60,
|
|
@@ -141,111 +68,31 @@
|
|
|
{
|
|
|
title: "员工姓名",
|
|
|
key: "name",
|
|
|
- minWidth: 200,
|
|
|
+ minWidth: 80,
|
|
|
},
|
|
|
{
|
|
|
- title: "创建时间",
|
|
|
- key: "create_time",
|
|
|
- minWidth: 100,
|
|
|
- },
|
|
|
- ],
|
|
|
- columns5: [{
|
|
|
- title: "商品ID",
|
|
|
- key: "id",
|
|
|
+ title: "别称",
|
|
|
+ key: "alias",
|
|
|
+ minWidth: 80,
|
|
|
},
|
|
|
{
|
|
|
- title: "图片",
|
|
|
- slot: "image",
|
|
|
+ title: "手机号",
|
|
|
+ key: "mobile",
|
|
|
+ width: 130,
|
|
|
},
|
|
|
{
|
|
|
- title: "商品名称",
|
|
|
- key: "name",
|
|
|
- minWidth: 250,
|
|
|
+ title: "创建时间",
|
|
|
+ key: "create_time",
|
|
|
+ minWidth: 100,
|
|
|
},
|
|
|
],
|
|
|
images: [],
|
|
|
- many: "",
|
|
|
};
|
|
|
},
|
|
|
- computed: {
|
|
|
- ...mapState("admin/layout", ["isMobile"]),
|
|
|
- labelWidth() {
|
|
|
- return this.isMobile ? undefined : 120;
|
|
|
- },
|
|
|
- labelPosition() {
|
|
|
- return this.isMobile ? "top" : "right";
|
|
|
- },
|
|
|
- },
|
|
|
created() {
|
|
|
- // let radio = {
|
|
|
- // title: "选择",
|
|
|
- // width: 70,
|
|
|
- // align: "center",
|
|
|
- // render: (h, params) => {
|
|
|
- // let id = params.row.id;
|
|
|
- // let flag = false;
|
|
|
- // if (this.currentid === id) {
|
|
|
- // flag = true;
|
|
|
- // } else {
|
|
|
- // flag = false;
|
|
|
- // }
|
|
|
- // let self = this;
|
|
|
- // return h("div", [
|
|
|
- // h("Radio", {
|
|
|
- // props: {
|
|
|
- // value: flag,
|
|
|
- // },
|
|
|
- // on: {
|
|
|
- // "on-change": () => {
|
|
|
- // self.currentid = id;
|
|
|
- // this.productRow = params.row;
|
|
|
- // console.log('zhe+++')
|
|
|
- // this.$emit("getProductId", this.productRow);
|
|
|
- // if (this.productRow.id) {
|
|
|
- // if (this.$route.query.fodder === "image") {
|
|
|
- // /* eslint-disable */
|
|
|
- // let imageObject = {
|
|
|
- // image: this.productRow.image,
|
|
|
- // product_id: this.productRow.id,
|
|
|
- // name: this.productRow.name,
|
|
|
- // };
|
|
|
- // form_create_helper.set("image", imageObject);
|
|
|
- // form_create_helper.close("image");
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // this.$Message.warning("请先选择商品");
|
|
|
- // }
|
|
|
- // },
|
|
|
- // },
|
|
|
- // }),
|
|
|
- // ]);
|
|
|
- // },
|
|
|
- // };
|
|
|
-
|
|
|
- // let checkbox = {
|
|
|
- // type: "selection",
|
|
|
- // width: 60,
|
|
|
- // align: "center",
|
|
|
- // };
|
|
|
- // let many = "";
|
|
|
- // if (this.ischeckbox) {
|
|
|
- // many = "many";
|
|
|
- // } else {
|
|
|
- // many = this.$route.query.type;
|
|
|
- // }
|
|
|
- // this.many = many;
|
|
|
- // if (many === "many") {
|
|
|
- // this.columns4.unshift(checkbox);
|
|
|
- // this.columns5.unshift(checkbox);
|
|
|
- // } else {
|
|
|
- // this.columns4.unshift(radio);
|
|
|
- // this.columns5.unshift(radio);
|
|
|
- // }
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.goodsCategory();
|
|
|
this.getList();
|
|
|
- this.getAllLabelApi();
|
|
|
},
|
|
|
methods: {
|
|
|
// 判断是否选中
|
|
@@ -283,26 +130,6 @@
|
|
|
this.TableSelectCancelRow(null, this.tableList[i]);
|
|
|
}
|
|
|
},
|
|
|
- getAllLabelApi() {
|
|
|
- allLabelApi().then(res => {
|
|
|
- this.labelSelect = res.data
|
|
|
- }).catch(err => {
|
|
|
- this.$Message.error(err.msg);
|
|
|
- })
|
|
|
- },
|
|
|
- handleSelectAll() {
|
|
|
- this.$refs.table.selectAll(false);
|
|
|
- },
|
|
|
- // 商品分类;
|
|
|
- goodsCategory() {
|
|
|
- cascaderListApi(1)
|
|
|
- .then((res) => {
|
|
|
- this.treeSelect = res.data;
|
|
|
- })
|
|
|
- .catch((res) => {
|
|
|
- this.$Message.error(res.msg);
|
|
|
- });
|
|
|
- },
|
|
|
pageChange(index) {
|
|
|
this.formValidate.page = index;
|
|
|
this.getList();
|
|
@@ -310,19 +137,6 @@
|
|
|
// 列表
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- if (!this.liveStatus) {
|
|
|
- if (this.isLive) {
|
|
|
- this.formValidate.is_live = 1;
|
|
|
- }
|
|
|
- if (this.goodsType) {
|
|
|
- this.formValidate.is_presale_product = 0;
|
|
|
- this.formValidate.is_vip_product = 0;
|
|
|
- }
|
|
|
- if (this.storeType) {
|
|
|
- this.formValidate.is_supplier = 0;
|
|
|
- }
|
|
|
-
|
|
|
- this.formValidate.cate_id = this.cateIds[this.cateIds.length - 1]
|
|
|
getYgList(this.formValidate)
|
|
|
.then(async (res) => {
|
|
|
let data = res.data;
|
|
@@ -335,30 +149,6 @@
|
|
|
this.loading = false;
|
|
|
this.$Message.error(res.msg);
|
|
|
});
|
|
|
- } else {
|
|
|
- liveGoods({
|
|
|
- is_show: "1",
|
|
|
- status: "1",
|
|
|
- live_id: this.datas.id,
|
|
|
- kerword: this.formValidate.store_name,
|
|
|
- page: this.formValidate.page,
|
|
|
- limit: this.formValidate.limit,
|
|
|
- })
|
|
|
- .then(async (res) => {
|
|
|
- let data = res.data;
|
|
|
- data.list.forEach((el) => {
|
|
|
- el.image = el.cover_img;
|
|
|
- });
|
|
|
- this.tableList = data.list;
|
|
|
- this.total = res.data.count;
|
|
|
- this.sortData();
|
|
|
- this.loading = false;
|
|
|
- })
|
|
|
- .catch((res) => {
|
|
|
- this.loading = false;
|
|
|
- this.$Message.error(res.msg);
|
|
|
- });
|
|
|
- }
|
|
|
},
|
|
|
changeCheckbox(selection) {
|
|
|
let images = [];
|
|
@@ -375,36 +165,9 @@
|
|
|
this.$emit("getProductDiy", selection);
|
|
|
},
|
|
|
ok() {
|
|
|
- // console.log('selectEquips',this.selectEquips)
|
|
|
this.$emit("getProductId", this.selectEquips);
|
|
|
- // let images = [];
|
|
|
- // this.selectEquips.forEach(function(item) {
|
|
|
- // let imageObject = {
|
|
|
- // image: item.image,
|
|
|
- // product_id: item.id,
|
|
|
- // store_name: item.store_name,
|
|
|
- // temp_id: item.temp_id
|
|
|
- // };
|
|
|
- // images.push(imageObject);
|
|
|
- // });
|
|
|
- // if (images.length > 0) {
|
|
|
- // if (this.$route.query.fodder === "image") {
|
|
|
- // let imageValue = form_create_helper.get("image");
|
|
|
- // form_create_helper.set("image", imageValue.concat(images));
|
|
|
- // form_create_helper.close("image");
|
|
|
- // } else {
|
|
|
- // if (this.isdiy) {
|
|
|
- // this.$emit("getProductId", this.selectEquips);
|
|
|
- // } else {
|
|
|
- // this.$emit("getProductId", images);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // this.$Message.warning("请先选择商品");
|
|
|
- // }
|
|
|
},
|
|
|
treeSearchs(value) {
|
|
|
- this.cateIds = value;
|
|
|
this.formValidate.page = 1;
|
|
|
this.getList();
|
|
|
},
|
|
@@ -414,8 +177,6 @@
|
|
|
this.getList();
|
|
|
},
|
|
|
clear() {
|
|
|
- this.productRow.id = "";
|
|
|
- this.currentid = "";
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -437,7 +198,8 @@
|
|
|
.tabBox_img {
|
|
|
width: 36px;
|
|
|
height: 36px;
|
|
|
- border-radius: 4px;
|
|
|
+ border-radius: 100px;
|
|
|
+ overflow: hidden;
|
|
|
cursor: pointer;
|
|
|
|
|
|
img {
|