|
@@ -27,7 +27,24 @@
|
|
|
<div style="width: 100%">
|
|
|
<el-row style="padding: 0 0 0 80px">
|
|
|
<el-col :span="24">
|
|
|
- <el-col :span="4" style="width: 120px">
|
|
|
+ <el-col :span="8" style="width: 470px">
|
|
|
+ <period-date-picker :size="searchSize"></period-date-picker>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <!-- <el-col :span="4">
|
|
|
+ <company-search :size="searchSize"></company-search>
|
|
|
+ </el-col> -->
|
|
|
+
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-autocomplete
|
|
|
+ v-model="state"
|
|
|
+ :fetch-suggestions="querySearchAsync"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ @select="handleSelect"
|
|
|
+ ></el-autocomplete>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <!-- <el-col :span="4" style="width: 120px">
|
|
|
<el-select
|
|
|
:size="searchSize"
|
|
|
v-model="parmValue.status"
|
|
@@ -48,32 +65,32 @@
|
|
|
:value="item.code"
|
|
|
/>
|
|
|
</el-select>
|
|
|
- </el-col>
|
|
|
- <el-col :span="4" style="width: 150px; padding: 0 0 0 10px">
|
|
|
+ </el-col> -->
|
|
|
+ <!-- <el-col :span="4" style="width: 150px; padding: 0 0 0 10px">
|
|
|
<el-input
|
|
|
:size="searchSize"
|
|
|
v-model="parmValue.name"
|
|
|
:maxlength="40"
|
|
|
placeholder="业务员姓名"
|
|
|
/>
|
|
|
- </el-col>
|
|
|
- <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
|
|
|
+ </el-col> -->
|
|
|
+ <!-- <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
|
|
|
<el-input
|
|
|
:size="searchSize"
|
|
|
v-model="parmValue.username"
|
|
|
:maxlength="40"
|
|
|
placeholder="手机号"
|
|
|
/>
|
|
|
- </el-col>
|
|
|
- <el-col :span="4" style="width: 54px">
|
|
|
+ </el-col> -->
|
|
|
+ <!-- <el-col :span="4" style="width: 54px">
|
|
|
<el-button
|
|
|
:size="searchSize"
|
|
|
type="primary"
|
|
|
class="fr"
|
|
|
icon="el-icon-search"
|
|
|
@click="searchList"
|
|
|
- /></el-col>
|
|
|
- <el-col :span="4" style="width: 66px">
|
|
|
+ /></el-col> -->
|
|
|
+ <!-- <el-col :span="4" style="width: 66px">
|
|
|
<el-button
|
|
|
type="warning"
|
|
|
class="fr"
|
|
@@ -82,8 +99,8 @@
|
|
|
>
|
|
|
重置
|
|
|
</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="3" style="width: 66px; float: right">
|
|
|
+ </el-col> -->
|
|
|
+ <!-- <el-col :span="3" style="width: 66px; float: right">
|
|
|
<el-button
|
|
|
:size="searchSize"
|
|
|
type="primary"
|
|
@@ -92,7 +109,7 @@
|
|
|
>
|
|
|
刷新
|
|
|
</el-button>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -102,7 +119,7 @@
|
|
|
:size="tablebtnSize"
|
|
|
:type="scope.row.status == '0' ? 'warning' : ''"
|
|
|
v-text="
|
|
|
- (statusOptions.find((item) => item.id == scope.row.status) || {})
|
|
|
+ (statusOptions.find((item) => item.id == scope.row.bstatus) || {})
|
|
|
.label || '--'
|
|
|
"
|
|
|
></el-tag>
|
|
@@ -131,7 +148,7 @@
|
|
|
@click="openModal(scope.row.id, true, scope.row)"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
- <el-tooltip
|
|
|
+ <!-- <el-tooltip
|
|
|
v-if="powers.some((item) => item == '005')"
|
|
|
effect="dark"
|
|
|
content="修改"
|
|
@@ -141,32 +158,27 @@
|
|
|
class="el-icon-edit tb-icon"
|
|
|
@click="openModal(scope.row.id, false, scope.row)"
|
|
|
></i>
|
|
|
- </el-tooltip>
|
|
|
+ <p @click="openModal(scope.row.id, false, scope.row)">修改</p>
|
|
|
+ </el-tooltip> -->
|
|
|
<el-tooltip
|
|
|
v-if="
|
|
|
- powers.some((item) => item == '004') && scope.row.status === '1'
|
|
|
+ powers.some((item) => item == '004') && scope.row.bstatus === '1'
|
|
|
"
|
|
|
effect="dark"
|
|
|
- content="禁用"
|
|
|
+ content="下架"
|
|
|
placement="top"
|
|
|
>
|
|
|
- <i
|
|
|
- class="el-icon-video-pause tb-icon"
|
|
|
- @click="statusConfirm(scope.row.id, scope.row.status)"
|
|
|
- ></i>
|
|
|
+ <p @click="statusConfirm(scope.row.id, scope.row.bstatus)">上架</p>
|
|
|
</el-tooltip>
|
|
|
<el-tooltip
|
|
|
v-if="
|
|
|
- powers.some((item) => item == '004') && scope.row.status === '0'
|
|
|
+ powers.some((item) => item == '004') && scope.row.bstatus === '0'
|
|
|
"
|
|
|
effect="dark"
|
|
|
- content="启用"
|
|
|
+ content="上架"
|
|
|
placement="top"
|
|
|
>
|
|
|
- <i
|
|
|
- class="el-icon-video-play tb-icon"
|
|
|
- @click="statusConfirm(scope.row.id, scope.row.status)"
|
|
|
- ></i>
|
|
|
+ <p @click="statusConfirm(scope.row.id, scope.row.bstatus)">下架</p>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
</ex-table>
|
|
@@ -222,11 +234,17 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ restaurants: [],
|
|
|
+ state: "",
|
|
|
+ timeout: null,
|
|
|
+
|
|
|
+ // 饿了么的
|
|
|
+ product: "", //商品名称绑定的数据
|
|
|
sitem: null,
|
|
|
- // 状态
|
|
|
+ // 渲染当前状态
|
|
|
statusOptions: [
|
|
|
- { id: "0", label: "禁用" },
|
|
|
- { id: "1", label: "启用" },
|
|
|
+ { id: "0", label: "使用中" },
|
|
|
+ { id: "1", label: "已下架" },
|
|
|
],
|
|
|
statusList: statusList,
|
|
|
loading: true,
|
|
@@ -234,9 +252,6 @@ export default {
|
|
|
isDetail: false,
|
|
|
modelId: 0,
|
|
|
parmValue: {
|
|
|
- name: "", // 业务员名字
|
|
|
- username: "", // 账号
|
|
|
- status: "", //
|
|
|
page: 1, // 页码
|
|
|
size: 15, // 每页显示条数
|
|
|
},
|
|
@@ -261,31 +276,58 @@ export default {
|
|
|
// 表格 - 列参数
|
|
|
columns: [
|
|
|
{
|
|
|
- prop: "nickname",
|
|
|
- label: "真实姓名",
|
|
|
+ prop: "good_code",
|
|
|
+ label: "商品编号",
|
|
|
},
|
|
|
{
|
|
|
- prop: "role_name",
|
|
|
- label: "角色名称",
|
|
|
+ prop: "brand",
|
|
|
+ label: "品牌",
|
|
|
},
|
|
|
{
|
|
|
- prop: "mobile",
|
|
|
- label: "联系电话",
|
|
|
+ prop: "good_name",
|
|
|
+ label: "商品名称",
|
|
|
},
|
|
|
+ // {
|
|
|
+ // prop: "good_desc",
|
|
|
+ // label: "商品描述",
|
|
|
+ // },
|
|
|
{
|
|
|
- prop: "email",
|
|
|
- label: "邮箱",
|
|
|
+ prop: "type_code",
|
|
|
+ label: "商品属性", //商品属性code
|
|
|
},
|
|
|
{
|
|
|
- prop: "status",
|
|
|
- label: "状态",
|
|
|
- _slot_: "status",
|
|
|
- width: "80px",
|
|
|
+ prop: "original_price",
|
|
|
+ label: "采购价",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "da", //接口未返回
|
|
|
+ label: "单位",
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // prop: "status",
|
|
|
+ // label: "商品名状态",
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ prop: "type_code",
|
|
|
+ label: "商品属性",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "usable_stock",
|
|
|
+ label: "当前库存",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "qq", //接口未返回
|
|
|
+ label: "供应商编码",
|
|
|
},
|
|
|
{
|
|
|
- prop: "addtime",
|
|
|
- label: "创建时间",
|
|
|
- sortable: true,
|
|
|
+ prop: "aa", //接口未返回
|
|
|
+ label: "公司编码",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "bstatus",
|
|
|
+ label: "当前状态",
|
|
|
+ _slot_: "status",
|
|
|
+ width: "80px",
|
|
|
},
|
|
|
{
|
|
|
prop: "",
|
|
@@ -294,19 +336,22 @@ export default {
|
|
|
_noset_: true,
|
|
|
_slot_: "operation",
|
|
|
},
|
|
|
+ // {
|
|
|
+ // prop: "addtime",
|
|
|
+ // label: "创建时间",
|
|
|
+ // sortable: true,
|
|
|
+ // },
|
|
|
],
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.searchList();
|
|
|
+ this.restaurants = this.loadAll(); //饿了么的
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
restSearch() {
|
|
|
this.parmValue = {
|
|
|
- name: "", // 业务员名字
|
|
|
- username: "", // 账号
|
|
|
- status: "", //
|
|
|
page: 1, // 页码
|
|
|
size: 10, // 每页显示条数
|
|
|
};
|
|
@@ -319,38 +364,42 @@ export default {
|
|
|
this.isDetail = isDetail;
|
|
|
this.sitem = sitem;
|
|
|
},
|
|
|
+ // 删除功能函数
|
|
|
async deleteById(id, status) {
|
|
|
- await this.$confirm("确定要删除?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(async () => {
|
|
|
- const model = {
|
|
|
- id: id,
|
|
|
- status: status === "1" ? "0" : "1",
|
|
|
- };
|
|
|
- const res = await asyncRequest.status(model);
|
|
|
- if (res && res.code === 0) {
|
|
|
- this.$notify.success({
|
|
|
- title: "删除成功",
|
|
|
- message: "",
|
|
|
- });
|
|
|
- this.searchList();
|
|
|
- } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- await this.logout();
|
|
|
- } else {
|
|
|
- this.$message.warning(res.message);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- console.log("取消");
|
|
|
- });
|
|
|
+ // await this.$confirm("确定要删除?", {
|
|
|
+ // confirmButtonText: "确定",
|
|
|
+ // cancelButtonText: "取消",
|
|
|
+ // type: "warning",
|
|
|
+ // })
|
|
|
+ // .then(async () => {
|
|
|
+ // const model = {
|
|
|
+ // id: id,
|
|
|
+ // status: status === "1" ? "0" : "1",
|
|
|
+ // };
|
|
|
+ // const res = await asyncRequest.status(model);
|
|
|
+ // if (res && res.code === 0) {
|
|
|
+ // this.$notify.success({
|
|
|
+ // title: "删除成功",
|
|
|
+ // message: "",
|
|
|
+ // });
|
|
|
+ // this.searchList();
|
|
|
+ // } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
+ // await this.logout();
|
|
|
+ // } else {
|
|
|
+ // this.$message.warning(res.message);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(() => {
|
|
|
+ // console.log("取消");
|
|
|
+ // });
|
|
|
},
|
|
|
+ // 获取商品列表功能函数
|
|
|
async searchList() {
|
|
|
this.loading = true;
|
|
|
+ // console.log(this.tableData);
|
|
|
const res = await asyncRequest.list(this.parmValue);
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
+ console.log(res.data.list);
|
|
|
this.tableData = res.data.list;
|
|
|
this.pageInfo.total = Number(res.data.count);
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
@@ -361,9 +410,10 @@ export default {
|
|
|
}
|
|
|
this.loading = false;
|
|
|
},
|
|
|
-
|
|
|
+ // 上下架功能的切换
|
|
|
async statusConfirm(id, status) {
|
|
|
- let str = status === "1" ? "禁用" : "启用";
|
|
|
+ console.log(id, status);
|
|
|
+ let str = status === "1" ? "下架" : "上架";
|
|
|
await this.$confirm("确定要改为" + str + "?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
@@ -371,11 +421,14 @@ export default {
|
|
|
})
|
|
|
.then(async () => {
|
|
|
this.loading = true;
|
|
|
+ console.log("修改成功");
|
|
|
const model = {
|
|
|
id: id,
|
|
|
status: status === "1" ? "0" : "1",
|
|
|
};
|
|
|
+ // console.log(model);
|
|
|
const res = await asyncRequest.status(model);
|
|
|
+ // console.log(res);
|
|
|
if (res && res.code === 0) {
|
|
|
this.loading = false;
|
|
|
this.$notify.success({
|
|
@@ -393,11 +446,151 @@ export default {
|
|
|
console.log("取消");
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ // 饿了么的
|
|
|
+ loadAll() {
|
|
|
+ return [
|
|
|
+ { value: "三全鲜食(北新泾店)", address: "长宁区新渔路144号" },
|
|
|
+ {
|
|
|
+ value: "Hot honey 首尔炸鸡(仙霞路)",
|
|
|
+ address: "上海市长宁区淞虹路661号",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "新旺角茶餐厅",
|
|
|
+ address: "上海市普陀区真北路988号创邑金沙谷6号楼113",
|
|
|
+ },
|
|
|
+ { value: "泷千家(天山西路店)", address: "天山西路438号" },
|
|
|
+ {
|
|
|
+ value: "胖仙女纸杯蛋糕(上海凌空店)",
|
|
|
+ address: "上海市长宁区金钟路968号1幢18号楼一层商铺18-101",
|
|
|
+ },
|
|
|
+ { value: "贡茶", address: "上海市长宁区金钟路633号" },
|
|
|
+ {
|
|
|
+ value: "豪大大香鸡排超级奶爸",
|
|
|
+ address: "上海市嘉定区曹安公路曹安路1685号",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "茶芝兰(奶茶,手抓饼)",
|
|
|
+ address: "上海市普陀区同普路1435号",
|
|
|
+ },
|
|
|
+ { value: "十二泷町", address: "上海市北翟路1444弄81号B幢-107" },
|
|
|
+ { value: "星移浓缩咖啡", address: "上海市嘉定区新郁路817号" },
|
|
|
+ { value: "阿姨奶茶/豪大大", address: "嘉定区曹安路1611号" },
|
|
|
+ { value: "新麦甜四季甜品炸鸡", address: "嘉定区曹安公路2383弄55号" },
|
|
|
+ {
|
|
|
+ value: "Monica摩托主题咖啡店",
|
|
|
+ address: "嘉定区江桥镇曹安公路2409号1F,2383弄62号1F",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "浮生若茶(凌空soho店)",
|
|
|
+ address: "上海长宁区金钟路968号9号楼地下一层",
|
|
|
+ },
|
|
|
+ { value: "NONO JUICE 鲜榨果汁", address: "上海市长宁区天山西路119号" },
|
|
|
+ { value: "CoCo都可(北新泾店)", address: "上海市长宁区仙霞西路" },
|
|
|
+ {
|
|
|
+ value: "快乐柠檬(神州智慧店)",
|
|
|
+ address: "上海市长宁区天山西路567号1层R117号店铺",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "Merci Paul cafe",
|
|
|
+ address: "上海市普陀区光复西路丹巴路28弄6号楼819",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "猫山王(西郊百联店)",
|
|
|
+ address: "上海市长宁区仙霞西路88号第一层G05-F01-1-306",
|
|
|
+ },
|
|
|
+ { value: "枪会山", address: "上海市普陀区棕榈路" },
|
|
|
+ { value: "纵食", address: "元丰天山花园(东门) 双流路267号" },
|
|
|
+ { value: "钱记", address: "上海市长宁区天山西路" },
|
|
|
+ { value: "壹杯加", address: "上海市长宁区通协路" },
|
|
|
+ {
|
|
|
+ value: "唦哇嘀咖",
|
|
|
+ address: "上海市长宁区新泾镇金钟路999号2幢(B幢)第01层第1-02A单元",
|
|
|
+ },
|
|
|
+ { value: "爱茜茜里(西郊百联)", address: "长宁区仙霞西路88号1305室" },
|
|
|
+ {
|
|
|
+ value: "爱茜茜里(近铁广场)",
|
|
|
+ address:
|
|
|
+ "上海市普陀区真北路818号近铁城市广场北区地下二楼N-B2-O2-C商铺",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "鲜果榨汁(金沙江路和美广店)",
|
|
|
+ address: "普陀区金沙江路2239号金沙和美广场B1-10-6",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "开心丽果(缤谷店)",
|
|
|
+ address: "上海市长宁区威宁路天山路341号",
|
|
|
+ },
|
|
|
+ { value: "超级鸡车(丰庄路店)", address: "上海市嘉定区丰庄路240号" },
|
|
|
+ { value: "妙生活果园(北新泾店)", address: "长宁区新渔路144号" },
|
|
|
+ { value: "香宜度麻辣香锅", address: "长宁区淞虹路148号" },
|
|
|
+ {
|
|
|
+ value: "凡仔汉堡(老真北路店)",
|
|
|
+ address: "上海市普陀区老真北路160号",
|
|
|
+ },
|
|
|
+ { value: "港式小铺", address: "上海市长宁区金钟路968号15楼15-105室" },
|
|
|
+ { value: "蜀香源麻辣香锅(剑河路店)", address: "剑河路443-1" },
|
|
|
+ { value: "北京饺子馆", address: "长宁区北新泾街道天山西路490-1号" },
|
|
|
+ {
|
|
|
+ value: "饭典*新简餐(凌空SOHO店)",
|
|
|
+ address: "上海市长宁区金钟路968号9号楼地下一层9-83室",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "焦耳·川式快餐(金钟路店)",
|
|
|
+ address: "上海市金钟路633号地下一层甲部",
|
|
|
+ },
|
|
|
+ { value: "动力鸡车", address: "长宁区仙霞西路299弄3号101B" },
|
|
|
+ { value: "浏阳蒸菜", address: "天山西路430号" },
|
|
|
+ { value: "四海游龙(天山西路店)", address: "上海市长宁区天山西路" },
|
|
|
+ {
|
|
|
+ value: "樱花食堂(凌空店)",
|
|
|
+ address: "上海市长宁区金钟路968号15楼15-105室",
|
|
|
+ },
|
|
|
+ { value: "壹分米客家传统调制米粉(天山店)", address: "天山西路428号" },
|
|
|
+ {
|
|
|
+ value: "福荣祥烧腊(平溪路店)",
|
|
|
+ address: "上海市长宁区协和路福泉路255弄57-73号",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "速记黄焖鸡米饭",
|
|
|
+ address: "上海市长宁区北新泾街道金钟路180号1层01号摊位",
|
|
|
+ },
|
|
|
+ { value: "红辣椒麻辣烫", address: "上海市长宁区天山西路492号" },
|
|
|
+ {
|
|
|
+ value: "(小杨生煎)西郊百联餐厅",
|
|
|
+ address: "长宁区仙霞西路88号百联2楼",
|
|
|
+ },
|
|
|
+ { value: "阳阳麻辣烫", address: "天山西路389号" },
|
|
|
+ {
|
|
|
+ value: "南拳妈妈龙虾盖浇饭",
|
|
|
+ address: "普陀区金沙江路1699号鑫乐惠美食广场A13",
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ },
|
|
|
+ querySearchAsync(queryString, cb) {
|
|
|
+ var restaurants = this.restaurants;
|
|
|
+ var results = queryString
|
|
|
+ ? restaurants.filter(this.createStateFilter(queryString))
|
|
|
+ : restaurants;
|
|
|
+
|
|
|
+ clearTimeout(this.timeout);
|
|
|
+ this.timeout = setTimeout(() => {
|
|
|
+ cb(results);
|
|
|
+ }, 3000 * Math.random());
|
|
|
+ },
|
|
|
+ createStateFilter(queryString) {
|
|
|
+ return (state) => {
|
|
|
+ return (
|
|
|
+ state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
|
|
+ );
|
|
|
+ };
|
|
|
+ },
|
|
|
+ handleSelect(item) {
|
|
|
+ console.log(item);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
- <style lang="scss" scoped>
|
|
|
-.storeGoods {
|
|
|
-}
|
|
|
+<style lang="scss" scoped>
|
|
|
</style>
|
|
|
|