Browse Source

1Merge branch 'master' of http://8.140.253.224:3000/root/school-manage

# Conflicts:
#	vue.config.js
master
tianyi 4 weeks ago
parent
commit
44d2e13476
  1. 6
      src/api/app.js
  2. 12
      src/views/app/business/bus/addEdit.vue
  3. 2
      src/views/app/business/bus/bus.vue
  4. 218
      src/views/app/business/logiticsCompany/addEdit.vue
  5. 435
      src/views/app/business/logiticsCompany/dictManage.vue
  6. 249
      src/views/app/business/logiticsCompany/logiticsCompany.vue
  7. 1068
      src/views/app/business/logiticsCompany/transferStation.vue
  8. 2
      vue.config.js

6
src/api/app.js

@ -357,7 +357,7 @@ export const delSeckill = (params) => {
} }
// 秒杀商品列表 // 秒杀商品列表
export const seckillProductList = (params) => { export const seckillProductList = (params) => {
return getRequest('/mall/admin/seckillGroup/product/page', params) return postBodyRequest('/mall/admin/seckillGroup/product/page', params)
} }
// 新增秒杀商品 // 新增秒杀商品
export const addSeckillProduct = (params) => { export const addSeckillProduct = (params) => {
@ -375,6 +375,10 @@ export const delSeckillProduct = (params) => {
export const upSeckillProduct = (params) => { export const upSeckillProduct = (params) => {
return postRequest('/mall/admin/seckillGroup/product/up', params) return postRequest('/mall/admin/seckillGroup/product/up', params)
} }
// 秒杀商品下架
export const downSeckillProduct = (params) => {
return postRequest('/mall/admin/seckillGroup/product/down', params)
}
export const getShopData = (params) => { export const getShopData = (params) => {
return getRequest('/app/shop/getByCondition', params) return getRequest('/app/shop/getByCondition', params)

12
src/views/app/business/bus/addEdit.vue

@ -43,6 +43,16 @@
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row :gutter="32">
<Col span="24">
<FormItem label="规则类型">
<RadioGroup v-model="form.ruleType">
<Radio label="1">其他</Radio>
<Radio label="0">邀新奖励</Radio>
</RadioGroup>
</FormItem>
</Col>
</Row>
<Row :gutter="32"> <Row :gutter="32">
<Col span="24"> <Col span="24">
<FormItem label="优惠金额"> <FormItem label="优惠金额">
@ -133,7 +143,7 @@
validStartTime:'', // validStartTime:'', //
validEndTime:'', // validEndTime:'', //
validDays:'', // validDays:'', //
ruleType:1,
issuerType:1, //1-2- issuerType:1, //1-2-
issuerId:0, //ID 0- issuerId:0, //ID 0-
status:1, //0-/1- status:1, //0-/1-

2
src/views/app/business/bus/bus.vue

@ -267,7 +267,7 @@
} }
}, },
{ {
title: "领取人次", title: "总数量",
key: "totalCount", key: "totalCount",
width: 150, width: 150,
}, },

218
src/views/app/business/logiticsCompany/addEdit.vue

@ -1,75 +1,26 @@
<template> <template>
<div class="company-edit"> <div class="company-edit">
<!-- Drawer抽屉 -->
<Drawer :title="title" v-model="visible" width="500" draggable :mask-closable="type == '0'"> <Drawer :title="title" v-model="visible" width="500" draggable :mask-closable="type == '0'">
<div :style="{ maxHeight: maxHeight }" class="drawer-content"> <div :style="{ maxHeight: maxHeight }" class="drawer-content">
<div class="drawer-header">
<div style="margin-right: 16px">优惠券配置</div>
</div>
<Form ref="form" :model="form" :rules="formValidate" label-position="top"> <Form ref="form" :model="form" :rules="formValidate" label-position="top">
<Row :gutter="32"> <FormItem label="分类名称" prop="categoryName">
<Col span="24"> <Input v-model="form.categoryName" placeholder="请输入分类名称" />
<FormItem label="优惠券名称" prop="name">
<Input v-model="form.name" />
</FormItem> </FormItem>
</Col> <FormItem label="分类图标">
</Row> <Input v-model="form.categoryIcon" placeholder="请输入图标地址" />
<Row :gutter="32">
<Col span="24">
<FormItem label="发券总数" prop="totalCount">
<Input v-model="form.totalCount" />
</FormItem> </FormItem>
</Col> <FormItem label="排序">
</Row> <InputNumber v-model="form.sort" :min="0" style="width: 100%" />
<Row :gutter="32">
<Col span="24">
<FormItem label="适用范围" prop="applyScene">
<RadioGroup v-model="form.applyScene">
<Radio label="0">全部</Radio>
<Radio label="1">外卖/买饭</Radio>
<Radio label="2">快递/跑腿</Radio>
<Radio label="3">二手物品交易</Radio>
</RadioGroup>
</FormItem> </FormItem>
</Col> <FormItem label="状态">
</Row> <RadioGroup v-model="form.status">
<Row :gutter="32"> <Radio :label="1">启用</Radio>
<Col span="24"> <Radio :label="0">禁用</Radio>
<FormItem label="使用门槛">
<RadioGroup v-model="form.type">
<Radio label="2">无门槛</Radio>
<Radio label="1"><Input v-model='form.minAmount' style="width: 50px;"></Input >使</Radio>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
</Col> <FormItem label="备注">
</Row> <Input v-model="form.remark" type="textarea" :rows="4" placeholder="请输入备注" />
<Row :gutter="32">
<Col span="24">
<FormItem label="优惠金额">
<Input v-model='form.discountAmount'></Input>
</FormItem>
</Col>
</Row>
<Row :gutter="32">
<Col span="24">
<FormItem label="每人限领数量">
<Input v-model='form.limitPerUser'></Input>
</FormItem> </FormItem>
</Col>
</Row>
<Row :gutter="32">
<Col span="24">
<FormItem label="有效期">
<RadioGroup v-model="form.validType" vertical>
<Radio label="1">固定日期</Radio>
<DatePicker @on-change="changeDate" v-if="form.validType == '1'" type="daterange" split-panels placeholder="选择起始时间" style="width: 200px"></DatePicker>
<Radio label="2">领券后<Input v-model='form.validDays' style="width: 50px;"></Input ></Radio>
</RadioGroup>
</FormItem>
</Col>
</Row>
</Form> </Form>
</div> </div>
<div class="drawer-footer br" v-show="type != '0'"> <div class="drawer-footer br" v-show="type != '0'">
@ -81,20 +32,10 @@
</template> </template>
<script> <script>
import { import { addSeckill, editSeckill } from "@/api/app";
addCoupon,
editCoupon export default {
} from "@/api/app"; name: "seckill-category-edit",
import dict from "@/views/my-components/hiver/dict";
import uploadPicInput from "@/views/my-components/hiver/upload-pic-input";
import regionTreeChoose from "@/views/my-components/hiver/region-tree-choose";
export default {
name: "company",
components: {
dict,
uploadPicInput,
regionTreeChoose
},
props: { props: {
value: { value: {
type: Boolean, type: Boolean,
@ -102,6 +43,7 @@
}, },
data: { data: {
type: Object, type: Object,
default: () => ({}),
}, },
type: { type: {
type: String, type: String,
@ -110,122 +52,61 @@
}, },
data() { data() {
return { return {
menkan:'',
xianzhi:'',
youxiao:'',
roleList: [],
visible: this.value, visible: this.value,
title: "", title: "",
data: [],
passColor: "",
submitLoading: false, submitLoading: false,
maxHeight: 510, maxHeight: 510,
form: { form: this.defaultForm(),
name: '', //
applyScene:'', //0-1-/2-/3-
type:'', //1-2-
minAmount:'', //使
discountAmount:'', //
totalCount:'', //
limitPerUser:1, //
validType:'', //1-2-
validStartTime:'', //
validEndTime:'', //
validDays:'', //
issuerType:1, //1-2-
issuerId:0, //ID 0-
status:1, //0-/1-
regionId:JSON.parse(this.getStore("user")).departmentId, //id
},
formValidate: { formValidate: {
// categoryName: [
name: [{ {
required: true,
message: "请输入优惠券名称",
trigger: "change"
}, ],
contacts: [{
required: true, required: true,
message: "请输入联系人", message: "请输入分类名称",
trigger: "change" trigger: "blur",
}, ], },
mobile: [{ ],
required: true,
message: "请输入手机号",
trigger: "change"
}, ],
}, },
}; };
}, },
methods: { methods: {
init() { defaultForm() {
return {
}, categoryName: "",
changeDate(v){ categoryIcon: "",
console.log(v) regionId: JSON.parse(this.getStore("user")).departmentId,
this.form.validStartTime = v[0] sort: 0,
this.form.validEndTime = v[1] status: 1,
remark: "",
};
}, },
submit() { submit() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (!valid) return;
if (this.type == "1") {
//
this.submitLoading = true; this.submitLoading = true;
editCoupon(this.form).then((res) => { const request = this.type == "1" ? editSeckill : addSeckill;
request(this.form).then((res) => {
this.submitLoading = false; this.submitLoading = false;
if (res.success) { if (res.success) {
this.$Message.success("操作成功"); this.$Message.success("操作成功");
this.$emit("on-submit", true); this.$emit("on-submit", true);
this.visible = false; this.visible = false;
} }
}); }).catch(() => {
} else {
// 1
this.submitLoading = true;
addCoupon(this.form).then((res) => {
this.submitLoading = false; this.submitLoading = false;
if (res.success) {
this.$Message.success("操作成功");
this.$emit("on-submit", true);
this.visible = false;
}
}); });
}
}
}); });
}, },
setCurrentValue(value) { setCurrentValue(value) {
if (value === this.visible) { if (value === this.visible) return;
return; this.maxHeight = Number(document.documentElement.clientHeight - 121) + "px";
} this.title = this.type == "1" ? "编辑秒杀团分类" : this.type == "2" ? "新增秒杀团分类" : "秒杀团分类详情";
if (this.type == "1") { this.form = this.type == "1" || this.type == "0"
this.title = "编辑优惠券信息"; ? Object.assign(this.defaultForm(), JSON.parse(JSON.stringify(this.data || {})))
this.maxHeight = : this.defaultForm();
Number(document.documentElement.clientHeight - 121) + "px";
} else if (this.type == "2") {
this.title = "新增优惠券";
this.maxHeight =
Number(document.documentElement.clientHeight - 121) + "px";
} else {
this.title = "优惠券详情";
this.maxHeight = "100%";
}
//
this.$refs.form.resetFields();
if (this.type == "0" || this.type == "1") {
//
let data = this.data;
//
this.form = data;
this.form.applyScene = JSON.stringify(this.form.applyScene)
this.form.type = JSON.stringify(this.form.type)
this.form.validType = JSON.stringify(this.form.validType)
console.log('优惠券',this.form)
}
this.visible = value; this.visible = value;
this.$nextTick(() => {
if (this.$refs.form) this.$refs.form.resetFields();
});
}, },
}, },
watch: { watch: {
@ -236,12 +117,9 @@
this.$emit("input", value); this.$emit("input", value);
}, },
}, },
mounted() { };
this.init();
},
};
</script> </script>
<style lang="less"> <style lang="less">
@import "@/styles/drawer-common.less"; @import "@/styles/drawer-common.less";
</style> </style>

