批量上传、添加注释

master
mabo 2021-07-14 18:00:59 +08:00
parent 0fd4645514
commit 0499a9c237
27 changed files with 226 additions and 1011 deletions

View File

@ -63,7 +63,7 @@ export default {
data() { data() {
return { return {
editor: null, // editor: null, //
data: this.value, // data: '', //
dataEdit: "", // dataEdit: "", //
showHTMLModal: false, // html showHTMLModal: false, // html
full: false, // html full: false, // html
@ -185,12 +185,10 @@ export default {
if (!editor) { if (!editor) {
this.initEditor(); this.initEditor();
} }
if (value && value != this.data) { this.data = value;
this.data = value; editor.txt.html(this.data);
editor.txt.html(this.data); this.$emit("input", this.data);
this.$emit("input", this.data); this.$emit("on-change", this.data);
this.$emit("on-change", this.data);
}
}, },
}, },
watch: { watch: {

View File

@ -11,15 +11,15 @@
:readonly="readonly" :readonly="readonly"
:maxlength="maxlength" :maxlength="maxlength"
> >
<Button slot="append" icon="md-eye"></Button> <Poptip slot="append" transfer trigger="hover" title="图片预览" placement="right" width="350">
<Icon type="md-eye" class="see-icon" />
<div slot="content">
<img :src="currentValue" alt="该资源不存在" style="width: 100%;margin: 0 auto;display: block;" />
<a @click="viewImage=true" style="margin-top:5px;text-align:right;display:block">查看大图</a>
</div>
</Poptip>
</Input> </Input>
<Poptip transfer trigger="hover" title="图片预览" placement="right" width="350">
<Icon type="md-eye" class="see-icon" />
<div slot="content">
<img :src="currentValue" alt="该资源不存在" style="width: 100%;margin: 0 auto;display: block;" />
<a @click="viewImage=true" style="margin-top:5px;text-align:right;display:block">查看大图</a>
</div>
</Poptip>
<Upload <Upload
:action="uploadFileUrl" :action="uploadFileUrl"
:headers="accessToken" :headers="accessToken"
@ -35,7 +35,7 @@
ref="up" ref="up"
class="upload" class="upload"
> >
<Button :loading="loading" :size="size" :disabled="disabled" :icon="icon">上传图片</Button> <Button :loading="loading" :size="size" :disabled="disabled">上传图片</Button>
</Upload> </Upload>
</div> </div>

View File

@ -4,7 +4,7 @@
<Row> <Row>
<Col style=" height: 100%;" span="4"> <Col style=" height: 100%;" span="4">
<Card class="article-category"> <Card class="article-category">
<Tree :data="treeData" @on-select-change="handleSearchChange"></Tree> <Tree :data="treeData" @on-select-change="handleCateChange"></Tree>
</Card> </Card>
</Col> </Col>
<Col span="20"> <Col span="20">
@ -18,9 +18,9 @@
</Form> </Form>
</Row> </Row>
<Row class="operation padding-row"> <Row class="operation padding-row">
<Button @click="add" type="primary" style="">添加</Button> <Button @click="add" type="primary">添加</Button>
</Row> </Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"> <Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-selection-change="changeSelect">
<!-- 页面展示 --> <!-- 页面展示 -->
<template slot="openStatusSlot" slot-scope="scope"> <template slot="openStatusSlot" slot-scope="scope">
<div> <div>
@ -57,7 +57,7 @@
<Input type="number" v-model="form.sort" clearable style="width: 10%" /> <Input type="number" v-model="form.sort" clearable style="width: 10%" />
</FormItem> </FormItem>
<FormItem class="form-item-view-el" label="文章内容" prop="content"> <FormItem class="form-item-view-el" label="文章内容" prop="content">
<editor openXss v-model="form.content"></editor> <editor openXss v-model="form.content"></editor>
</FormItem> </FormItem>
<FormItem label="是否展示" prop="openStatus"> <FormItem label="是否展示" prop="openStatus">
<i-switch size="large" v-model="form.openStatus" :true-value="open" :false-value="close"> <i-switch size="large" v-model="form.openStatus" :true-value="open" :false-value="close">
@ -154,28 +154,7 @@ export default {
title: "是否显示", title: "是否显示",
key: "openStatus", key: "openStatus",
width: 100, width: 100,
slot: "openStatusSlot", slot: "openStatusSlot"
/*render: (h, params) => {
if (params.row.openStatus == "CLOSE") {
return h("div", [
h("Badge", {
props: {
status: "error",
text: "隐藏",
},
}),
]);
} else if (params.row.openStatus == "OPEN") {
return h("div", [
h("Badge", {
props: {
status: "success",
text: "展示",
},
}),
]);
}
},*/
}, },
{ {
title: "排序", title: "排序",
@ -266,11 +245,13 @@ export default {
}, },
}, },
methods: { methods: {
//
init() { init() {
this.getDataList(); this.getDataList();
this.getAllList(0); this.getAllList(0);
}, },
handleSearchChange(data) { //
handleCateChange(data) {
let { value, title } = data[0]; let { value, title } = data[0];
this.list.push({ this.list.push({
value, value,
@ -279,7 +260,7 @@ export default {
this.searchForm.categoryId = value; this.searchForm.categoryId = value;
this.searchTreeValue = title; this.searchTreeValue = title;
}, },
// //
changeSwitch(v) { changeSwitch(v) {
let params = { let params = {
status: v.openStatus, status: v.openStatus,
@ -290,6 +271,7 @@ export default {
} }
}); });
}, },
//
handleCheckChange(data) { handleCheckChange(data) {
let value = ""; let value = "";
let title = ""; let title = "";
@ -307,36 +289,33 @@ export default {
this.form.categoryId = value; this.form.categoryId = value;
this.treeValue = title; this.treeValue = title;
}, },
//
changePage(v) { changePage(v) {
this.searchForm.pageNumber = v; this.searchForm.pageNumber = v;
this.getDataList(); this.getDataList();
this.clearSelectAll(); this.clearSelectAll();
}, },
//
changePageSize(v) { changePageSize(v) {
this.searchForm.pageSize = v; this.searchForm.pageSize = v;
this.getDataList(); this.getDataList();
}, },
//
handleSearch() { handleSearch() {
this.searchForm.pageNumber = 1; this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10; this.searchForm.pageSize = 10;
this.getDataList(); this.getDataList();
}, },
changeSort(e) { //
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() { clearSelectAll() {
this.$refs.table.selectAll(false); this.$refs.table.selectAll(false);
}, },
//
changeSelect(e) { changeSelect(e) {
this.selectList = e; this.selectList = e;
this.selectCount = e.length; this.selectCount = e.length;
}, },
//
getAllList(parent_id) { getAllList(parent_id) {
this.loading = true; this.loading = true;
getArticleCategory(parent_id).then((res) => { getArticleCategory(parent_id).then((res) => {
@ -353,6 +332,7 @@ export default {
} }
}); });
}, },
//
getTree(tree = []) { getTree(tree = []) {
let arr = []; let arr = [];
if (!!tree && tree.length !== 0) { if (!!tree && tree.length !== 0) {
@ -369,6 +349,7 @@ export default {
} }
return arr; return arr;
}, },
//
getDataList(val) { getDataList(val) {
if (val) this.form = {}; if (val) this.form = {};
this.loading = true; this.loading = true;
@ -387,7 +368,7 @@ export default {
this.total = this.data.length; this.total = this.data.length;
this.loading = false; this.loading = false;
}, },
//
handleSubmit() { handleSubmit() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
@ -417,16 +398,26 @@ export default {
} }
}); });
}, },
// modal
add() { add() {
this.modalType = 0; this.modalType = 0;
this.modalTitle = "添加文章"; this.modalTitle = "添加文章";
this.treeValue = '';
this.form = {
content:''
};
this.$refs.form.resetFields(); this.$refs.form.resetFields();
delete this.form.id; delete this.form.id;
this.modalVisible = true; this.modalVisible = true;
}, },
// modal
edit(data) { edit(data) {
this.modalType = 1; this.modalType = 1;
this.modalTitle = "编辑文章"; this.modalTitle = "编辑文章";
this.treeValue = '';
this.form = {
content:''
};
this.$refs.form.resetFields(); this.$refs.form.resetFields();
seeArticle(data.id).then((res) => { seeArticle(data.id).then((res) => {

View File

@ -145,7 +145,7 @@ export default {
if (this.id) { if (this.id) {
this.getCoupon() this.getCoupon()
} else { } else {
this.$refs.form.resetFiles() this.$refs.form.resetFields()
} }
} }
}, },

View File

@ -13,8 +13,6 @@
:data="data" :data="data"
ref="table" ref="table"
sortable="custom" sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
> >
<!-- 商品栏目格式化 --> <!-- 商品栏目格式化 -->
<template slot="imageSlot" slot-scope="scope"> <template slot="imageSlot" slot-scope="scope">
@ -53,8 +51,6 @@
:data="data" :data="data"
ref="table" ref="table"
sortable="custom" sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
> >
<!-- 商品栏目格式化 --> <!-- 商品栏目格式化 -->
<template slot="imageSlot" slot-scope="scope"> <template slot="imageSlot" slot-scope="scope">
@ -99,7 +95,7 @@
/> />
</FormItem> </FormItem>
<FormItem label="图片" prop="resource"> <FormItem label="图片" prop="resource">
<Input v-model="form.resource" clearable style="width: 100%" /> <upload-pic-input v-model="form.resource" style="width: 100%"></upload-pic-input>
</FormItem> </FormItem>
<FormItem label="类型" prop="type"> <FormItem label="类型" prop="type">
<radio-group v-model="form.type" type="button"> <radio-group v-model="form.type" type="button">
@ -119,15 +115,16 @@
</template> </template>
<script> <script>
import * as API_Setting from "@/api/setting"; import * as API_Setting from "@/api/setting";
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
export default { export default {
components: {
uploadPicInput,
},
data() { data() {
return { return {
modalVisible: false, // modalVisible: false, //
modalTitle: "", // modalTitle: "", //
loading: true, // loading: true, //
selectList: [], //
selectCount: 0, //
modalType: 0, // modalType: 0, //
submitLoading: false, // submitLoading: false, //
form: { form: {
@ -250,11 +247,6 @@ export default {
this.searchForm.pageSize = v; this.searchForm.pageSize = v;
this.getDataList(); this.getDataList();
}, },
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
this.getDataList();
},
//tab //tab
handleClickType(v) { handleClickType(v) {
this.searchForm.pageNumber = 1; // this.searchForm.pageNumber = 1; //
@ -281,15 +273,12 @@ export default {
}); });
this.loading = false; this.loading = false;
}, },
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
// //
add() { add() {
this.form.type = this.searchForm.type; this.form.type = this.searchForm.type;
this.modalVisible = true; this.modalVisible = true;
this.modalType = 0; this.modalType = 0;
this.$refs.form.resetFields()
this.modalTitle = "添加验证码源"; this.modalTitle = "添加验证码源";
}, },
// //

View File

@ -35,12 +35,6 @@ export const otherRouter = {
name: "message_index", name: "message_index",
component: () => import("@/views/message/message.vue") component: () => import("@/views/message/message.vue")
}, },
{
path: "stock-goods",
title: "店铺端商品库存告警列表",
name: "stock-goods",
component: () => import("@/views/goods/goods-seller/goodsStock.vue")
},
{ {
path: "goods-operation", path: "goods-operation",
title: "添加商品", title: "添加商品",

View File

@ -24,7 +24,6 @@
<Avatar :src="userInfo.storeLogo" style="background: #fff;margin-left: 10px;"></Avatar> <Avatar :src="userInfo.storeLogo" style="background: #fff;margin-left: 10px;"></Avatar>
</div> </div>
<DropdownMenu slot="list"> <DropdownMenu slot="list">
<!-- <DropdownItem name="ownSpace">{{ $t('userCenter') }}</DropdownItem> -->
<DropdownItem name="changePass">{{ $t('changePass') }}</DropdownItem> <DropdownItem name="changePass">{{ $t('changePass') }}</DropdownItem>
<DropdownItem name="loginOut" divided>{{ $t('logout') }}</DropdownItem> <DropdownItem name="loginOut" divided>{{ $t('logout') }}</DropdownItem>
</DropdownMenu> </DropdownMenu>
@ -53,9 +52,6 @@
<script> <script>
import shrinkableMenu from "./main-components/shrinkable-menu/shrinkable-menu.vue"; import shrinkableMenu from "./main-components/shrinkable-menu/shrinkable-menu.vue";
import tagsPageOpened from "./main-components/tags-page-opened.vue"; import tagsPageOpened from "./main-components/tags-page-opened.vue";
import breadcrumbNav from "./main-components/breadcrumb-nav.vue";
import fullScreen from "./main-components/fullscreen.vue";
import messageTip from "./main-components/message-tip.vue";
import circleLoading from "@/views/my-components/lili/circle-loading.vue"; import circleLoading from "@/views/my-components/lili/circle-loading.vue";
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import util from "@/libs/util.js"; import util from "@/libs/util.js";
@ -64,10 +60,7 @@ export default {
components: { components: {
shrinkableMenu, shrinkableMenu,
tagsPageOpened, tagsPageOpened,
breadcrumbNav, circleLoading
fullScreen,
messageTip,
circleLoading,
}, },
data() { data() {
return { return {

View File

@ -27,7 +27,7 @@
type="primary" type="primary"
style="width: 100px;margin-right:5px" style="width: 100px;margin-right:5px"
:loading="savePassLoading" :loading="savePassLoading"
@click="saveEditPass" @click="editPassword"
>保存</Button> >保存</Button>
<Button @click="cancelEditPass"></Button> <Button @click="cancelEditPass"></Button>
</FormItem> </FormItem>
@ -61,6 +61,7 @@ export default {
rePass: "" // rePass: "" //
}, },
strength: "", // strength: "", //
//
passwordValidate: { passwordValidate: {
oldPass: [ oldPass: [
{ {
@ -101,10 +102,12 @@ export default {
}; };
}, },
methods: { methods: {
//
changeInputPass(v, grade, strength) { changeInputPass(v, grade, strength) {
this.strength = strength; this.strength = strength;
}, },
saveEditPass() { //
editPassword() {
let params = { let params = {
password: this.md5(this.editPasswordForm.oldPass), password: this.md5(this.editPasswordForm.oldPass),
newPassword: this.md5(this.editPasswordForm.newPassword) newPassword: this.md5(this.editPasswordForm.newPassword)
@ -131,6 +134,7 @@ export default {
} }
}); });
}, },
//
cancelEditPass() { cancelEditPass() {
this.$store.commit("removeTag", "change_pass"); this.$store.commit("removeTag", "change_pass");
localStorage.storeOpenedList = JSON.stringify( localStorage.storeOpenedList = JSON.stringify(
@ -147,11 +151,9 @@ export default {
name: lastPageName name: lastPageName
}); });
} }
}, }
mounted() {}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.change-pass { .change-pass {
&-btn-box { &-btn-box {

View File

@ -6,19 +6,13 @@
<Form-item label="商品名称" prop="goodsName"> <Form-item label="商品名称" prop="goodsName">
<Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px"/> <Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px"/>
</Form-item> </Form-item>
<!-- <Form-item label="店铺名称">
<Select v-model="searchForm.shopId" placeholder="请选择" @on-query-change="searchChange" filterable clearable style="width: 200px">
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{ item.storeName }}</Option>
</Select>
</Form-item> -->
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button> <Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form> </Form>
</Row> </Row>
<Row class="operation padding-row"> <Row class="operation padding-row">
<Button @click="add" type="primary">添加</Button> <Button @click="add" type="primary">添加</Button>
<!-- <Button @click="add" type="default">批量删除</Button>-->
</Row> </Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"> <Table :loading="loading" border :columns="columns" :data="data" ref="table" @on-selection-change="changeSelect">
<!-- 商品栏目格式化 --> <!-- 商品栏目格式化 -->
<template slot="goodsSlot" slot-scope="{row}"> <template slot="goodsSlot" slot-scope="{row}">
<div style="margin-top: 5px;height: 70px; display: flex;"> <div style="margin-top: 5px;height: 70px; display: flex;">
@ -92,9 +86,6 @@ export default {
submitLoading: false, // submitLoading: false, //
shopList:[], // shopList:[], //
loading: true, // loading: true, //
drop: false,
dropDownContent: "展开",
dropDownIcon: "ios-arrow-down",
searchForm: { // searchForm: { //
pageNumber: 1, // pageNumber: 1, //
pageSize: 10, // pageSize: 10, //
@ -115,7 +106,7 @@ export default {
trigger: "change" trigger: "change"
}], }],
}, },
columns: [ // columns: [ //
{ {
type: "selection", type: "selection",
width: 60, width: 60,
@ -188,30 +179,29 @@ export default {
}; };
}, },
methods: { methods: {
init() { init() { //
this.getDataList(); this.getDataList();
// this.getShopList()
}, },
//
selectedGoodsData(v){ selectedGoodsData(v){
this.modalVisible = true this.modalVisible = true
this.form.commission = 1 this.form.commission = 1
this.modalTitle = "保存分销商品" this.modalTitle = "保存分销商品"
this.skuId = v[0].id this.skuId = v[0].id
//this.data.unshift(v[0])
}, },
// modal
add(){ add(){
this.$refs.liliDialog.flag = true;
this.$refs.liliDialog.flag = true;
this.$refs.liliDialog.goodsFlag = true; this.$refs.liliDialog.goodsFlag = true;
this.$refs.liliDialog.singleGoods(); this.$refs.liliDialog.singleGoods();
}, },
//
changePage(v) { changePage(v) {
this.searchForm.pageNumber = v; this.searchForm.pageNumber = v;
this.getDataList(); this.getDataList();
this.clearSelectAll(); this.$refs.table.selectAll(false);
}, },
//
handleSubmit(){ handleSubmit(){
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
@ -225,28 +215,18 @@ export default {
} }
}) })
}, },
//
changePageSize(v) { changePageSize(v) {
this.searchForm.pageSize = v; this.searchForm.pageSize = v;
this.getDataList(); this.getDataList();
}, },
//
handleSearch() { handleSearch() {
this.searchForm.pageNumber = 1; this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10; this.searchForm.pageSize = 10;
this.getDataList(); this.getDataList();
}, },
//
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
getDataList() { getDataList() {
this.loading = true; this.loading = true;
// //
@ -260,6 +240,7 @@ export default {
this.total = this.data.length; this.total = this.data.length;
this.loading = false; this.loading = false;
}, },
//
remove(v) { remove(v) {
this.$Modal.confirm({ this.$Modal.confirm({
title: "确认删除", title: "确认删除",
@ -278,6 +259,7 @@ export default {
} }
}); });
}, },
//
getShopList (val) { getShopList (val) {
const params = { const params = {
pageNumber:1, pageNumber:1,

View File

@ -1,19 +1,17 @@
<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="70" @keydown.enter.native="handleSearch" class="search-form">
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form"> <Form-item label="订单编号" prop="orderSn">
<Form-item label="订单编号" prop="orderSn"> <Input type="text" v-model="searchForm.orderSn" placeholder="请输入订单编号" clearable style="width: 200px" />
<Input type="text" v-model="searchForm.orderSn" placeholder="请输入订单编号" clearable style="width: 200px" /> </Form-item>
</Form-item> <Form-item label="订单时间">
<Form-item label="订单时间"> <DatePicker type="daterange" v-model="timeRange" format="yyyy-MM-dd" placeholder="选择时间" style="width: 210px"></DatePicker>
<DatePicker type="daterange" v-model="timeRange" format="yyyy-MM-dd" placeholder="选择时间" style="width: 210px"></DatePicker> </Form-item>
</Form-item> <Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button> </Form>
</Form>
</Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"></Table> <Table class="mt_10" :loading="loading" border :columns="columns" :data="data" ref="table"></Table>
<Row type="flex" justify="end" class="page"> <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" <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> show-total show-elevator show-sizer></Page>
@ -35,8 +33,6 @@ export default {
timeRange: [], // timeRange: [], //
orderStatusList, // orderStatusList, //
distributionId: this.$route.query.id, // id distributionId: this.$route.query.id, // id
openSearch: true, //
openTip: true, //
loading: true, // loading: true, //
searchForm: { searchForm: {
// //
@ -133,23 +129,26 @@ export default {
}; };
}, },
methods: { methods: {
init() { init() { //
this.getDataList(); this.getDataList();
}, },
//
changePage(v) { changePage(v) {
this.searchForm.pageNumber = v; this.searchForm.pageNumber = v;
this.getDataList(); this.getDataList();
}, },
//
changePageSize(v) { changePageSize(v) {
this.searchForm.pageSize = v; this.searchForm.pageSize = v;
this.getDataList(); this.getDataList();
}, },
//
handleSearch() { handleSearch() {
this.searchForm.pageNumber = 1; this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10; this.searchForm.pageSize = 10;
this.getDataList(); this.getDataList();
}, },
//
getDataList() { getDataList() {
this.searchForm.distributionId = this.distributionId; this.searchForm.distributionId = this.distributionId;
this.loading = true; this.loading = true;

View File

@ -126,13 +126,16 @@ export default {
template: "action", template: "action",
} }
], ],
//
tableData: [] tableData: []
}; };
}, },
methods: { methods: {
init() { //
init() {
this.getAllList(); this.getAllList();
}, },
//
refresh() { refresh() {
this.loading = true; this.loading = true;
let that = this; let that = this;
@ -152,6 +155,7 @@ export default {
this.formAdd.parentId = v.id; this.formAdd.parentId = v.id;
this.modalVisible = true; this.modalVisible = true;
}, },
//
edit(v) { edit(v) {
this.modalType = 1; this.modalType = 1;
this.modalTitle = "编辑"; this.modalTitle = "编辑";
@ -209,6 +213,7 @@ export default {
} }
}); });
}, },
//
remove(v) { remove(v) {
this.$Modal.confirm({ this.$Modal.confirm({
title: "确认删除", title: "确认删除",
@ -227,6 +232,7 @@ export default {
} }
}); });
}, },
//
getAllList() { getAllList() {
this.loading = true; this.loading = true;
API_Goods.getShopGoodsLabelList(this.searchForm).then((res) => { API_Goods.getShopGoodsLabelList(this.searchForm).then((res) => {

View File

@ -1,57 +1,56 @@
<template> <template>
<div class="search"> <div class="search">
<Card> <Card>
<Row v-show="openSearch" @keydown.enter.native="handleSearch"> <Form
<Form ref="searchForm"
ref="searchForm" :model="searchForm"
:model="searchForm" inline
inline :label-width="70"
:label-width="70" class="search-form mb_10"
class="search-form" @keydown.enter.native="handleSearch"
> >
<Form-item label="商品名称" prop="goodsName"> <Form-item label="商品名称" prop="goodsName">
<Input
type="text"
v-model="searchForm.goodsName"
placeholder="请输入商品名称"
clearable
style="width: 200px"
/>
</Form-item>
<span v-if="drop">
<Form-item label="状态" prop="status">
<Select
v-model="searchForm.marketEnable"
placeholder="请选择"
clearable
style="width: 200px"
>
<Option value="DOWN">下架</Option>
<Option value="UPPER">上架</Option>
</Select>
</Form-item>
<Form-item label="商品编号" prop="sn">
<Input <Input
type="text" type="text"
v-model="searchForm.goodsName" v-model="searchForm.sn"
placeholder="请输入商品名称" placeholder="商品编号"
clearable clearable
style="width: 200px" style="width: 200px"
/> />
</Form-item> </Form-item>
<span v-if="drop"> </span>
<Form-item label="状态" prop="status"> <Form-item style="margin-left: -35px" class="br">
<Select <Button @click="handleSearch" type="primary" icon="ios-search"
v-model="searchForm.marketEnable" >搜索</Button
placeholder="请选择" >
clearable <Button @click="handleReset"></Button>
style="width: 200px" <a class="drop-down" @click="dropDown">
> {{ dropDownContent }}
<Option value="DOWN">下架</Option> <Icon :type="dropDownIcon"></Icon>
<Option value="UPPER">上架</Option> </a>
</Select> </Form-item>
</Form-item> </Form>
<Form-item label="商品编号" prop="sn">
<Input
type="text"
v-model="searchForm.sn"
placeholder="商品编号"
clearable
style="width: 200px"
/>
</Form-item>
</span>
<Form-item 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>
</Form-item>
</Form>
</Row>
<Table <Table
:loading="loading" :loading="loading"
border border
@ -198,13 +197,14 @@ export default {
}; };
}, },
methods: { methods: {
init() { init() { //
this.getDataList(); this.getDataList();
}, },
// //
editGoods(v) { editGoods(v) {
this.$router.push({ name: "goods-template-operation-edit", query: { draftId: v.id } }) this.$router.push({ name: "goods-template-operation-edit", query: { draftId: v.id } })
}, },
//
removeDraft (id) { removeDraft (id) {
let showType = "模版"; let showType = "模版";
this.$Modal.confirm({ this.$Modal.confirm({
@ -222,19 +222,23 @@ export default {
}, },
}); });
}, },
//
changePage(v) { changePage(v) {
this.searchForm.pageNumber = v; this.searchForm.pageNumber = v;
this.getDataList(); this.getDataList();
}, },
//
changePageSize(v) { changePageSize(v) {
this.searchForm.pageSize = v; this.searchForm.pageSize = v;
this.getDataList(); this.getDataList();
}, },
//
handleSearch() { handleSearch() {
this.searchForm.pageNumber = 1; this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10; this.searchForm.pageSize = 10;
this.getDataList(); this.getDataList();
}, },
//
handleReset() { handleReset() {
this.$refs.searchForm.resetFields(); this.$refs.searchForm.resetFields();
this.searchForm.pageNumber = 1; this.searchForm.pageNumber = 1;
@ -242,6 +246,7 @@ export default {
// //
this.getDataList(); this.getDataList();
}, },
//
dropDown() { dropDown() {
if (this.drop) { if (this.drop) {
this.dropDownContent = "展开"; this.dropDownContent = "展开";
@ -252,6 +257,7 @@ export default {
} }
this.drop = !this.drop; this.drop = !this.drop;
}, },
//
getDataList() { getDataList() {
this.loading = true; this.loading = true;
// //

View File

@ -64,7 +64,6 @@
</template> </template>
</Table> </Table>
<Row type="flex" justify="end" class="page"> <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" <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> show-total show-elevator show-sizer></Page>
@ -123,7 +122,7 @@ export default {
return { return {
id: "", //id id: "", //id
loading: true, // loading: true, //
shipTemplateForm: {}, shipTemplateForm: {}, //
shipTemplateModal: false, // shipTemplateModal: false, //
logisticsTemplate: [], // logisticsTemplate: [], //
updateStockModalVisible: false, // updateStockModalVisible: false, //
@ -382,12 +381,14 @@ export default {
}; };
}, },
methods: { methods: {
init() { init() { //
this.getDataList(); this.getDataList();
}, },
//
addGoods() { addGoods() {
this.$router.push({ name: "goods-operation" }); this.$router.push({ name: "goods-operation" });
}, },
//
editGoods(v) { editGoods(v) {
this.$router.push({ name: "goods-operation-edit", query: { id: v.id } }); this.$router.push({ name: "goods-operation-edit", query: { id: v.id } });
}, },
@ -437,20 +438,24 @@ export default {
} }
}); });
}, },
//
changePage(v) { changePage(v) {
this.searchForm.pageNumber = v; this.searchForm.pageNumber = v;
this.getDataList(); this.getDataList();
this.clearSelectAll(); this.clearSelectAll();
}, },
//
changePageSize(v) { changePageSize(v) {
this.searchForm.pageSize = v; this.searchForm.pageSize = v;
this.getDataList(); this.getDataList();
}, },
//
handleSearch() { handleSearch() {
this.searchForm.pageNumber = 1; this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10; this.searchForm.pageSize = 10;
this.getDataList(); this.getDataList();
}, },
//
handleReset() { handleReset() {
this.searchForm = {}; this.searchForm = {};
this.searchForm.pageNumber = 1; this.searchForm.pageNumber = 1;
@ -458,24 +463,17 @@ export default {
// //
this.getDataList(); this.getDataList();
}, },
changeSort(e) { //
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() { clearSelectAll() {
this.$refs.table.selectAll(false); this.$refs.table.selectAll(false);
}, },
//
changeSelect(e) { changeSelect(e) {
this.selectList = e; this.selectList = e;
this.selectCount = e.length; this.selectCount = e.length;
}, },
// //
saveShipTemplate() { saveShipTemplate() {
this.$Modal.confirm({ this.$Modal.confirm({
title: "确认设置物流模板", title: "确认设置物流模板",
content: content:

View File

@ -37,6 +37,7 @@ export default {
}; };
}, },
methods: { methods: {
//
getFirstData (item) { getFirstData (item) {
this.firstData = item; this.firstData = item;
this.activestep = 1; this.activestep = 1;
@ -54,7 +55,6 @@ export default {
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "./addGoods.scss"; @import "./addGoods.scss";
</style> </style>

View File

@ -108,10 +108,8 @@ export default {
goodsType: '', goodsType: '',
/** 1级分类列表*/ /** 1级分类列表*/
categoryListLevel1: [], categoryListLevel1: [],
/** 2级分类列表*/ /** 2级分类列表*/
categoryListLevel2: [], categoryListLevel2: [],
/** 3级分类列表*/ /** 3级分类列表*/
categoryListLevel3: [], categoryListLevel3: [],
} }

View File

@ -59,36 +59,33 @@
<Input type="text" v-model="baseInfoForm.cost" placeholder="市场价格" clearable style="width: 260px"/> <Input type="text" v-model="baseInfoForm.cost" placeholder="市场价格" clearable style="width: 260px"/>
</FormItem> </FormItem>
<FormItem class="form-item-view-el required" label="商品图片" prop="goodsGalleryFiles"> <FormItem class="form-item-view-el required" label="商品图片" prop="goodsGalleryFiles">
<vuedraggable <div style="display:flex;flex-wrap:flex-start;">
:list="baseInfoForm.goodsGalleryFiles" <vuedraggable
:animation="200" :list="baseInfoForm.goodsGalleryFiles"
style="display:inline-block;" :animation="200"
ghost-class="thumb-ghost" >
> <div class="demo-upload-list" v-for="(item, __index) in baseInfoForm.goodsGalleryFiles" :key="__index">
<div class="demo-upload-list" v-for="(item, __index) in baseInfoForm.goodsGalleryFiles" :key="__index"> <template>
<template v-if="item.status === 'finished'"> <img :src="item.url"/>
<img :src="item.url"/> <div class="demo-upload-list-cover">
<div class="demo-upload-list-cover"> <div>
<div> <Icon type="md-search" size="30" @click.native="handleViewGoodsPicture(item.url)"></Icon>
<Icon type="ios-eye-outline" size="30" @click.native="handleViewGoodsPicture(item.url)"></Icon> <Icon type="md-trash" size="30" @click.native="handleRemoveGoodsPicture(item)"></Icon>
<Icon type="ios-trash-outline" size="30" @click.native="handleRemoveGoodsPicture(item)"></Icon> </div>
</div> </div>
</div> </template>
</template> </div>
<template v-else> </vuedraggable>
<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress> <Upload ref="upload" :show-upload-list="false"
</template> :on-success="handleSuccessGoodsPicture" :format="['jpg', 'jpeg', 'png']"
</div> :on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize"
</vuedraggable> :before-upload="handleBeforeUploadGoodsPicture" multiple type="drag" :action="uploadFileUrl"
<Upload ref="upload" :show-upload-list="false" :default-file-list="baseInfoForm.goodsGalleryFiles" :headers="accessToken" style="margin-left:10px">
:on-success="handleSuccessGoodsPicture" :format="['jpg', 'jpeg', 'png']" <div style="width: 148px; height: 148px; line-height: 148px">
:on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize" <Icon type="md-add" size="20"></Icon>
:before-upload="handleBeforeUploadGoodsPicture" multiple type="drag" :action="uploadFileUrl" </div>
:headers="accessToken" style="display: inline-block;margin-left:10px;"> </Upload>
<div style="width: 80px; height: 80px; line-height: 80px"> </div>
<Icon type="ios-camera" size="20"></Icon>
</div>
</Upload>
<Modal title="View Image" v-model="goodsPictureVisible"> <Modal title="View Image" v-model="goodsPictureVisible">
<img :src="previewGoodsPicture" v-if="goodsPictureVisible" style="width: 100%"/> <img :src="previewGoodsPicture" v-if="goodsPictureVisible" style="width: 100%"/>
</Modal> </Modal>
@ -98,7 +95,7 @@
<Panel name="1"> <Panel name="1">
规格名称 规格名称
<div slot="content" class="sku-item-content"> <div slot="content" class="sku-item-content">
<Form :model="skuForm" @submit.native.prevent> <Form>
<div class="sku-item" v-for="(item, $index) in skuInfo" :key="$index"> <div class="sku-item" v-for="(item, $index) in skuInfo" :key="$index">
<Card :bordered="true"> <Card :bordered="true">
<FormItem label="规格名:" class="sku-item-content-name"> <FormItem label="规格名:" class="sku-item-content-name">
@ -113,7 +110,7 @@
<FormItem label="规格值:" prop="sku"> <FormItem label="规格值:" prop="sku">
<!--规格值文本列表--> <!--规格值文本列表-->
<div v-for="(val, index) in item.spec_values" :key="index" <div v-for="(val, index) in item.spec_values" :key="index"
style="padding: 0px 20px 10px 0px; float: left"> style="padding: 0px 20px 10px 0px; float: left">
<div> <div>
<AutoComplete style="width: 150px; float: left" v-model="val.value" <AutoComplete style="width: 150px; float: left" v-model="val.value"
:maxlength="30" placeholder="请输入规格值名称" :maxlength="30" placeholder="请输入规格值名称"
@ -170,24 +167,21 @@
</div> </div>
<Divider/> <Divider/>
<vuedraggable <vuedraggable
:list="baseInfoForm.goodsGalleryFiles" :list="selectedSku.images"
:animation="200" :animation="200"
style="display:inline-block;" style="display:inline-block;"
> >
<div class="sku-upload-list" v-for="(img, __index) in selectedSku.images" :key="__index"> <div class="sku-upload-list" v-for="(img, __index) in selectedSku.images" :key="__index">
<template v-if="img.status === 'finished'"> <template>
<img :src="img.url"/> <img :src="img.url"/>
<div class="sku-upload-list-cover"> <div class="sku-upload-list-cover">
<Icon type="ios-eye-outline" @click="handleView(img.url)"></Icon> <Icon type="md-search" @click="handleView(img.url)"></Icon>
<Icon type="ios-trash-outline" @click="handleRemove(img, __index)"></Icon> <Icon type="md-trash" @click="handleRemove(img, __index)"></Icon>
</div> </div>
</template> </template>
<template v-else>
<Progress v-if="img.showProgress" :percent="img.percentage" hide-info></Progress>
</template>
</div> </div>
</vuedraggable> </vuedraggable>
<Upload ref="uploadSku" :show-upload-list="false" :default-file-list="row.images" <Upload ref="uploadSku" :show-upload-list="false"
:on-success="handleSuccess" :format="['jpg', 'jpeg', 'png']" :on-success="handleSuccess" :format="['jpg', 'jpeg', 'png']"
:on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize" :on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize"
:before-upload="handleBeforeUpload" multiple type="drag" :action="uploadFileUrl" :before-upload="handleBeforeUpload" multiple type="drag" :action="uploadFileUrl"
@ -425,28 +419,20 @@ export default {
/** 商品分类中文名 */ /** 商品分类中文名 */
categoryName: [] categoryName: []
}, },
/** 表单数据*/
skuForm: {},
/** 表格头 */ /** 表格头 */
skuTableColumn: [], skuTableColumn: [],
/** 表格数据 */ /** 表格数据 */
skuTableData: [], skuTableData: [],
/** 默认的规格参数 */ /** 默认的规格参数 */
skuData: [], skuData: [],
/** 默认的规格值 */ /** 默认的规格值 */
skuVals: [], skuVals: [],
// //
skuVal: [], skuVal: [],
//
open_panel: [1, 2], open_panel: [1, 2],
/** 要提交的规格数据*/ /** 要提交的规格数据*/
skuInfo: [], skuInfo: [],
/** 规格图片 */
images: [],
/** 物流模板 **/ /** 物流模板 **/
logisticsTemplate: [], logisticsTemplate: [],
@ -491,12 +477,11 @@ export default {
}, },
/** 品牌列表 */ /** 品牌列表 */
brandList: [], brandList: [],
collapseVal: [],
/** 店铺分类列表 */ /** 店铺分类列表 */
shopCategory: [], shopCategory: [],
/** 商品单位列表 */ /** 商品单位列表 */
goodsUnitList: [], goodsUnitList: [],
ignoreColumn: [ ignoreColumn: [ //
"_index", "_index",
"_rowKey", "_rowKey",
"sn", "sn",
@ -506,8 +491,7 @@ export default {
"quantity", "quantity",
"specId", "specId",
"specValueId", "specValueId",
], ]
skuValVisible: true,
} }
}, },
methods: { methods: {
@ -577,19 +561,23 @@ export default {
this.previewPicture = ""; this.previewPicture = "";
} }
}, },
//
handleViewGoodsPicture(url) { handleViewGoodsPicture(url) {
this.previewGoodsPicture = url; this.previewGoodsPicture = url;
this.goodsPictureVisible = true; this.goodsPictureVisible = true;
}, },
//
handleRemoveGoodsPicture(file) { handleRemoveGoodsPicture(file) {
this.baseInfoForm.goodsGalleryFiles = this.baseInfoForm.goodsGalleryFiles =
this.baseInfoForm.goodsGalleryFiles.filter((i) => i.url !== file.url); this.baseInfoForm.goodsGalleryFiles.filter((i) => i.url !== file.url);
}, },
// sku
updateSkuPicture() { updateSkuPicture() {
this.baseInfoForm.regeneratorSkuFlag = true; this.baseInfoForm.regeneratorSkuFlag = true;
let _index = this.selectedSku._index; let _index = this.selectedSku._index;
this.skuTableData[_index] = this.selectedSku; this.skuTableData[_index] = this.selectedSku;
}, },
// sku
handleSuccess(res, file) { handleSuccess(res, file) {
if (file.response) { if (file.response) {
file.url = file.response.result; file.url = file.response.result;
@ -601,26 +589,31 @@ export default {
this.previewPicture = file.url; this.previewPicture = file.url;
} }
}, },
//
handleSuccessGoodsPicture(res, file) { handleSuccessGoodsPicture(res, file) {
console.log(res);
if (file.response) { if (file.response) {
file.url = file.response.result; file.url = file.response.result;
this.baseInfoForm.goodsGalleryFiles.push(file); this.baseInfoForm.goodsGalleryFiles.push(file);
} }
}, },
//
handleFormatError(file) { handleFormatError(file) {
this.$Notice.warning({ this.$Notice.warning({
title: "文件格式不正确", title: "文件格式不正确",
desc: "文件 " + file.name + " 的格式不正确" desc: "文件 " + file.name + " 的格式不正确"
}); });
}, },
//
handleMaxSize(file) { handleMaxSize(file) {
this.$Notice.warning({ this.$Notice.warning({
title: "超过文件大小限制", title: "超过文件大小限制",
desc: "图片 " + file.name + " 不能超过2mb" desc: "图片 " + file.name + " 不能超过2mb"
}); });
}, },
// //
handleBeforeUploadGoodsPicture() { handleBeforeUploadGoodsPicture(file) {
const check = this.baseInfoForm.goodsGalleryFiles.length < 5; const check = this.baseInfoForm.goodsGalleryFiles.length < 5;
if (!check) { if (!check) {
this.$Notice.warning({ this.$Notice.warning({
@ -629,18 +622,15 @@ export default {
return false return false
} }
}, },
// sku
handleBeforeUpload(file) { handleBeforeUpload(file) {
const check = const check =
this.selectedSku.images !== undefined && this.selectedSku.images !== undefined &&
this.selectedSku.images.length > 5; this.selectedSku.images.length > 5;
if (check) { if (check) {
this.$Notice.warning({ this.$Notice.warning({ title: "图片数量不能大于五张" });
title: "图片数量不能大于五张", return false
});
} }
console.log(file);
return !check;
}, },
/** 查询商品品牌列表 */ /** 查询商品品牌列表 */

View File

@ -26,6 +26,7 @@ export default {
gotoGoodsList() { gotoGoodsList() {
this.$router.push({name: "goods"}); this.$router.push({name: "goods"});
}, },
//
gotoBack() { gotoBack() {
this.$router.go(); this.$router.go();
}, },

View File

@ -1,341 +0,0 @@
<template>
<div class="search">
<Card>
<Row v-show="openSearch" @keydown.enter.native="handleSearch">
<Form
ref="searchForm"
:model="searchForm"
inline
:label-width="70"
class="search-form"
>
<Form-item label="商品名称" prop="goodsName">
<Input
type="text"
v-model="searchForm.goodsName"
placeholder="请输入商品名称"
clearable
style="width: 200px"
/>
</Form-item>
<span v-if="drop">
<Form-item label="状态" prop="status">
<Select
v-model="searchForm.marketEnable"
placeholder="请选择"
clearable
style="width: 200px"
>
<Option value="DOWN">下架</Option>
<Option value="UPPER">上架</Option>
</Select>
</Form-item>
<Form-item label="商品编号" prop="sn">
<Input
type="text"
v-model="searchForm.sn"
placeholder="商品编号"
clearable
style="width: 200px"
/>
</Form-item>
</span>
<Form-item 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>
</Form-item>
</Form>
</Row>
<Row class="operation">
<Button @click="addGoods" icon="md-refresh">添加商品</Button>
<Button @click="getDataList" icon="md-refresh">刷新</Button>
<Button type="dashed" @click="openSearch = !openSearch">{{
openSearch ? "关闭搜索" : "开启搜索"
}}</Button>
<Button type="dashed" @click="openTip = !openTip">{{
openTip ? "关闭提示" : "开启提示"
}}</Button>
</Row>
<Row v-show="openTip">
<Alert show-icon>
已选择 <span class="select-count">{{ selectCount }}</span>
<a class="select-clear" @click="clearSelectAll"></a>
</Alert>
</Row>
<Table
:loading="loading"
border
:columns="columns"
:data="data"
ref="table"
sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
></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="updateStockModalVisible"
:mask-closable="false"
:width="500"
>
<Input
type="number"
v-model="updateStockParam.quantity"
/>
<div slot="footer">
<Button type="text" @click="updateStockModalVisible = false"
>取消</Button
>
<Button type="primary" @click="updateStock"></Button>
</div>
</Modal>
</div>
</template>
<script>
import {
getGoodsListDataByStockSeller,
getGoodsSkuListDataSeller,
updateGoodsSkuStocks,
upGoods,
lowGoods,
} from "@/api/goods";
export default {
name: "goods",
components: {},
data() {
return {
id: "", //id
openSearch: true, //
openTip: true, //
loading: true, //
updateStockModalVisible: false, //
drop: false, //
dropDownContent: "展开",
dropDownIcon: "ios-arrow-down",
searchForm: {
//
pageNumber: 1, //
pageSize: 10, //
sort: "create_time", //
order: "desc", //
},
updateStockParam: { //
id: 0,
quantity: 0,
},
form: {
//
goodsName: "",
sn: "",
marketEnable: "",
price: "",
sellerName: "",
},
selectList: [], //
selectCount: 0, //
columns: [ //
{
type: "selection",
width: 60,
align: "center",
},
{
title: "商品缩略图",
key: "thumbnail",
width: 150,
align: "center",
render: (h, params) => {
return h("img", {
attrs: {
src: params.row.thumbnail,
alt: "加载图片失败",
},
style: {
cursor: "pointer",
width: "80px",
height: "60px",
margin: "10px 0",
"object-fit": "contain",
},
});
},
},
{
title: "商品名称",
key: "goodsName",
minWidth: 120
},
{
title: "库存预警数量",
key: "stockWarningNum",
minWidth: 120
},
{
title: "商品库存",
key: "quantity",
minWidth: 120
},
{
title: "操作",
key: "action",
align: "center",
width: 200,
render: (h, params) => {
return h("div", [
h(
"Button",
{
props: {
type: "info",
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.getUpdateStock(params.row);
},
},
},
"库存"
)
]);
},
},
],
data: [], //
total: 0, //
};
},
methods: {
init() {
this.getDataList();
},
getUpdateStock(row) {
this.updateStockParam = {skuId: row.id, quantity: row.quantity};
this.updateStockModalVisible = true;
},
updateStock() {
let updateStockList = [this.updateStockParam];
updateGoodsSkuStocks(updateStockList).then(res => {
if (res.success) {
this.updateStockModalVisible = false;
this.$Message.success("更新库存成功");
this.getDataList();
}
});
},
changePage(v) {
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
handleReset() {
this.$refs.searchForm.resetFields();
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
//
this.getDataList();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
dropDown() {
if (this.drop) {
this.dropDownContent = "展开";
this.dropDownIcon = "ios-arrow-down";
} else {
this.dropDownContent = "收起";
this.dropDownIcon = "ios-arrow-up";
}
this.drop = !this.drop;
},
getDataList() {
this.loading = true;
//
getGoodsListDataByStockSeller(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
this.data = res.result.goodsSkuIPage.records.map(i =>{
i.stockWarningNum = res.result.stockWarningNum
return i;
});
this.total = res.result.goodsSkuIPage.total;
}
});
},
},
mounted() {
this.init();
},
};
</script>
<style lang="scss" scoped>
.search {
.operation {
margin-bottom: 2vh;
}
.select-count {
font-weight: 600;
color: #40a9ff;
}
.select-clear {
margin-left: 10px;
}
.page {
margin-top: 2vh;
}
.drop-down {
margin-left: 5px;
}
}
</style>

View File

@ -22,7 +22,7 @@ h4 {
> div { > div {
padding: 0 20px; padding: 0 20px;
border-left: 1px solid #ededed; // border-left: 1px solid #ededed;
> h5 { > h5 {
text-align: center; text-align: center;

View File

@ -217,11 +217,13 @@ export default {
}; };
}, },
methods: { methods: {
//
navigateTo(name) { navigateTo(name) {
this.$router.push({ this.$router.push({
name, name,
}); });
}, },
//
async init() { async init() {
let userInfo = JSON.parse(Cookies.get("userInfo")); let userInfo = JSON.parse(Cookies.get("userInfo"));
@ -232,7 +234,7 @@ export default {
this.notices = res.result.records; this.notices = res.result.records;
} }
}, },
//
async clickLinkNotices(val) { async clickLinkNotices(val) {
let res = await seeArticle(val.id); let res = await seeArticle(val.id);
if (res.success) { if (res.success) {
@ -240,7 +242,7 @@ export default {
this.noticeFlage = true; this.noticeFlage = true;
} }
}, },
//
async getHomeData() { async getHomeData() {
let res = await getSellerHomeData(); let res = await getSellerHomeData();
if (res.success) { if (res.success) {

View File

@ -32,7 +32,7 @@ export default {
}, },
storeId: "", // id storeId: "", // id
dates: [], // dates: [], //
params: { params: { //
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 10,
storeName: "", storeName: "",
@ -65,8 +65,6 @@ export default {
}, },
mounted() { mounted() {
this.storeId = JSON.parse(Cookies.get("userInfo")).id; this.storeId = JSON.parse(Cookies.get("userInfo")).id;
this.getFiveYears(); this.getFiveYears();
}, },
methods: { methods: {
@ -91,7 +89,7 @@ export default {
} }
this.dates = dates.reverse(); this.dates = dates.reverse();
}, },
//
changeSelect() { changeSelect() {
if (this.month) { if (this.month) {
this.dateList.forEach((res) => { this.dateList.forEach((res) => {
@ -105,7 +103,7 @@ export default {
} else { } else {
} }
}, },
//
clickBreadcrumb(item) { clickBreadcrumb(item) {
this.dateList.forEach((res) => { this.dateList.forEach((res) => {
res.selected = false; res.selected = false;
@ -119,7 +117,6 @@ export default {
} }
this.selectedWay = item; this.selectedWay = item;
// this.month = "";
this.selectedWay.year = new Date().getFullYear(); this.selectedWay.year = new Date().getFullYear();
this.selectedWay.month = ""; this.selectedWay.month = "";

View File

@ -22,7 +22,7 @@ export default {
this.init(); this.init();
}, },
methods: { methods: {
clear() { clear() { //
this.data = []; this.data = [];
this.selectedWay = []; this.selectedWay = [];
this.init(); this.init();
@ -49,13 +49,9 @@ export default {
*/ */
open(val, index) { open(val, index) {
if (val) { if (val) {
// console.warn(val);
// //
let checkedData = this.$store.state.shipTemplate; let checkedData = this.$store.state.shipTemplate;
// console.warn(this.$store.state.shipTemplate);
//
let checkData = []; let checkData = [];
let disabledData = checkedData.filter((item, i) => { let disabledData = checkedData.filter((item, i) => {
if (i != index) { if (i != index) {
@ -177,7 +173,7 @@ export default {
this.cancel(); this.cancel();
}, },
//
init() { init() {
getAllCity().then((res) => { getAllCity().then((res) => {
if (res.result) { if (res.result) {

View File

@ -29,6 +29,7 @@ export default {
props: ['addressId'], props: ['addressId'],
methods: { methods: {
//
change(val, selectedData) { change(val, selectedData) {
/** /**
* @returns [regionId,region] * @returns [regionId,region]
@ -46,8 +47,7 @@ export default {
handleChangeOnSelect(value) { handleChangeOnSelect(value) {
this.changeOnSelect = value; this.changeOnSelect = value;
}, },
getArea(val) { //
},
loadData(item, callback) { loadData(item, callback) {
item.loading = true; item.loading = true;
API_Setup.getChildRegion(item.value).then((res) => { API_Setup.getChildRegion(item.value).then((res) => {
@ -87,6 +87,7 @@ export default {
} }
}); });
}, },
//
init() { init() {
API_Setup.getChildRegion(this.id).then((res) => { API_Setup.getChildRegion(this.id).then((res) => {
let way = []; let way = [];
@ -116,5 +117,3 @@ export default {
}, },
}; };
</script> </script>
<style scoped lang="scss">
</style>

View File

@ -1,360 +0,0 @@
<template>
<div class="search">
<Card>
<Row @keydown.enter.native="handleSearch"> </Row>
<Row class="operation">
<Button @click="add" type="primary" icon="md-add">添加</Button>
<Button @click="getDataList" icon="md-refresh">刷新</Button>
<Button type="dashed" @click="openTip = !openTip">{{
openTip ? "关闭提示" : "开启提示"
}}</Button>
</Row>
<Row v-show="openTip">
<Alert show-icon>
已选择 <span class="select-count">{{ selectCount }}</span>
<a class="select-clear" @click="clearSelectAll"></a>
</Alert>
</Row>
<Table
:loading="loading"
border
:columns="columns"
:data="data"
ref="table"
sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
></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="modalTitle"
v-model="modalVisible"
:mask-closable="false"
:width="500"
>
<Form ref="form" :model="form" :label-width="120" :rules="formValidate">
<FormItem label="物流公司名称" prop="name">
<Input v-model="form.name" clearable style="width: 100%" />
</FormItem>
<FormItem label="物流公司代码" prop="code">
<Input v-model="form.code" clearable style="width: 100%" />
</FormItem>
<FormItem label="支持电子面单">
<i-switch v-model="form.standBy">
<span slot="open"></span>
<span slot="close"></span>
</i-switch>
</FormItem>
<FormItem label="电子面单表单">
<Input v-model="form.formItems" clearable style="width: 100%" />
</FormItem>
<FormItem label="禁用状态" prop="disabled">
<i-switch v-model="form.disabled">
<span slot="open"></span>
<span slot="close"></span>
</i-switch>
</FormItem>
</Form>
<div slot="footer">
<Button type="text" @click="modalVisible = false">取消</Button>
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
>提交</Button
>
</div>
</Modal>
</div>
</template>
<script>
import {
getLogisticsPage,
updateLogistics,
getLogisticsDetail,
addLogistics,
delLogistics,
} from "@/api/logistics";
export default {
name: "bill",
components: {},
data() {
return {
openTip: true, //
loading: true, //
modalType: 0, //
modalVisible: false, //
modalTitle: "", //
searchForm: {
//
pageNumber: 1, //
pageSize: 10, //
sort: "createTime", //
order: "desc", //
name: "",
},
form: {
//
name: "",
},
//
formValidate: {
name: [
{
required: true,
message: "请输入物流公司名称",
trigger: "blur",
},
],
},
submitLoading: false, //
selectList: [], //
selectCount: 0, //
columns: [
//
{
type: "selection",
width: 60,
align: "center",
},
{
title: "物流公司名称",
key: "name",
minWidth: 120
},
{
title: "状态",
key: "disabled",
minWidth: 50,
render(h, params) {
if(params.row.disabled){
return h("div", [h("tag", {props: {color: "green"}}, "开启")]);
}else{
return h("div", [h("tag", {props: {color: "volcano"}}, "关闭")]);
}
},
},
{
title: "操作",
key: "action",
align: "center",
width: 150,
render: (h, params) => {
return h("div", [
h(
"Button",
{
props: {
type: "primary",
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.detail(params.row);
},
},
},
"修改"
),
h(
"Button",
{
props: {
type: "error",
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.remove(params.row);
},
},
},
"删除"
),
]);
},
},
],
data: [], //
total: 0, //
};
},
methods: {
init() {
this.getDataList();
},
changePage(v) {
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
handleReset() {
this.$refs.searchForm.resetFields();
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
//
this.getDataList();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
getDataList() {
this.loading = true;
getLogisticsPage(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
this.data = res.result.records;
this.total = res.result.total;
}
});
this.total = this.data.length;
this.loading = false;
},
handleSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
this.submitLoading = true;
if (this.modalType == 0) {
// id
delete this.form.id;
this.form.disabled
? (this.form.disabled = "OPEN")
: (this.form.disabled = "CLOSE");
addLogistics(this.form).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
this.modalVisible = false;
}
});
} else {
//
updateLogistics(this.id, this.form).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
this.modalVisible = false;
}
});
}
}
});
},
add() {
this.modalType = 0;
this.modalTitle = "添加";
this.form = {};
this.$refs.form.resetFields();
this.modalVisible = true;
},
detail(v) {
this.modalType = 1;
this.id = v.id;
this.modalTitle = "修改";
this.modalVisible = true;
this.form.name = v.name;
this.form.code = v.code;
this.form.standBy = v.standBy;
this.form.formItems = v.formItems;
this.form.disabled = v.disabled;
this.form.disabled == "OPEN"
? (this.form.disabled = true)
: (this.form.disabled = false);
},
remove(v) {
this.$Modal.confirm({
title: "确认删除",
//
content: "您确认要删除 " + v.name + " ?",
loading: true,
onOk: () => {
//
delLogistics(v.id).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
},
});
},
},
mounted() {
this.init();
},
};
</script>
<style lang="scss">
//
// @import "@/styles/table-common.scss";
.search {
.operation {
margin-bottom: 2vh;
}
.select-count {
font-weight: 600;
color: #40a9ff;
}
.select-clear {
margin-left: 10px;
}
.page {
margin-top: 2vh;
}
.drop-down {
margin-left: 5px;
}
}
</style>

View File

@ -1,28 +0,0 @@
<template>
<Breadcrumb>
<BreadcrumbItem
v-for="item in currentPath"
:to="item.path"
:key="item.name"
>{{ itemTitle(item) }}</BreadcrumbItem>
</Breadcrumb>
</template>
<script>
export default {
name: 'breadcrumbNav',
props: {
currentPath: Array
},
methods: {
itemTitle (item) {
if (typeof item.title == 'object') {
return this.$t(item.title.i18n);
} else {
return item.title;
}
}
}
};
</script>

View File

@ -21,7 +21,7 @@ export default {
name: "footer", name: "footer",
data() { data() {
return { return {
year: new Date().getFullYear() year: new Date().getFullYear() //
} }
}, },
}; };

View File

@ -33,12 +33,15 @@ import util from "@/libs/util.js";
export default { export default {
name: "shrinkableMenu", name: "shrinkableMenu",
computed: { computed: {
//
menuList() { menuList() {
return this.$store.state.app.menuList; return this.$store.state.app.menuList;
}, },
//
navList() { navList() {
return this.$store.state.app.navList; return this.$store.state.app.navList;
}, },
//
currNav() { currNav() {
return this.$store.state.app.currNav; return this.$store.state.app.currNav;
} }