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. 354
      src/views/app/business/logiticsCompany/addEdit.vue
  5. 601
      src/views/app/business/logiticsCompany/dictManage.vue
  6. 483
      src/views/app/business/logiticsCompany/logiticsCompany.vue
  7. 1332
      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,
}, },

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

@ -1,247 +1,125 @@
<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"> <Form ref="form" :model="form" :rules="formValidate" label-position="top">
<div class="drawer-header"> <FormItem label="分类名称" prop="categoryName">
<div style="margin-right: 16px">优惠券配置</div> <Input v-model="form.categoryName" placeholder="请输入分类名称" />
</div> </FormItem>
<Form ref="form" :model="form" :rules="formValidate" label-position="top"> <FormItem label="分类图标">
<Row :gutter="32"> <Input v-model="form.categoryIcon" placeholder="请输入图标地址" />
<Col span="24"> </FormItem>
<FormItem label="优惠券名称" prop="name"> <FormItem label="排序">
<Input v-model="form.name" /> <InputNumber v-model="form.sort" :min="0" style="width: 100%" />
</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="发券总数" prop="totalCount"> </RadioGroup>
<Input v-model="form.totalCount" /> </FormItem>
</FormItem> <FormItem label="备注">
</Col> <Input v-model="form.remark" type="textarea" :rows="4" placeholder="请输入备注" />
</Row> </FormItem>
<Row :gutter="32"> </Form>
<Col span="24"> </div>
<FormItem label="适用范围" prop="applyScene"> <div class="drawer-footer br" v-show="type != '0'">
<RadioGroup v-model="form.applyScene"> <Button type="primary" :loading="submitLoading" @click="submit">提交</Button>
<Radio label="0">全部</Radio> <Button @click="visible = false">取消</Button>
<Radio label="1">外卖/买饭</Radio> </div>
<Radio label="2">快递/跑腿</Radio> </Drawer>
<Radio label="3">二手物品交易</Radio> </div>
</RadioGroup>
</FormItem>
</Col>
</Row>
<Row :gutter="32">
<Col span="24">
<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>
</FormItem>
</Col>
</Row>
<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>
</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>
</div>
<div class="drawer-footer br" v-show="type != '0'">
<Button type="primary" :loading="submitLoading" @click="submit">提交</Button>
<Button @click="visible = false">取消</Button>
</div>
</Drawer>
</div>
</template> </template>
<script> <script>
import { import { addSeckill, editSeckill } from "@/api/app";
addCoupon,
editCoupon
} from "@/api/app";
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: {
value: {
type: Boolean,
default: false,
},
data: {
type: Object,
},
type: {
type: String,
default: "0",
},
},
data() {
return {
menkan:'',
xianzhi:'',
youxiao:'',
roleList: [],
visible: this.value,
title: "",
data: [],
passColor: "",
submitLoading: false,
maxHeight: 510,
form: {
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: {
//
name: [{
required: true,
message: "请输入优惠券名称",
trigger: "change"
}, ],
contacts: [{
required: true,
message: "请输入联系人",
trigger: "change"
}, ],
mobile: [{
required: true,
message: "请输入手机号",
trigger: "change"
}, ],
},
};
},
methods: {
init() {
}, export default {
changeDate(v){ name: "seckill-category-edit",
console.log(v) props: {
this.form.validStartTime = v[0] value: {
this.form.validEndTime = v[1] type: Boolean,
}, default: false,
submit() { },
this.$refs.form.validate((valid) => { data: {
if (valid) { type: Object,
if (this.type == "1") { default: () => ({}),
// },
this.submitLoading = true; type: {
editCoupon(this.form).then((res) => { type: String,
this.submitLoading = false; default: "0",
if (res.success) { },
this.$Message.success("操作成功"); },
this.$emit("on-submit", true); data() {
this.visible = false; return {
} visible: this.value,
}); title: "",
} else { submitLoading: false,
// 1 maxHeight: 510,
this.submitLoading = true; form: this.defaultForm(),
addCoupon(this.form).then((res) => { formValidate: {
this.submitLoading = false; categoryName: [
if (res.success) { {
this.$Message.success("操作成功"); required: true,
this.$emit("on-submit", true); message: "请输入分类名称",
this.visible = false; trigger: "blur",
} },
}); ],
} },
} };
}); },
}, methods: {
setCurrentValue(value) { defaultForm() {
if (value === this.visible) { return {
return; categoryName: "",
} categoryIcon: "",
if (this.type == "1") { regionId: JSON.parse(this.getStore("user")).departmentId,
this.title = "编辑优惠券信息"; sort: 0,
this.maxHeight = status: 1,
Number(document.documentElement.clientHeight - 121) + "px"; remark: "",
} else if (this.type == "2") { };
this.title = "新增优惠券"; },
this.maxHeight = submit() {
Number(document.documentElement.clientHeight - 121) + "px"; this.$refs.form.validate((valid) => {
} else { if (!valid) return;
this.title = "优惠券详情"; this.submitLoading = true;
this.maxHeight = "100%"; const request = this.type == "1" ? editSeckill : addSeckill;
} request(this.form).then((res) => {
// this.submitLoading = false;
this.$refs.form.resetFields(); if (res.success) {
if (this.type == "0" || this.type == "1") { this.$Message.success("操作成功");
// this.$emit("on-submit", true);
let data = this.data; this.visible = false;
// }
this.form = data; }).catch(() => {
this.form.applyScene = JSON.stringify(this.form.applyScene) this.submitLoading = false;
this.form.type = JSON.stringify(this.form.type) });
this.form.validType = JSON.stringify(this.form.validType) });
console.log('优惠券',this.form) },
} setCurrentValue(value) {
this.visible = value; if (value === this.visible) return;
}, this.maxHeight = Number(document.documentElement.clientHeight - 121) + "px";
}, this.title = this.type == "1" ? "编辑秒杀团分类" : this.type == "2" ? "新增秒杀团分类" : "秒杀团分类详情";
watch: { this.form = this.type == "1" || this.type == "0"
value(val) { ? Object.assign(this.defaultForm(), JSON.parse(JSON.stringify(this.data || {})))
this.setCurrentValue(val); : this.defaultForm();
}, this.visible = value;
visible(value) { this.$nextTick(() => {
this.$emit("input", value); if (this.$refs.form) this.$refs.form.resetFields();
}, });
}, },
mounted() { },
this.init(); watch: {
}, value(val) {
}; this.setCurrentValue(val);
},
visible(value) {
this.$emit("input", value);
},
},
};
</script> </script>
<style lang="less"> <style lang="less">
@import "@/styles/drawer-common.less"; @import "@/styles/drawer-common.less";
</style> </style>

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

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

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

@ -1,304 +1,193 @@
<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"> <Row align="middle" justify="space-between" class="operation">
<Form ref="searchForm" :model="searchForm" inline :label-width="100"> <div>
<FormItem label="物流公司名称" prop="companyName"> <Button @click="add" type="primary" icon="md-add">添加分类</Button>
<Input type="text" v-model="searchForm.companyName" clearable placeholder="请输入公司名称" </div>
style="width: 200px" /> <div class="icons">
</FormItem> <Tooltip content="刷新" placement="top" transfer>
<FormItem label="联系人" prop="contacts"> <Icon type="md-refresh" size="18" class="item" @click="getDataList" />
<Input type="text" v-model="searchForm.contacts" clearable placeholder="请输入联系人" </Tooltip>
style="width: 200px" /> <Tooltip content="表格密度" placement="top" transfer>
</FormItem> <Dropdown @on-click="changeTableSize" trigger="click">
<FormItem label="手机号" prop="mobile"> <Icon type="md-list" size="18" class="item" />
<Input type="text" v-model="searchForm.mobile" clearable placeholder="请输入手机号" <DropdownMenu slot="list">
style="width: 200px" /> <DropdownItem :selected="tableSize == 'default'" name="default">默认</DropdownItem>
</FormItem> <DropdownItem :selected="tableSize == 'large'" name="large">宽松</DropdownItem>
<FormItem style="margin-left: -35px" class="br"> <DropdownItem :selected="tableSize == 'small'" name="small">紧密</DropdownItem>
<Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button> </DropdownMenu>
<Button @click="handleReset">重置</Button> </Dropdown>
<a class="drop-down" @click="dropDown"> </Tooltip>
{{ dropDownContent }} </div>
<Icon :type="dropDownIcon"></Icon> </Row>
</a> <Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" ref="table"></Table>
</FormItem> </Card>
</Form>
</Row> --> <Modal :title="goodsModalTitle" v-model="visibleGoods" :mask-closable="false" :width="1100">
<Row align="middle" justify="space-between" class="operation"> <goodsList v-if="visibleGoods" ref="goodsPage" @on-submit="getDataList"></goodsList>
<div> <div slot="footer">
<Button @click="add" type="primary" icon="md-add">添加</Button> <Button type="text" @click="visibleGoods = false">关闭</Button>
</div> </div>
<div class="icons"> </Modal>
<Tooltip content="刷新" placement="top" transfer>
<Icon type="md-refresh" size="18" class="item" @click="getDataList" /> <addEdit :data="form" :type="showType" v-model="showCategory" @on-submit="getDataList" />
</Tooltip> </div>
<Tooltip content="表格密度" placement="top" transfer>
<Dropdown @on-click="changeTableSize" trigger="click">
<Icon type="md-list" size="18" class="item" />
<DropdownMenu slot="list">
<DropdownItem :selected="tableSize == 'default'" name="default">默认</DropdownItem>
<DropdownItem :selected="tableSize == 'large'" name="large">宽松</DropdownItem>
<DropdownItem :selected="tableSize == 'small'" name="small">紧密</DropdownItem>
</DropdownMenu>
</Dropdown>
</Tooltip>
</div>
</Row>
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" sortable="custom"
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>
<Modal :title="商品列表" v-model="Visiable" :mask-closable="false" :scrollabele="true" :width="1000">
<goodsList v-if="Visiable" ref="goodsPage"></goodsList>
<div slot="footer" v-show=Visiable>
<Button type="text" @click="Visiable = false">关闭</Button>
</div>
</Modal>
<addEdit :data="form" :type="showType" v-model="showCompany" @on-submit="getDataList" />
</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"; name: "logiticsCompany",
import addEdit from "./addEdit.vue"; components: {
import goodsList from "./dictManage.vue"; addEdit,
export default { goodsList,
name: "logiticsCompany", },
components: { data() {
addEdit, return {
goodsList tableSize: "default",
}, showCategory: false,
data() { showType: "0",
return { loading: false,
tableSize: "default", form: {},
showCompany: false, data: [],
showType: "0", visibleGoods: false,
loading: true, goodsModalTitle: "秒杀团商品",
drop: false, columns: [
form: {}, {
columns: [ type: "index",
{ width: 60,
type: "index", align: "center",
width: 60, fixed: "left",
align: "center", },
fixed: "left", {
}, title: "分类名称",
{ key: "categoryName",
title: "分类名称", minWidth: 160,
key: "categoryName", fixed: "left",
minWidth: 125, },
fixed: "left", {
}, title: "分类图标",
{ key: "categoryIcon",
title: "分类图标", minWidth: 160,
key: "categoryIcon", render: (h, params) => {
minWidth: 120, if (!params.row.categoryIcon) return h("span", "-");
}, return h("img", {
{ attrs: { src: params.row.categoryIcon },
title: "排序", style: {
key: "sort", width: "60px",
minWidth: 120, height: "40px",
}, objectFit: "contain",
{ },
title: "状态", });
key: "status", },
minWidth: 120, },
render: (h, params) => { {
let re = "" title: "排序",
if (params.row.position == '0') { key: "sort",
re = "禁用"; minWidth: 100,
} else if (params.row.position == '1') { },
re = "启用"; {
} title: "状态",
return h( key: "status",
"div", minWidth: 100,
re render: (h, params) => h("span", params.row.status == 1 ? "启用" : "禁用"),
); },
} {
}, title: "备注",
{ key: "remark",
title: "备注", minWidth: 180,
key: "remark", },
minWidth: 120, {
}, title: "操作",
{ key: "action",
title: "操作", width: 230,
key: "action", align: "center",
width: 170, fixed: "right",
align: "center", render: (h, params) => {
fixed: "right", return h("div", [
render: (h, params) => { h("a", { on: { click: () => this.edit(params.row) } }, "编辑"),
return h("div", [ h("Divider", { props: { type: "vertical" } }),
h( h("a", { on: { click: () => this.remove(params.row) } }, "删除"),
"a", { h("Divider", { props: { type: "vertical" } }),
on: { h("a", { on: { click: () => this.openGoods(params.row) } }, "管理商品"),
click: () => { ]);
this.edit(params.row); },
}, },
}, ],
}, };
"编辑" },
), methods: {
h( init() {
"a", { this.getDataList();
on: { },
click: () => { changeTableSize(v) {
this.remove(params.row); this.tableSize = v;
}, },
}, getRegionId() {
}, return JSON.parse(this.getStore("user")).departmentId;
"删除" },
), getDataList() {
h("Divider", { this.loading = true;
props: { seckillList({
type: "vertical", regionId: this.getRegionId(),
}, }).then((res) => {
}), this.loading = false;
h( if (res.success) {
"a", { this.data = Array.isArray(res.result) ? res.result : (res.result && res.result.records) || [];
on: { }
click: () => { }).catch(() => {
this.goodsList(params.row); this.loading = false;
}, });
}, },
}, add() {
"管理商品" this.form = {
), regionId: this.getRegionId(),
]); sort: 0,
}, status: 1,
}, };
], this.showType = "2";
data: [], this.showCategory = true;
Visiable: false, },
}; edit(v) {
}, this.form = JSON.parse(JSON.stringify(v));
methods: { this.showType = "1";
init() { this.showCategory = true;
this.getDataList(); },
}, remove(v) {
findAllRecord(v) { this.$Modal.confirm({
this.Visiable = true; title: "确认删除",
console.log(v) content: "您确认要删除秒杀团分类 " + v.categoryName + " ?",
this.$nextTick(() => { loading: true,
this.$refs.dialog.initRecharge(v); onOk: () => {
}); delSeckill({ id: v.id }).then((res) => {
}, this.$Modal.remove();
changePage(v) { if (res.success) {
this.getDataList(); this.$Message.success("删除成功");
this.clearSelectAll(); this.getDataList();
}, }
changeTableSize(v) { });
this.tableSize = v; },
}, });
changePageSize(v) { },
this.getDataList(); openGoods(v) {
}, this.goodsModalTitle = "管理商品 - " + v.categoryName;
getDataList() { this.visibleGoods = true;
// this.$nextTick(() => {
this.loading = true; this.$refs.goodsPage.init(v);
seckillList({ });
regionId: JSON.parse(this.getStore("user")).departmentId },
}).then((res) => { },
this.loading = false; mounted() {
if (res.success) { this.init();
this.data = res.result.records; },
} };
});
},
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() {
this.showType = "2";
this.showCompany = true;
},
edit(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 = "1";
this.showCompany = true;
},
remove(v) {
this.$Modal.confirm({
title: "确认删除",
content: "您确认要删除公司配置 " + v.companyName + " ?",
loading: true,
onOk: () => {
deleteLogiticsCompany({
ids: v.id
}).then((res) => {
this.$Modal.remove();
if (res.success) {
this.clearSelectAll();
this.$Message.success("删除成功");
this.getDataList();
}
});
},
});
},
dropDown() {
this.drop = !this.drop;
},
clearSelectAll() {
this.$refs.table.selectAll(false);
}
},
mounted() {
this.init();
},
};
</script> </script>

1332
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