435
src/views/app/business/logiticsCompany/dictManage.vue

@ -1,75 +1,110 @@
<template> <template>
<div class="search"> <div class="search">
<Row align="middle" justify="space-between" class="operation">
<div>
<Button @click="findAllRecords" type="primary" icon="md-add">新增商品</Button> <Button @click="findAllRecords" type="primary" icon="md-add">新增商品</Button>
</div>
</Row>
<Card> <Card>
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" ref="table" <Row v-show="openSearch" @keydown.enter.native="handleSearch">
sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table> <Form ref="searchForm" :model="searchForm" inline :label-width="80">
<FormItem label="商品名称" prop="keywords">
<Input type="text" v-model="searchForm.keywords" clearable placeholder="请输入商品名称" style="width: 220px" />
</FormItem>
<FormItem class="br">
<Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button>
<Button @click="handleReset">重置</Button>
</FormItem>
</Form>
</Row>
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" ref="table"></Table>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNum" :total="total" :page-size="searchForm.pageSize" <Page :current="searchForm.pageNum" :total="total" :page-size="searchForm.pageSize"
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
size="small" show-total show-elevator show-sizer></Page> size="small" show-total show-elevator show-sizer></Page>
</Row> </Row>
</Card> </Card>
<Modal :title="商品维护" v-model="tranVisiable" :mask-closable="false" :scrollabele="true" :width="1000">
<transfer-station v-if="tranVisiable" ref="dialog"></transfer-station> <Modal title="新增秒杀团商品" v-model="tranVisible" :mask-closable="false" :width="1100">
<div slot="footer" v-show=tranVisiable> <transfer-station v-if="tranVisible" ref="dialog" @on-submit="handleProductAdded"></transfer-station>
<Button type="text" @click="tranVisiable = false">关闭</Button> <div slot="footer">
<Button type="text" @click="tranVisible = false">关闭</Button>
</div> </div>
</Modal> </Modal>
</div>
<Modal title="编辑秒杀团商品" v-model="editVisible" :mask-closable="false" :width="560">
<Form ref="editForm" :model="editForm" :label-width="110">
<FormItem label="商品名称">
<Input v-model="editForm.productName" disabled />
</FormItem>
<FormItem label="秒杀价格">
<InputNumber v-model="editForm.seckillPrice" :min="0.01" style="width: 100%" />
</FormItem>
<FormItem label="秒杀库存">
<InputNumber v-model="editForm.totalStock" :min="0" style="width: 100%" />
</FormItem>
<FormItem label="限购数量">
<InputNumber v-model="editForm.limitNum" :min="0" style="width: 100%" />
</FormItem>
<FormItem label="排序">
<InputNumber v-model="editForm.orderFiled" :min="0" style="width: 100%" />
</FormItem>
<FormItem label="状态">
<RadioGroup v-model="editForm.status">
<Radio :label="1">上架</Radio>
<Radio :label="0">下架</Radio>
</RadioGroup>
</FormItem>
<FormItem label="活动时间">
<DatePicker type="datetimerange" format="yyyy-MM-dd HH:mm:ss" transfer
:value="editDateRange" @on-change="changeEditDate" style="width: 100%" placeholder="不选表示长期有效" />
</FormItem>
<FormItem label="备注">
<Input v-model="editForm.remark" type="textarea" :rows="3" />
</FormItem>
</Form>
<div slot="footer">
<Button @click="editVisible = false">取消</Button>
<Button type="primary" :loading="submitLoading" @click="submitEdit">保存</Button>
</div>
</Modal>
</div>
</template> </template>
<script> <script>
import { import {
addLogisticsStation, seckillProductList,
updateLogisticsStation, editSeckillProduct,
deleteLogisticsStation, delSeckillProduct,
getLogisticsStationPageList upSeckillProduct,
} from "@/api/app"; downSeckillProduct,
import uploadPicInput from "@/views/my-components/hiver/upload-pic-input"; } from "@/api/app";
import transferStation from "@/views/app/business/lineManage/transferStation.vue"; import transferStation from "./transferStation.vue";
import {
shortcuts export default {
} from "@/libs/shortcuts"; name: "seckill-product-manage",
export default {
name: "logisticsAddress",
components: { components: {
uploadPicInput, transferStation,
transferStation
}, },
data() { data() {
return { return {
exportTitle: "商品", category: {},
tableSize: "default", tableSize: "default",
showType: "0", tranVisible: false,
tranVisiable:false, editVisible: false,
stationModalVisible: false, openSearch: true,
openSearch: true, // loading: false,
openTip: true, // submitLoading: false,
loading: true, // total: 0,
modalType: 0, // data: [],
modalVisible: false, //
modalTitle: "", //
searchForm: { searchForm: {
categoryId: "",
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
circuitId:"", keywords: "",
stationName:"" },
}, editForm: {},
selectDate: null, editDateRange: [],
options: {
shortcuts: shortcuts,
},
form: {
circuitId:'',
stationName:'',
freightRules:'',
landingFeeRules:'',
deliveryFeeRules:''
},
submitLoading: false, //
selectList: [], //
columns: [ columns: [
{ {
type: "index", type: "index",
@ -78,238 +113,188 @@
fixed: "left", fixed: "left",
}, },
{ {
title: "线路id", title: "图片",
key: "circuitId", key: "productPicture",
minWidth: 125, width: 100,
sortable: true, render: (h, params) => {
fixed: "left", return h("img", {
attrs: { src: params.row.productPicture },
style: {
width: "70px",
height: "55px",
objectFit: "contain",
},
});
},
}, },
{ {
title: "商品名称", title: "商品名称",
key: "stationName", key: "productName",
minWidth: 125, minWidth: 180,
sortable: true,
fixed: "left",
}, },
{ {
title: "运费规则", title: "商家",
key: "freightRules", key: "shopName",
minWidth: 125, minWidth: 150,
sortable: true,
fixed: "left",
}, },
{ {
title: "落地费规则", title: "原价",
key: "landingFeeRules", key: "originalPrice",
minWidth: 125, width: 100,
sortable: true,
fixed: "left",
}, },
{ {
title: "送货费规则", title: "秒杀价",
key: "deliveryFeeRules", key: "seckillPrice",
minWidth: 125, width: 100,
sortable: true, },
fixed: "left", {
title: "库存",
minWidth: 150,
render: (h, params) => {
return h("span", `${params.row.soldStock || 0}/${params.row.totalStock || 0}`);
},
},
{
title: "状态",
width: 90,
render: (h, params) => h("span", params.row.status == 1 ? "上架" : "下架"),
},
{
title: "排序",
key: "orderFiled",
width: 90,
}, },
{ {
title: "操作", title: "操作",
key: "action", key: "action",
width: 200, width: 210,
align: "center", align: "center",
fixed: "right", fixed: "right",
render: (h, params) => { render: (h, params) => {
return h("div", [ return h("div", [
h( h("a", { on: { click: () => this.edit(params.row) } }, "编辑"),
"a", { h("Divider", { props: { type: "vertical" } }),
on: { h("a", { on: { click: () => this.upDown(params.row) } }, params.row.status == 1 ? "下架" : "上架"),
click: () => { h("Divider", { props: { type: "vertical" } }),
this.edit(params.row); h("a", { on: { click: () => this.remove(params.row) } }, "删除"),
},
},
},
"编辑"
),
h("Divider", {
props: {
type: "vertical",
},
}),
h(
"a", {
on: {
click: () => {
this.edit(params.row);
},
},
},
"下架"
),
h("Divider", {
props: {
type: "vertical",
},
}),
h(
"a", {
on: {
click: () => {
this.remove(params.row);
},
},
},
"删除"
),
]); ]);
}, },
}, },
], ],
data: [], //
total: 0, //
rechargeWorkerId: "",
}; };
}, },
methods: { methods: {
init() { init(category) {
// this.getDataList(); this.category = category || {};
}, this.searchForm.categoryId = this.category.id;
initRecharge(data) { this.searchForm.pageNum = 1;
//data
console.log(data);
this.searchForm.circuitId = data.id;
this.getDataList(); this.getDataList();
}, },
changePage(v) { changePage(v) {
this.searchForm.pageNum = v; this.searchForm.pageNum = v;
this.getDataList(); this.getDataList();
this.clearSelectAll();
}, },
exportCustomData() { changePageSize(v) {
this.loading = true; this.searchForm.pageSize = v;
if(this.showType == 1){ // this.searchForm.pageNum = 1;
addLogisticsStation(this.form).then((res) => {
this.loading = false;
if (res.code == 200) {
this.$Message.success("保存成功");
this.getDataList(); this.getDataList();
} },
}); handleSearch() {
}else if(this.showType == 2){ // this.searchForm.pageNum = 1;
updateLogisticsStation(this.form).then((res) => {
this.loading = false;
if (res.code == 200) {
this.$Message.success("保存成功");
this.getDataList(); this.getDataList();
}
});
}
}, },
changePageSize(v) { handleReset() {
this.searchForm.pageSize = v; this.searchForm.keywords = "";
this.searchForm.pageNum = 1;
this.getDataList(); this.getDataList();
}, },
remove(v) { getDataList() {
this.$Modal.confirm({ this.loading = true;
title: "确认删除", seckillProductList(this.searchForm).then((res) => {
content: "您确认要删除该商品吗?", this.loading = false;
loading: true,
onOk: () => {
deleteLogisticsStation({
id: v.id
}).then((res) => {
this.$Modal.remove();
if (res.success) { if (res.success) {
this.clearSelectAll(); this.data = res.result.records || [];
this.$Message.success("删除成功"); this.total = res.result.total || 0;
this.getDataList();
} }
}).catch(() => {
this.loading = false;
}); });
}, },
findAllRecords() {
this.tranVisible = true;
this.$nextTick(() => {
this.$refs.dialog.init(this.category);
}); });
}, },
changeSort(e) { handleProductAdded() {
this.searchForm.sort = e.key; this.tranVisible = false;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList(); this.getDataList();
}, },
findAllRecords(v) { changeEditDate(v) {
this.tranVisiable = true; this.editDateRange = v;
console.log(v) this.editForm.startTime = v && v[0] ? v[0] : null;
this.$nextTick(() => { this.editForm.endTime = v && v[1] ? v[1] : null;
this.$refs.dialog.initRecharges(v);
});
},
clearSelectAll() {
this.$refs.table.selectAll(false);
}, },
changeSelect(e) { edit(v) {
this.selectList = e; this.editForm = {
id: v.id,
productId: v.productId,
categoryId: v.categoryId,
productName: v.productName,
seckillPrice: Number(v.seckillPrice || 0),
totalStock: Number(v.totalStock || 0),
limitNum: v.limitNum == null ? 0 : Number(v.limitNum),
orderFiled: Number(v.orderFiled || 0),
status: v.status,
startTime: v.startTime,
endTime: v.endTime,
remark: v.remark || "",
};
this.editDateRange = v.startTime && v.endTime ? [v.startTime, v.endTime] : [];
this.editVisible = true;
}, },
selectDateRange(v) { submitEdit() {
if (v) { if (!this.editForm.seckillPrice || this.editForm.seckillPrice <= 0) {
this.searchForm.startDate = v[0]; this.$Message.warning("秒杀价格必须大于0");
this.searchForm.endDate = v[1]; return;
} }
}, this.submitLoading = true;
addStation() { editSeckillProduct(this.editForm).then((res) => {
this.form = { this.submitLoading = false;
circuitId:'', if (res.success) {
stationName:'', this.$Message.success("保存成功");
freightRules:'', this.editVisible = false;
landingFeeRules:'', this.getDataList();
deliveryFeeRules:''
} }
this.showType = "1"; }).catch(() => {
this.form.circuitId = this.searchForm.circuitId this.submitLoading = false;
this.stationModalVisible = true });
}, },
edit(v) { upDown(v) {
// null"" const request = v.status == 1 ? downSeckillProduct : upSeckillProduct;
for (let attr in v) { request({ id: v.id }).then((res) => {
if (v[attr] == null) { if (res.success) {
v[attr] = ""; this.$Message.success("操作成功");
} this.getDataList();
} }
let str = JSON.stringify(v);
let data = JSON.parse(str);
this.form = data;
this.showType = "2";
this.stationModalVisible = true;
},
changeTableSize(v) {
this.tableSize = v;
},
exportData() {
this.$refs.table.exportCsv({
filename: "数据",
}); });
}, },
getDataList(params) { remove(v) {
this.loading = true; this.$Modal.confirm({
// title: "确认删除",
getLogisticsStationPageList(this.searchForm).then((res) => { content: "您确认要删除 " + v.productName + " ?",
debugger; loading: true,
this.loading = false; onOk: () => {
if (res.code == 200) { delSeckillProduct({ id: v.id }).then((res) => {
this.data = res.result.records; this.$Modal.remove();
this.total = res.result.total; if (res.success) {
if (this.data && this.data.length == 0 && this.searchForm.pageNum > 1) { this.$Message.success("删除成功");
this.searchForm.pageNum -= 1;
this.getDataList(); this.getDataList();
} }
}
}); });
}, },
});
}, },
mounted() {
//this.init();
}, },
}; };
</script> </script>
<style lang="less">
//@import "@/styles/table-common.less";
</style>

