文件

346 行
14 KiB
HTML
可执行文件

<!--[1.7.90]-->
<style>
.el-pagination {
padding: 8px;
}
.center-content > .el-input {
width: 200px;
margin-bottom: 10px;
}
.el-table__row > td:last-child > .cell {
white-space: nowrap;
}
.center-content .el-button {
margin: 5px;
}
#delGoodsApp .el-table thead th {
background: #f5f7fa;
}
#delGoodsApp .el-table--small td {
padding: 3px 0;
}
.more-operate .el-button + .el-button {
margin-left: 0;
}
.more-operate .el-button {
margin-right: 8px;
margin-bottom: 8px;
}
.normal-text {
color: #666;
font-weight: normal;
}
.goods-list-popover {
width: 90px;
min-width: 90px;
}
.goods-list-popover .el-cascader-panel .el-cascader-menu {
min-width: 80px;
}
.goods-list-popover .el-cascader-panel .el-cascader-menu__wrap {
height: auto;
}
.goods-list-popover .el-cascader-panel {
min-width: 90px;
border: none;
height: auto;
}
.img {
max-height: 32px;
max-width: 100%;
cursor: pointer;
}
</style>
<div class="goodsBox" id="delGoodsApp" v-cloak>
<!--搜索及操作内容-->
<el-form label-width="90px" size="small">
<el-form-item label="关键词搜索">
<el-input :placeholder="'请输入'+(searchForm.keyword_type==1?'货号':(searchForm.keyword_type==2?'条码':'名称'))"
v-model="searchForm.keyword"
oninput="value=this.value.trim(' ')"
type="text"
clearable
style="width: 300px"
@keydown.enter.exact.native.prevent="searchGoods"
class="input-with-select">
<el-select v-model="searchForm.keyword_type"
style="width: 80px"
background slot="prepend">
<el-option label="货号" :value="1"></el-option>
<el-option label="条码" :value="2"></el-option>
<el-option label="名称" :value="3"></el-option>
</el-select>
</el-input>
<!--设置默认的搜索关键词类型-->
<default-search-goods-type @change-type="changeKeywordType"></default-search-goods-type>
</el-form-item>
<el-form-item label="商品分类">
<select-goods-category :user-type="2"
:store-id="store_id"
:category-id1.sync="searchForm.person1"
:category-id2.sync="searchForm.person2"
:category-id3.sync="searchForm.person3"></select-goods-category>
</el-form-item>
<template v-if="showMoreSearch">
<el-form-item label="排序规则">
<el-select clearable placeholder="排序关键字" v-model="searchForm.condition_name">
<el-option :value="1" label="添加时间"></el-option>
<el-option :value="2" label="货号"></el-option>
<el-option :value="4" label="商品名称"></el-option>
</el-select>
<el-select clearable placeholder="排序方式" filterable v-model="searchForm.order_type">
<el-option :value="1" label="升序"></el-option>
<el-option :value="2" label="降序"></el-option>
</el-select>
</el-form-item>
<el-form-item label="其他选项">
<el-select clearable placeholder="商品计量类型" v-model="searchForm.pricing_method">
<el-option :value="1" label="非称重"></el-option>
<el-option :value="2" label="称重"></el-option>
</el-select>
<el-select clearable placeholder="规格类型" v-model="searchForm.attribute_state">
<el-option :value="1" label="非规格"></el-option>
<el-option :value="2" label="多规格"></el-option>
</el-select>
<el-select clearable placeholder="销售类型" v-model="searchForm.advance_sale_status">
<el-option value="0" label="现货销售"></el-option>
<el-option value="1" label="预售模式"></el-option>
</el-select>
</el-form-item>
</template>
<!--搜索-->
<div style="display: flex;justify-content: space-between">
<el-form-item label="">
<el-button type="primary" @click="searchGoods">搜索</el-button>
<el-button type="text"
@click="showMoreSearch=!showMoreSearch">{{showMoreSearch?'隐藏':'显示'}}高级选项
</el-button>
</el-form-item>
</div>
</el-form>
<div style="border: 1px solid #e6e6e6;max-width: calc(100vw - 208px);margin-top: 10px;">
<el-table border :data="goodsList" style="width: 100%;border: none;"
@selection-change="handleSelectionChange"
size="mini"
max-height="500"
v-loading="loading"
element-loading-text="数据获取中"
element-loading-spinner="el-icon-loading">
<el-table-column type="selection" width="40"></el-table-column>
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column prop="goods_img" label="图片" width="60" show-overflow-tooltip>
<template slot-scope="scope">
<img class="img"
:src="scope.row.goods_img"
onerror="this.error=null;this.src='__PUBLIC__/images/none.png'"
@click="seeBig(scope.row.goods_img)"
>
</template>
</el-table-column>
<el-table-column prop="goods_number" label="货号" min-width="60" show-overflow-tooltip></el-table-column>
<el-table-column prop="goods_name" label="商品名称" show-overflow-tooltip></el-table-column>
<el-table-column prop="goods_code" min-width="100" label="商品条码" show-overflow-tooltip></el-table-column>
<el-table-column prop="goods_num" label="库存" width="80" show-overflow-tooltip>
<template slot-scope="scope" slot="header">
<el-popover
placement="bottom"
title="详解"
width="100"
trigger="hover"
content="供给仓当前的商品数量">
<span slot="reference" size="mini">库存 <i class="el-icon-question"></i></span>
</el-popover>
</template>
</el-table-column>
<el-table-column prop="purchase_price" label="成本价" width="90" show-overflow-tooltip>
<template slot-scope="scope" slot="header">
<el-popover
placement="bottom"
title="详解"
width="100"
trigger="hover"
content="移动加权平均值(当前供给仓的商品总入库价除以总数量的平均值)">
<span slot="reference" size="mini">成本价 <i class="el-icon-question"></i></span>
</el-popover>
</template>
</el-table-column>
<el-table-column prop="retail_price" label="零售价" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="store_mem_price" label="店内会员价" min-width="80"
show-overflow-tooltip></el-table-column>
<el-table-column prop="online_price" label="商城价" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="shop_mem_price" label="商城会员价" min-width="80" show-overflow-tooltip></el-table-column>
<el-table-column label="状态" width="68">
<template slot-scope="scope">
<el-switch disabled
v-model="scope.row.status"
inactive-value="1"
active-value="0">
</el-switch>
</template>
</el-table-column>
<el-table-column label="商城出售" width="78">
<template slot-scope="scope">
<el-switch disabled
v-model="scope.row.online_state"
inactive-value="0"
active-value="1">
</el-switch>
</template>
</el-table-column>
<el-table-column label="线上打折" width="78">
<template slot-scope="scope">
<el-switch disabled
v-model="scope.row.vip_online_state"
inactive-value="0"
active-value="1">
</el-switch>
</template>
</el-table-column>
<el-table-column label="线下打折" width="78">
<template slot-scope="scope">
<el-switch
disabled
v-model="scope.row.vip_retail_state"
inactive-value="0"
active-value="1">
</el-switch>
</template>
</el-table-column>
<el-table-column label="常用" width="68">
<template slot-scope="scope">
<el-switch disabled
v-model="scope.row.usual_state"
inactive-value="1"
active-value="2">
</el-switch>
</template>
</el-table-column>
<el-table-column prop="cate_name" label="类别名称" width="100" show-overflow-tooltip></el-table-column>
<el-table-column prop="source_type_name" label="商品来源" width="100" show-overflow-tooltip></el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 15, 20, 25, 30, 35, 40, 45, 50]"
:page-size="100"
layout="total, sizes, prev, pager, next, jumper"
:total="currentLen">
</el-pagination>
</div>
</div>
<script src="/Public/Retail/common/js/select-goods-category.js"></script>
<script src="/Public/Retail/js/default-search-goods-type.js"></script>
<script type="text/javascript">
var delGoodsApp = new Vue({
el: '#delGoodsApp',
data() {
return {
searchForm: {
recovery_type: 2,
keyword_type: 2,
keyword: '',
condition_name: '',
order_type: '',
pricing_method: '',//是否称重 1不称重 2称重
advance_sale_status: '', //预售模式
status: 2,
attribute_state: '',//1非规格 多规格
person1: '',
person2: '',
person3: '',
},
merchant_id: localStorage.merchant_id,
store_id: localStorage.store_id,
showMoreSearch: false,//是否显示更多选项
goodsList: [],
currentLen: 0,
currentPage: 1,
currentLimit: 10,
}
},
methods: {
//修改默认关键词类型
changeKeywordType(val) {
this.searchForm.keyword_type = val;
},
seeBig(img) {
if (img != '') {
this.showBigImg = true;
this.bigImg = img;
}
},
handleSelectionChange(data) {
this.checkedList = [];
this.checkedList = data;
},
handleSizeChange(val) {
this.currentLimit = val;//切换每页数量
this.currentPage = 1;
this.getData();
},
handleCurrentChange(val) {
this.currentPage = val;
this.getData();//切换页数
},
searchGoods() {
this.currentPage = 1;
this.getData();
},
getData() {
this.loading = true;
$.ajax({
url: "{:U(goodsList)}",
type: 'POST',
data: {
recovery_type: 2,
page: this.currentPage,
limit: this.currentLimit,
...this.searchForm,
},
success: (res) => {
this.loading = false;
if (res.code == 0) {
this.goodsList = [];
this.goodsList = res.data;
this.$nextTick(() => {
this.currentLen = parseInt(res.count);
})
} else {
this.$confirm(res.msg, '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
}).catch(() => {
});
}
},
error: () => {
this.loading = false;
}
});
}
},
created() {
this.getData();
},
})
</script>