细节修改

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>
<style>
.container{
/* overflow-x: scroll; */
width: 100% !important;
min-width: 1500px !important;
}
.ant-table-body {
overflow-x: scroll;
max-width: 1200px;
}
</style>

@ -137,12 +137,22 @@
<a href="javascript:;" @click="onReloadDeliveryList">刷新</a>
</div>
</a-form-item> -->
<a-form-item label="商品状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-form-item label="商品" :labelCol="labelCol" :wrapperCol="wrapperCol">
<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="20">下架</a-radio>
<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 label="商品排序" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="数字越小越靠前">

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

@ -139,13 +139,31 @@
<a href="javascript:;" @click="onReloadDeliveryList">刷新</a>
</div>
</a-form-item> -->
<a-form-item label="商品状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- <a-form-item label="商品状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group
v-decorator="['status', { initialValue: 10, rules: [{ required: true }] }]"
>
<a-radio :value="10">上架</a-radio>
<a-radio :value="20">下架</a-radio>
</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 label="商品排序" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="数字越小越靠前">
<a-input-number

Loading…
Cancel
Save