249
src/views/app/business/logiticsCompany/logiticsCompany.vue

@ -1,37 +1,14 @@
<style lang="less"> <style lang="less">
@import "@/styles/table-common.less"; @import "@/styles/table-common.less";
@import "./logiticsCompany.less"; @import "./logiticsCompany.less";
</style> </style>
<template> <template>
<div class="search"> <div class="search">
<Card> <Card>
<!-- <Row v-show="openSearch" @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="100">
<FormItem label="物流公司名称" prop="companyName">
<Input type="text" v-model="searchForm.companyName" clearable placeholder="请输入公司名称"
style="width: 200px" />
</FormItem>
<FormItem label="联系人" prop="contacts">
<Input type="text" v-model="searchForm.contacts" clearable placeholder="请输入联系人"
style="width: 200px" />
</FormItem>
<FormItem label="手机号" prop="mobile">
<Input type="text" v-model="searchForm.mobile" clearable placeholder="请输入手机号"
style="width: 200px" />
</FormItem>
<FormItem style="margin-left: -35px" class="br">
<Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button>
<Button @click="handleReset">重置</Button>
<a class="drop-down" @click="dropDown">
{{ dropDownContent }}
<Icon :type="dropDownIcon"></Icon>
</a>
</FormItem>
</Form>
</Row> -->
<Row align="middle" justify="space-between" class="operation"> <Row align="middle" justify="space-between" class="operation">
<div> <div>
<Button @click="add" type="primary" icon="md-add">添加</Button> <Button @click="add" type="primary" icon="md-add">添加分类</Button>
</div> </div>
<div class="icons"> <div class="icons">
<Tooltip content="刷新" placement="top" transfer> <Tooltip content="刷新" placement="top" transfer>
@ -49,47 +26,41 @@
</Tooltip> </Tooltip>
</div> </div>
</Row> </Row>
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" sortable="custom" <Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" ref="table"></Table>
ref="table"></Table>
<!-- <Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize"
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
size="small" show-total show-elevator show-sizer></Page>
</Row> -->
</Card> </Card>
<Modal :title="商品列表" v-model="Visiable" :mask-closable="false" :scrollabele="true" :width="1000">
<goodsList v-if="Visiable" ref="goodsPage"></goodsList> <Modal :title="goodsModalTitle" v-model="visibleGoods" :mask-closable="false" :width="1100">
<div slot="footer" v-show=Visiable> <goodsList v-if="visibleGoods" ref="goodsPage" @on-submit="getDataList"></goodsList>
<Button type="text" @click="Visiable = false">关闭</Button> <div slot="footer">
<Button type="text" @click="visibleGoods = false">关闭</Button>
</div> </div>
</Modal> </Modal>
<addEdit :data="form" :type="showType" v-model="showCompany" @on-submit="getDataList" />
<addEdit :data="form" :type="showType" v-model="showCategory" @on-submit="getDataList" />
</div> </div>
</template> </template>
<script> <script>
import { import { seckillList, delSeckill } from "@/api/app";
seckillList, import addEdit from "./addEdit.vue";
addSeckill, import goodsList from "./dictManage.vue";
editSeckill,
delSeckill, export default {
} from "@/api/app";
import addEdit from "./addEdit.vue";
import goodsList from "./dictManage.vue";
export default {
name: "logiticsCompany", name: "logiticsCompany",
components: { components: {
addEdit, addEdit,
goodsList goodsList,
}, },
data() { data() {
return { return {
tableSize: "default", tableSize: "default",
showCompany: false, showCategory: false,
showType: "0", showType: "0",
loading: true, loading: false,
drop: false,
form: {}, form: {},
data: [],
visibleGoods: false,
goodsModalTitle: "秒杀团商品",
columns: [ columns: [
{ {
type: "index", type: "index",
@ -100,189 +71,106 @@
{ {
title: "分类名称", title: "分类名称",
key: "categoryName", key: "categoryName",
minWidth: 125, minWidth: 160,
fixed: "left", fixed: "left",
}, },
{ {
title: "分类图标", title: "分类图标",
key: "categoryIcon", key: "categoryIcon",
minWidth: 120, minWidth: 160,
render: (h, params) => {
if (!params.row.categoryIcon) return h("span", "-");
return h("img", {
attrs: { src: params.row.categoryIcon },
style: {
width: "60px",
height: "40px",
objectFit: "contain",
},
});
},
}, },
{ {
title: "排序", title: "排序",
key: "sort", key: "sort",
minWidth: 120, minWidth: 100,
}, },
{ {
title: "状态", title: "状态",
key: "status", key: "status",
minWidth: 120, minWidth: 100,
render: (h, params) => { render: (h, params) => h("span", params.row.status == 1 ? "启用" : "禁用"),
let re = ""
if (params.row.position == '0') {
re = "禁用";
} else if (params.row.position == '1') {
re = "启用";
}
return h(
"div",
re
);
}
}, },
{ {
title: "备注", title: "备注",
key: "remark", key: "remark",
minWidth: 120, minWidth: 180,
}, },
{ {
title: "操作", title: "操作",
key: "action", key: "action",
width: 170, width: 230,
align: "center", align: "center",
fixed: "right", fixed: "right",
render: (h, params) => { render: (h, params) => {
return h("div", [ return h("div", [
h( h("a", { on: { click: () => this.edit(params.row) } }, "编辑"),
"a", { h("Divider", { props: { type: "vertical" } }),
on: { h("a", { on: { click: () => this.remove(params.row) } }, "删除"),
click: () => { h("Divider", { props: { type: "vertical" } }),
this.edit(params.row); h("a", { on: { click: () => this.openGoods(params.row) } }, "管理商品"),
},
},
},
"编辑"
),
h(
"a", {
on: {
click: () => {
this.remove(params.row);
},
},
},
"删除"
),
h("Divider", {
props: {
type: "vertical",
},
}),
h(
"a", {
on: {
click: () => {
this.goodsList(params.row);
},
},
},
"管理商品"
),
]); ]);
}, },
}, },
], ],
data: [],
Visiable: false,
}; };
}, },
methods: { methods: {
init() { init() {
this.getDataList(); this.getDataList();
}, },
findAllRecord(v) {
this.Visiable = true;
console.log(v)
this.$nextTick(() => {
this.$refs.dialog.initRecharge(v);
});
},
changePage(v) {
this.getDataList();
this.clearSelectAll();
},
changeTableSize(v) { changeTableSize(v) {
this.tableSize = v; this.tableSize = v;
}, },
changePageSize(v) { getRegionId() {
this.getDataList(); return JSON.parse(this.getStore("user")).departmentId;
}, },
getDataList() { getDataList() {
//
this.loading = true; this.loading = true;
seckillList({ seckillList({
regionId: JSON.parse(this.getStore("user")).departmentId regionId: this.getRegionId(),
}).then((res) => { }).then((res) => {
this.loading = false; this.loading = false;
if (res.success) { if (res.success) {
this.data = res.result.records; this.data = Array.isArray(res.result) ? res.result : (res.result && res.result.records) || [];
} }
}).catch(() => {
this.loading = false;
}); });
}, },
goodsList(v){
this.Visiable = true;
this.$nextTick(() => {
this.$refs.goodsPage.init(v);
});
},
handleSearch() {
this.getDataList();
},
handleReset() {
this.$refs.searchForm.resetFields();
//
this.getDataList();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order == "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
showDetail(v) {
// null""
for (let attr in v) {
if (v[attr] == null) {
v[attr] = "";
}
}
let str = JSON.stringify(v);
let data = JSON.parse(str);
this.form = data;
this.showType = "0";
this.showCompany = true;
},
add() { add() {
this.form = {
regionId: this.getRegionId(),
sort: 0,
status: 1,
};
this.showType = "2"; this.showType = "2";
this.showCompany = true; this.showCategory = true;
}, },
edit(v) { edit(v) {
// null"" this.form = JSON.parse(JSON.stringify(v));
for (let attr in v) {
if (v[attr] == null) {
v[attr] = "";
}
}
let str = JSON.stringify(v);
let data = JSON.parse(str);
this.form = data;
this.showType = "1"; this.showType = "1";
this.showCompany = true; this.showCategory = true;
}, },
remove(v) { remove(v) {
this.$Modal.confirm({ this.$Modal.confirm({
title: "确认删除", title: "确认删除",
content: "您确认要删除公司配置 " + v.companyName + " ?", content: "您确认要删除秒杀团分类 " + v.categoryName + " ?",
loading: true, loading: true,
onOk: () => { onOk: () => {
deleteLogiticsCompany({ delSeckill({ id: v.id }).then((res) => {
ids: v.id
}).then((res) => {
this.$Modal.remove(); this.$Modal.remove();
if (res.success) { if (res.success) {
this.clearSelectAll();
this.$Message.success("删除成功"); this.$Message.success("删除成功");
this.getDataList(); this.getDataList();
} }
@ -290,15 +178,16 @@
}, },
}); });
}, },
dropDown() { openGoods(v) {
this.drop = !this.drop; this.goodsModalTitle = "管理商品 - " + v.categoryName;
this.visibleGoods = true;
this.$nextTick(() => {
this.$refs.goodsPage.init(v);
});
}, },
clearSelectAll() {
this.$refs.table.selectAll(false);
}
}, },
mounted() { mounted() {
this.init(); this.init();
}, },
}; };
</script> </script>

1068
src/views/app/business/logiticsCompany/transferStation.vue

File diff suppressed because it is too large

2
vue.config.js

@ -4,7 +4,7 @@ module.exports = {
publicPath: '/', publicPath: '/',
devServer: { devServer: {
host: '127.0.0.1', host: '127.0.0.1',
port: 8888, port: 8889,
proxy: { proxy: {
'/hiver': { '/hiver': {
// target: 'https://hbkuaishi.com', // 正式1 // target: 'https://hbkuaishi.com', // 正式1

Loading…
Cancel
Save