完善商品多属性的页面

This commit is contained in:
季圣华 2022-08-30 00:45:15 +08:00
parent 654a246d84
commit 6bf5df5bca
3 changed files with 52 additions and 8 deletions

View File

@ -3,6 +3,37 @@
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="属性名" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<a-input placeholder="请输入属性名查询" v-model="queryParam.attributeName"></a-input>
</a-form-item>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
@ -14,9 +45,14 @@
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
@ -48,7 +84,7 @@
offset: 1
},
// 查询条件
queryParam: {attributeField:''},
queryParam: {attributeName:''},
// 表头
columns: [
{
@ -61,8 +97,8 @@
return parseInt(index)+1;
}
},
{title: '属性名', dataIndex: 'attributeName', width: 100},
{title: '属性值用竖线隔开', dataIndex: 'attributeValue', width: 400},
{title: '属性名', dataIndex: 'attributeName', width: 200},
{title: '属性值用竖线隔开', dataIndex: 'attributeValue', width: 500},
{
title: '操作',
dataIndex: 'action',
@ -82,7 +118,14 @@
},
methods: {
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
}
}
}
</script>

View File

@ -83,7 +83,7 @@
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-upload v-if="btnEnableList.indexOf(1)>-1" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-popover title="表格模板">
<template slot="content">
<p><a target="_blank" href="/doc/goods_template.xls"><b>商品Excel模板下载</b></a></p>

View File

@ -1,5 +1,5 @@
<template>
<j-modal
<a-modal
:title="title"
:width="1300"
:visible="visible"
@ -116,7 +116,8 @@
<a-col :md="6" :sm="24" v-if="!model.id">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="多属性" data-step="11" data-title="多属性"
data-intro="多属性是针对的sku商品比如服装、鞋帽行业此处开关如果启用就可以在下方进行多sku的配置配置具体的颜色、尺码之类的组合">
<a-select mode="multiple" v-decorator="[ 'manySku' ]" showSearch optionFilterProp="children" @change="onManySkuChange">
<a-select mode="multiple" v-decorator="[ 'manySku' ]" showSearch optionFilterProp="children"
placeholder="请选择多属性(可多选)" @change="onManySkuChange">
<a-select-option v-for="(item,index) in materialAttributeList" :key="index" :value="item.value" :disabled="item.disabled">
{{ item.name }}
</a-select-option>
@ -246,7 +247,7 @@
</a-form>
</a-spin>
<unit-modal ref="unitModalForm" @ok="unitModalFormOk"></unit-modal>
</j-modal>
</a-modal>
</template>
<script>
import pick from 'lodash.pick'