添加复制 超链接

main
fanfan 11 months ago
parent f1f8960d72
commit 3f6419efbc
  1. 60
      src/views/dataCenter/goods/Index.vue

@ -101,11 +101,11 @@
</a-modal> </a-modal>
<div class="row-item-tab clearfix"> <div class="row-item-tab clearfix">
<div class="tab-list fl-l"> <div class="tab-list fl-l">
<a-radio-group :defaultValue="queryParam.listType" @change="handleTabs"> <a-radio-group :defaultValue="queryParam.is_sale" @change="handleTabs">
<a-radio-button value="all">全部</a-radio-button> <a-radio-button value="">全部</a-radio-button>
<a-radio-button value="on_sale">出售中</a-radio-button> <a-radio-button value="0">在售</a-radio-button>
<a-radio-button value="off_sale">已下架</a-radio-button> <a-radio-button value="1">停售</a-radio-button>
<a-radio-button value="sold_out">已售罄</a-radio-button> <a-radio-button value="2">无货</a-radio-button>
</a-radio-group> </a-radio-group>
</div> </div>
<a-button class="fl-l" type="primary" icon="plus" @click="handleCreate()">创建商品</a-button> <a-button class="fl-l" type="primary" icon="plus" @click="handleCreate()">创建商品</a-button>
@ -146,6 +146,11 @@
<img width="50" height="50" :src="text" alt="商品图片" /> <img width="50" height="50" :src="text" alt="商品图片" />
</a> </a>
</span> </span>
<!-- 商品名称 -->
<span slot="goods_name" slot-scope="text, item">
<a v-if="item.link" :href="item.link" target="_blank">{{ text }}</a>
<p v-else>{{ text }}</p>
</span>
<!-- 商品池 --> <!-- 商品池 -->
<span slot="is_pool" slot-scope="text"> <span slot="is_pool" slot-scope="text">
<p <p
@ -159,15 +164,16 @@
<!-- 商品状态 --> <!-- 商品状态 -->
<span slot="is_sale" slot-scope="text, item"> <span slot="is_sale" slot-scope="text, item">
<a-tag class="cur-p" :color="text == 0 ? 'red' : text == 1 ? 'green' : 'gray'">{{ <a-tag class="cur-p" :color="text == 0 ? 'red' : text == 1 ? 'green' : 'gray'">{{
text == 0 ? '已下架' : text == 1 ? '出售中' : '已售罄' text == 0 ? '停售' : text == 1 ? '在售' : '无货'
}}</a-tag> }}</a-tag>
</span> </span>
<!-- 操作项 --> <!-- 操作项 -->
<div class="actions" style="width: 140px" slot="action" slot-scope="text, item"> <div class="actions" style="width: 140px" slot="action" slot-scope="text, item">
<router-link :to="{ path: '/goods/update', query: { goodsId: item.goods_id } }">编辑</router-link> <router-link :to="{ path: '/goods/update', query: { goodsId: item.goods_id } }">编辑</router-link>
<router-link :to="{ path: '/goods/copy', query: { goodsId: item.goods_id } }">复制</router-link> <!-- <router-link :to="{ path: '/goods/copy', query: { goodsId: item.goods_id } }">复制</router-link> -->
<a @click="handleUpdateStatus([item.goods_id], 2)" v-if="item.is_sale == 1">下架</a> <a @click="handleUpdateStatus([item.goods_id], 2)" v-if="item.is_pool == 1">下架</a>
<a @click="handleUpdateStatus([item.goods_id], 1)" v-else>上架</a> <a @click="handleUpdateStatus([item.goods_id], 1)" v-else>上架</a>
<a @click="handleCopy(item.unicode)">复制</a>
<a @click="handleDelete([item.goods_id])">删除</a> <a @click="handleDelete([item.goods_id])">删除</a>
</div> </div>
</s-table> </s-table>
@ -200,7 +206,7 @@ const columns = [
{ {
title: '商品名称', title: '商品名称',
dataIndex: 'goods_name', dataIndex: 'goods_name',
width: '270px', width: '250px',
scopedSlots: { customRender: 'goods_name' }, scopedSlots: { customRender: 'goods_name' },
}, },
{ {
@ -236,7 +242,7 @@ const columns = [
}, },
{ {
title: '添加时间', title: '添加时间',
width: '180px', width: '150px',
dataIndex: 'create_time', dataIndex: 'create_time',
sorter: true, sorter: true,
}, },
@ -262,7 +268,7 @@ export default {
categoryListTree: [], categoryListTree: [],
// //
queryParam: { queryParam: {
listType: 'all', is_sale: '',
channel: '', channel: '',
is_self: '', is_self: '',
is_pool: '', is_pool: '',
@ -321,7 +327,7 @@ export default {
{ name: '在售', val: 1 }, { name: '在售', val: 1 },
// { name: '', val: 2 }, // { name: '', val: 2 },
], ],
is_sale:0, is_sale: 0,
categoryIds: [], categoryIds: [],
} }
}, },
@ -330,7 +336,7 @@ export default {
// //
if (this.$route.query.listType) { if (this.$route.query.listType) {
this.queryParam.listType = this.$route.query.listType this.queryParam.is_sale = ''
} }
// //
this.getCategoryList() this.getCategoryList()
@ -344,6 +350,22 @@ export default {
}, },
}, },
methods: { methods: {
//
handleCopy(val) {
let that = this
if (val) {
that.$copyText(val).then(
function (e) {
that.$message.success('复制成功', 1.5)
},
function (e) {
that.$message.fail('复制失败', 1.5)
}
)
} else {
that.$message.warn('没有商品编码', 1.5)
}
},
// //
onSelectChange(selectedRowKeys) { onSelectChange(selectedRowKeys) {
this.selectedRowKeys = selectedRowKeys this.selectedRowKeys = selectedRowKeys
@ -351,7 +373,7 @@ export default {
// tab // tab
handleTabs(e) { handleTabs(e) {
this.queryParam.listType = e.target.value this.queryParam.is_sale = e.target.value
this.handleRefresh(true) this.handleRefresh(true)
}, },
@ -400,7 +422,7 @@ export default {
list.forEach((item) => { list.forEach((item) => {
categoryId.push(item.value) categoryId.push(item.value)
}) })
this.queryParam.categoryId=categoryId.join(',') this.queryParam.categoryId = categoryId.join(',')
}, },
// //
getCategoryList() { getCategoryList() {
@ -502,16 +524,16 @@ export default {
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.ant-card-body { /deep/.ant-card-body {
padding: 22px 29px 25px; padding: 22px 18px;
} }
// tab // tab
.tab-list { .tab-list {
margin-right: 20px; margin-right: 20px;
} }
/deep/.ant-table-body{ /deep/.ant-table-body {
overflow-x: scroll; overflow-x: scroll;
max-width: 1180px; max-width: 1300px;
} }
// - // -
.row-item-tab { .row-item-tab {

Loading…
Cancel
Save