细节修改

main
fanfan 8 months ago
parent 274f55b5ef
commit 801ed95b75
  1. 7
      src/App.vue
  2. 18
      src/views/dataCenter/goods/Create.vue
  3. 55
      src/views/dataCenter/goods/Index.vue
  4. 20
      src/views/dataCenter/goods/Update.vue

@ -24,7 +24,10 @@ export default {
</script> </script>
<style> <style>
.container{ .container{
/* overflow-x: scroll; */ min-width: 1500px !important;
width: 100% !important; }
.ant-table-body {
overflow-x: scroll;
max-width: 1200px;
} }
</style> </style>

@ -137,12 +137,22 @@
<a href="javascript:;" @click="onReloadDeliveryList">刷新</a> <a href="javascript:;" @click="onReloadDeliveryList">刷新</a>
</div> </div>
</a-form-item> --> </a-form-item> -->
<a-form-item label="商品状态" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="商品" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group <a-radio-group
v-decorator="['status', { initialValue: 10, rules: [{ required: true }] }]" v-decorator="['is_pool', { initialValue: 0, rules: [{ required: true }] }]"
> >
<a-radio :value="10">上架</a-radio> <a-radio :value="0">待处理</a-radio>
<a-radio :value="20">下架</a-radio> <a-radio :value="1">已入池</a-radio>
<a-radio :value="2">未入池</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group
v-decorator="['is_sale', { initialValue: 0, rules: [{ required: true }] }]"
>
<a-radio :value="0">停售</a-radio>
<a-radio :value="1">在售</a-radio>
<a-radio :value="2">无货</a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<a-form-item label="商品排序" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="数字越小越靠前"> <a-form-item label="商品排序" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="数字越小越靠前">

@ -135,22 +135,22 @@
</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>
<a-button class="fl-l" icon="arrow-up" @click="handleImport()">批量导入</a-button> <a-button class="fl-l" icon="arrow-up" @click="handleImport()">批量导入</a-button>
<div v-if="selectedRowKeys.length" class="button-group"> <div class="button-group">
<a-button-group class="ml-10"> <a-button-group class="ml-10">
<a-button <a-button v-if="selectedRowKeys.length"
icon="arrow-up" icon="arrow-up"
style="background-color: red; color: #fff" style="background-color: red; color: #fff"
@click="handleUpdateStatus(selectedRowKeys, 1)" @click="handleUpdateStatus(selectedRowKeys, 1)"
>上架</a-button >上架</a-button
> >
<a-button <a-button v-if="selectedRowKeys.length"
icon="arrow-down" icon="arrow-down"
style="background-color: gray; color: #fff" style="background-color: gray; color: #fff"
@click="handleUpdateStatus(selectedRowKeys, 2)" @click="handleUpdateStatus(selectedRowKeys, 2)"
>移除</a-button >移除</a-button
> >
<a-button style="background-color: green; color: #fff; border: none" @click="visible = true">归类</a-button> <a-button v-if="selectedRowKeys.length" style="background-color: green; color: #fff; border: none" @click="visible = true">归类</a-button>
<a-button style="background-color: blue; color: #fff; border: none" @click="saleVisible = true" <a-button v-if="selectedRowKeys.length" style="background-color: blue; color: #fff; border: none" @click="saleVisible = true"
>停售</a-button >停售</a-button
> >
<a-button style="background-color: #6370e4; color: #fff; border: none" @click="priceVisible = true" <a-button style="background-color: #6370e4; color: #fff; border: none" @click="priceVisible = true"
@ -161,7 +161,7 @@
@click="handleExport(selectedRowKeys)" @click="handleExport(selectedRowKeys)"
>导出</a-button >导出</a-button
> >
<a-button icon="delete" @click="handleDelete(selectedRowKeys)">删除</a-button> <a-button v-if="selectedRowKeys.length" icon="delete" @click="handleDelete(selectedRowKeys)">删除</a-button>
</a-button-group> </a-button-group>
</div> </div>
</div> </div>
@ -210,10 +210,9 @@
<!-- 操作项 --> <!-- 操作项 -->
<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> -->
<a @click="handleUpdateStatus([item.goods_id], 2)" v-if="item.is_pool == 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="handleCopy(item.goods_no)">复制</a>
<a @click="handleDelete([item.goods_id])">删除</a> <a @click="handleDelete([item.goods_id])">删除</a>
</div> </div>
</s-table> </s-table>
@ -567,7 +566,7 @@ export default {
return return
} }
this.isLoading = true this.isLoading = true
GoodsApi.addPrice({ goodsIds, categoryIds, rate }) GoodsApi.addPrice({categoryIds, rate })
.then((result) => { .then((result) => {
this.priceVisible = false this.priceVisible = false
this.$message.success(result.message, 1.5) this.$message.success(result.message, 1.5)
@ -595,27 +594,19 @@ export default {
handleExport() { handleExport() {
const formData = this.searchForm.getFieldsValue() const formData = this.searchForm.getFieldsValue()
this.isLoading = true this.isLoading = true
GoodsApi.exportData(this.queryParam) var index = window.serverConfig.BASE_API.indexOf("?")
.then((result) => { var resolve = window.serverConfig.BASE_API.substring(0, index);
// this.exportData(result.data.list.data) let params='&goodsName='+(formData.goodsName||'')+
this.$message.success(result.message, 1.5) '&goodsNo='+(formData.goodsNo||'')+'&goods_price_max='+(formData.goods_price_max || '')+'&goods_price_min='+(formData.goods_price_min || '')+
this.handleRefresh() '&profit_rate_max='+(formData.profit_rate_max || '')+
}) '&profit_rate_min='+(formData.profit_rate_min || '')+
.finally((result) => { '&categoryId='+this.queryParam.categoryId+
this.isLoading = false '&channel='+this.queryParam.channel+
}) '&data_type='+this.queryParam.data_type+
}, '&is_pool='+this.queryParam.is_pool+
exportData(itemList) { '&is_sale='+this.queryParam.is_sale+
const content = itemList.map((item) => `${item.goods_id},${item.channel_name}`).join('\n') '&is_self='+this.queryParam.is_self
const blob = new Blob(['\ufeff', content], { type: 'text/csv;charset=utf-8;' }) window.open(resolve+'?s=/admin/goods/export'+params)
const url = URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.setAttribute('download', 'export.csv')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
window.URL.revokeObjectURL(url)
}, },
// //
handleDelete(goodsIds) { handleDelete(goodsIds) {
@ -663,10 +654,6 @@ export default {
.tab-list { .tab-list {
margin-right: 20px; margin-right: 20px;
} }
/deep/.ant-table-body {
overflow-x: scroll;
max-width: 1350px;
}
// - // -
.row-item-tab { .row-item-tab {
display: flex; display: flex;

@ -139,13 +139,31 @@
<a href="javascript:;" @click="onReloadDeliveryList">刷新</a> <a href="javascript:;" @click="onReloadDeliveryList">刷新</a>
</div> </div>
</a-form-item> --> </a-form-item> -->
<a-form-item label="商品状态" :labelCol="labelCol" :wrapperCol="wrapperCol"> <!-- <a-form-item label="商品状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group <a-radio-group
v-decorator="['status', { initialValue: 10, rules: [{ required: true }] }]" v-decorator="['status', { initialValue: 10, rules: [{ required: true }] }]"
> >
<a-radio :value="10">上架</a-radio> <a-radio :value="10">上架</a-radio>
<a-radio :value="20">下架</a-radio> <a-radio :value="20">下架</a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> -->
<a-form-item label="商品池" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group
v-decorator="['is_pool', { initialValue: 0, rules: [{ required: true }] }]"
>
<a-radio :value="0">待处理</a-radio>
<a-radio :value="1">已入池</a-radio>
<a-radio :value="2">未入池</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group
v-decorator="['is_sale', { initialValue: 0, rules: [{ required: true }] }]"
>
<a-radio :value="0">停售</a-radio>
<a-radio :value="1">在售</a-radio>
<a-radio :value="2">无货</a-radio>
</a-radio-group>
</a-form-item> </a-form-item>
<a-form-item label="商品排序" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="数字越小越靠前"> <a-form-item label="商品排序" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="数字越小越靠前">
<a-input-number <a-input-number

Loading…
Cancel
Save