yyw提交
This commit is contained in:
parent
ffc78c9dc3
commit
0947542239
@ -42,7 +42,7 @@
|
||||
</div>
|
||||
|
||||
<el-table v-loading="loading" ref="multipleTable" :data="tableData" class="table" tooltip-effect="dark" border
|
||||
style="width: 100%" row-key="id" :tree-props="{ children: 'children' }">
|
||||
style="width: 100%" row-key="id" :tree-props="{ children: 'children' }" @sort-change="sortChange">
|
||||
<el-table-column label="商品信息" width="400" class-name="flex">
|
||||
<template slot-scope="scope">
|
||||
<div class="commodityimg">
|
||||
@ -56,11 +56,13 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="num" label="组合数量" align="center"></el-table-column>
|
||||
<el-table-column prop="order_goods_num" label="销量" align="center" sortable="custom"></el-table-column>
|
||||
<el-table-column label="剩余库存" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.children">{{ scope.row.stock }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column prop="reference_price" label="售价"></el-table-column> -->
|
||||
<!-- <el-table-column sortable label="今日7点以后订单">
|
||||
<template slot-scope="scope">
|
||||
@ -80,7 +82,7 @@
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column sortable prop="total_orders_num" label="累计订单"></el-table-column> -->
|
||||
<el-table-column sortable prop="sale_stock" label="可售库存" align="center"></el-table-column>
|
||||
<el-table-column prop="sale_stock" label="可售库存" align="center" sortable="custom"></el-table-column>
|
||||
<el-table-column prop="status" label="状态" align="center"></el-table-column>
|
||||
<el-table-column label="操作" width="130" align="center" v-if="is_admin">
|
||||
<template slot-scope="scope">
|
||||
@ -95,7 +97,7 @@
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="current_page"
|
||||
:page-sizes="[15, 50, 100, 150, 200]"
|
||||
:page-sizes="[10, 50, 100, 150, 200]"
|
||||
:page-size="per_page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="Paginationdata.total">
|
||||
@ -150,9 +152,11 @@
|
||||
external_sku_id: '',
|
||||
sku_title: '' // 商品名称
|
||||
},
|
||||
sort_field: '',
|
||||
sort_value: '',
|
||||
Paginationdata: {}, // 分页相关数据
|
||||
current_page: 1, // 当前页
|
||||
per_page: 100, // 每页显示数量
|
||||
per_page: 10, // 每页显示数量
|
||||
dynamicValidateForm: {
|
||||
id: 0,
|
||||
title: '',
|
||||
@ -181,7 +185,17 @@
|
||||
|
||||
},
|
||||
// 获取商品列表
|
||||
getList(params) {
|
||||
getList() {
|
||||
this.loading = true
|
||||
let params = {
|
||||
...this.searchForm,
|
||||
page: this.current_page,
|
||||
per_page: this.per_page,
|
||||
create_time_start: this.filterTime ? this.filterTime[0] : '',
|
||||
create_time_end: this.filterTime ? this.filterTime[1] : '',
|
||||
sort_field: this.sort_field || 'id',
|
||||
sort_value: this.sort_value || 'desc'
|
||||
}
|
||||
getGoodsCombination(params).then((res) => {
|
||||
this.tableData = res.data.data
|
||||
this.Paginationdata = res.data.meta
|
||||
@ -189,27 +203,23 @@
|
||||
this.per_page = parseInt(res.data.meta.per_page)
|
||||
this.is_admin = res.data.manage && res.data.manage.is_admin
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 筛选
|
||||
handleChoose() {
|
||||
this.searchForm = {
|
||||
...this.searchForm,
|
||||
page: this.current_page,
|
||||
per_page: this.per_page,
|
||||
create_time_start: this.filterTime ? this.filterTime[0] : '',
|
||||
create_time_end: this.filterTime ? this.filterTime[1] : ''
|
||||
}
|
||||
this.getList(this.searchForm)
|
||||
this.current_page = 1
|
||||
this.getList()
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.per_page = val
|
||||
this.current_page = 1
|
||||
this.handleChoose()
|
||||
this.per_page = val
|
||||
this.getList()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.current_page = val
|
||||
this.handleChoose()
|
||||
this.getList()
|
||||
},
|
||||
submitForm(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
@ -220,10 +230,8 @@
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogVisible = false
|
||||
this.handleCurrentChange(1)
|
||||
this.handleChoose()
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -298,6 +306,12 @@
|
||||
return Object.keys(obj)
|
||||
.map(key => encodeURIComponent(key) + '=' + (obj[key] ? encodeURIComponent(obj[key]) : ''))
|
||||
.join('&');
|
||||
},
|
||||
sortChange(column) {
|
||||
this.sort_field = column.order ? column.prop : ''
|
||||
this.sort_value = column.order ? (column.order == 'descending' ? 'desc' : 'asc') : ''
|
||||
this.current_page = 1
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
@ -20,13 +20,6 @@
|
||||
<div slot="value-label" slot-scope="{ node }">{{ parseLabel(node) }}</div>
|
||||
</treeselect>
|
||||
</div>
|
||||
<!-- <div class="row">
|
||||
<span>商品品牌:</span>
|
||||
<el-select v-model="form.brand_id" placeholder="商品品牌" clearable>
|
||||
<el-option v-for="item in brand" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div> -->
|
||||
<div class="row">
|
||||
<span>商品编码:</span>
|
||||
<el-input v-model="form.external_sku_id" placeholder="商品编码" clearable></el-input>
|
||||
@ -52,18 +45,8 @@
|
||||
style="width: 250px;">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<!-- <div class="row">
|
||||
<el-select v-model="form.keyword_type" style="width: 80px;margin-right: 5px;">
|
||||
<el-option v-for="item in options3" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-date-picker v-model="datePicker" type="datetimerange" range-separator="-"
|
||||
start-placeholder="开始时间" end-placeholder="结束时间" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
@change="getSTime" style="width: 300px">
|
||||
</el-date-picker>
|
||||
</div> -->
|
||||
<div class="row">
|
||||
<el-button type="primary" @click="handleChoose(1)" icon="el-icon-search">筛选</el-button>
|
||||
<el-button type="primary" @click="handleChoose()" icon="el-icon-search">筛选</el-button>
|
||||
<el-button plain @click="handleReChoose" icon="el-icon-refresh">重置筛选</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@ -75,31 +58,17 @@
|
||||
<div>
|
||||
<span>全部商品(共{{ total }}条)</span>
|
||||
<div class="btn">
|
||||
<!-- <el-button @click="resetOrderCount" icon="el-icon-refresh">订单重置</el-button> -->
|
||||
<!-- <el-button type="primary" plain @click="update">上新</el-button> -->
|
||||
<!-- <el-upload ref="newset" action="/api/new/set/goods_skus" :multiple="false" name="newSetFile"
|
||||
:show-file-list="false" :on-success="inventorySuccess" :before-upload="beforeInventory"
|
||||
:on-error="inventoryError" style="display:inline-block;margin: 0 10px 0 10px;">
|
||||
<el-button type="primary" plain>上新导入</el-button>
|
||||
</el-upload> -->
|
||||
<!-- <el-upload ref="myUpload" action="/api/inventory/goods_skus" :multiple="false"
|
||||
name="inventoryFile" :show-file-list="false" :on-success="inventorySuccess"
|
||||
:before-upload="beforeInventory" :on-error="inventoryError"
|
||||
style="display:inline-block;margin: 0 10px 0 10px;">
|
||||
<el-button type="primary" plain>盘点导入</el-button>
|
||||
</el-upload> -->
|
||||
<el-button type="primary" @click="petchEditStock" icon="el-icon-edit" :disabled="!chooseList.length">批量更新在售库存</el-button>
|
||||
<el-button type="primary" v-if="is_admin" @click="addNewgoods" icon="el-icon-plus">新增商品</el-button>
|
||||
<el-button type="primary" plain v-if="is_admin" @click="handleImport" icon="el-icon-upload2">在售库存导入</el-button>
|
||||
<el-button type="warning" @click="handleTypeExport" icon="el-icon-download">选择类型导出</el-button>
|
||||
<el-button type="warning" @click="handleExport" icon="el-icon-download">数据导出</el-button>
|
||||
<!-- <el-button type="primary" plain @click="onCount">库存盘点</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table v-loading="loading" ref="multipleTable" border :data="tableData" class="table" tooltip-effect="dark"
|
||||
style="width: 100%" @selection-change="handleSelectionChange">
|
||||
style="width: 100%" @selection-change="handleSelectionChange" @sort-change="sortChange">
|
||||
<!-- 多选框 -->
|
||||
<el-table-column type="selection" align="center"></el-table-column>
|
||||
<el-table-column label="商品信息" width="300">
|
||||
@ -114,33 +83,6 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="品类/品种" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.goods && scope.row.goods.type">
|
||||
<span>{{ scope.row.goods.type.parent_type ? scope.row.goods.type.parent_type.name : '-' }} / </span>
|
||||
<span>{{ scope.row.goods.type.name || '-' }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column label="规格" prop="title"></el-table-column> -->
|
||||
<!-- <el-table-column label="品牌">
|
||||
<template slot-scope="scope">
|
||||
<div>{{ scope.row.goods && scope.row.goods.brand && scope.row.goods.brand.name || '' }}</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column prop="yesterday_num" sortable label="1T"></el-table-column>
|
||||
|
||||
<el-table-column sortable label="0T">
|
||||
<template slot-scope="scope">
|
||||
<div class="flex">
|
||||
<div v-if="isShow">
|
||||
<el-input v-model="scope.row.arrived_today_num11"></el-input>
|
||||
</div>
|
||||
<span v-else>{{ scope.row.daily && scope.row.daily.arrived_today_num }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column prop="cost" label="成本" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div class="flex" style="justify-content: center;">
|
||||
@ -152,49 +94,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column prop="reference_price" sortable label="售价">
|
||||
<template slot-scope="scope">
|
||||
<div class="flex">
|
||||
<div v-if="scope.row.id === editPriceId">
|
||||
<el-input v-model="scope.row.reference_price" @blur="referencePriceBlur(scope.row)">
|
||||
</el-input>
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ scope.row.reference_price }}
|
||||
<el-button slot="reference" class="btn11" @click="referencePriceClick(scope.row.id)">
|
||||
<img src="../../css/img/编辑.png" />
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column prop="num" sortable label="总量">
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column prop="goal_rate" sortable label="目标去化率">
|
||||
<template slot-scope="scope">
|
||||
<div class="flex">
|
||||
<div v-if="scope.row.id === editGoalId">
|
||||
<el-input v-model="scope.row.goal_rate" autofocus @blur="blurGoal"
|
||||
@change="changeGoal(scope.row)"></el-input>
|
||||
</div>
|
||||
<span v-else>{{ scope.row.goal_rate }}</span>
|
||||
<i class="el-icon-edit" @click="onGoal(scope.row)" style="padding-left: 5px;"></i>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
<!-- <el-table-column prop="reserve" sortable label="预留">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.id === editReserveId">
|
||||
<el-input v-model="scope.row.reserve" autofocus @blur="cancelReserve"
|
||||
@change="reservebBlur(scope.row)"></el-input>
|
||||
</div>
|
||||
<div v-else>{{ scope.row.reserve }}</div>
|
||||
<i class="el-icon-edit" @click="onreserve(scope.row)" style="padding-left: 5px;"></i>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column sortable label="销量" align="center">
|
||||
<el-table-column prop="order_goods_num" sortable="custom" label="销量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.order_goods_num }}</span>
|
||||
<el-popover placement="right-start" trigger="hover"
|
||||
@ -209,41 +109,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column sortable label="损耗">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.daily" class="flex">
|
||||
<div v-if="scope.row.id === editLossId">
|
||||
<el-input v-model="scope.row.daily.loss_num"></el-input>
|
||||
</div>
|
||||
<div v-else>{{ scope.row.daily.loss_num }}</div>
|
||||
<el-popover placement="right-start" trigger="click" @hide="noBubbles">
|
||||
<el-form ref="lossForm" size="mini" label-width="80px">
|
||||
<el-form-item label="损耗数量">
|
||||
<el-input v-model="scope.row.daily.loss_num"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="原因">
|
||||
<el-radio-group v-model="radio">
|
||||
<el-radio label="48h以上">48h以上</el-radio>
|
||||
<el-radio label="到货错误">到货错误</el-radio>
|
||||
<el-radio label="灰霉">灰霉</el-radio>
|
||||
<el-radio label="长度">长度</el-radio>
|
||||
<el-radio label="花朵">花朵</el-radio>
|
||||
<el-radio label="其他">其他</el-radio>
|
||||
<el-radio label="补发">补发</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onLoss(scope.row)">保存</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<i class="el-icon-edit" @click="loss(scope.row)" slot="reference" style="padding-left: 5px;"></i>
|
||||
</el-popover>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column prop="yesterday_num" label="实际库存" align="center"></el-table-column>
|
||||
<el-table-column prop="sale_stock" label="可售库存">
|
||||
<el-table-column prop="sale_stock" label="可售库存" sortable="custom">
|
||||
<template slot-scope="scope">
|
||||
<div class="titBox" v-if="scope.row.edit">
|
||||
<el-input v-model="scope.row.sale_stock" placeholder="可售库存" size="mini" style="width: 100%;"></el-input>
|
||||
@ -258,43 +125,15 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="剩余库存" sortable align="center" prop="stock">
|
||||
<el-table-column label="剩余库存" sortable="custom" align="center" prop="stock">
|
||||
<template slot-scope="scope">
|
||||
<span :class="scope.row.stock * 1 < 0 ? 'red' : ''">{{ scope.row.stock }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column align="center">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<span>销存比例</span>
|
||||
<el-tooltip class="item" effect="dark" content="当前库存/当天7点盘点的库存" placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<span :class="scope.row.sale_ratio * 1 < 20 ? 'red' : ''">{{ scope.row.sale_ratio }}%</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
<!-- <el-table-column prop="address" sortable label="盘点">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.daily">
|
||||
<div v-if="stock">
|
||||
<el-input v-model="scope.row.daily.inventory"></el-input>
|
||||
</div>
|
||||
<el-popover placement="right-start" trigger="hover" :content="scope.row.daily.inventory_time ?? ''">
|
||||
<div v-if="!stock" slot="reference">{{ scope.row.daily.inventory }}</div>
|
||||
</el-popover>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column prop="status" label="状态" align="center"></el-table-column>
|
||||
<el-table-column label="操作" align="center" width="120" v-if="is_admin">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button type="text" @click="ejectstock(scope.row)">库存</el-button> -->
|
||||
<el-button type="text" @click="handleEdit(scope.row.id)">编辑</el-button>
|
||||
<!-- <el-button type="text" @click="goodslog(scope.row)">记录</el-button> -->
|
||||
<!-- <el-button type="text" @click="deleteSku(scope.row)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -306,7 +145,6 @@
|
||||
<el-button type="primary" class="confirmbtn" @click="onSubmit()">保存</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 分页功能 -->
|
||||
<div class="page-pagination">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@ -342,8 +180,7 @@
|
||||
<el-table-column sortable label="今日到货">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-input v-model="scope.row.daily.arrived_today_num" :disabled="true">
|
||||
</el-input>
|
||||
<el-input v-model="scope.row.daily.arrived_today_num" :disabled="true"></el-input>
|
||||
<el-input v-model="scope.row.daily.arrived_today_num"></el-input>
|
||||
</div>
|
||||
</template>
|
||||
@ -365,15 +202,6 @@
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 预留量弹出框 -->
|
||||
<el-dialog title="提示" :visible.sync="dialogVisible4" width="20%" :close-on-click-modal="false">
|
||||
<span>确定要修改预留量吗?</span>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="reserveCancel">取 消</el-button>
|
||||
<el-button type="primary" @click="reserveRequest()">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 目标去化率弹出框 -->
|
||||
<el-dialog title="提示" :visible.sync="dialogVisible5" width="20%" :close-on-click-modal="false">
|
||||
<span>确定要修改目标去化率吗?</span>
|
||||
@ -475,19 +303,16 @@
|
||||
return {
|
||||
editPriceId: '', //参考售价的id
|
||||
editGoalId: '',
|
||||
editReserveId: '', //预留量的id
|
||||
editLossId: '', //损耗的id
|
||||
total: 0, // 总条数
|
||||
rose_num: 0, // 玫瑰数量
|
||||
other_num: 0, // 其它数量
|
||||
radio: '', // 损耗选择的原因
|
||||
brand: [], // 品牌列表
|
||||
treeList: [], // 种类列表
|
||||
loading: true,
|
||||
loading: false,
|
||||
tableData: [], // 商品列表
|
||||
shopsData: [], //店铺传参数组
|
||||
sku_code: {}, //店铺传参对象
|
||||
// shopOrder: {}, //店铺悬浮窗详情数据
|
||||
options: [
|
||||
{ id: 1, label: '在售' },
|
||||
{ id: 2, label: '预警' },
|
||||
@ -551,12 +376,10 @@
|
||||
visible: false,
|
||||
updateField: '', //reference_price-参考售价, reserve-预留量, loss_num-损耗, status-状态
|
||||
reserveShow: false, //预留量-input显示变量
|
||||
datePicker: '', // 筛选的时间
|
||||
ommodityInventory: [], //单个商品库存
|
||||
dialogVisible: false, //上新按钮弹出框变量
|
||||
dialogVisible2: false, //库存盘点弹出框变量
|
||||
dialogVisible3: false, //参考售价弹出框变量
|
||||
dialogVisible4: false, //预留弹出框变量
|
||||
dialogVisible5: false,
|
||||
publicId: '',
|
||||
lastVal: 0,
|
||||
@ -570,7 +393,9 @@
|
||||
showAdd: false,
|
||||
showEdit: false,
|
||||
curId: 0,
|
||||
filterTime: []
|
||||
filterTime: [],
|
||||
sort_field: '',
|
||||
sort_value: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -583,18 +408,24 @@
|
||||
},
|
||||
// 列表编辑
|
||||
handleEdit(id) {
|
||||
// this.$router.push({ path: "EDIT_GOODS", query: { id: id } })
|
||||
this.curId = id
|
||||
this.showEdit = true
|
||||
},
|
||||
|
||||
// 获取商品列表
|
||||
getList() {
|
||||
let page = {
|
||||
this.loading = true
|
||||
let params = {
|
||||
...this.form,
|
||||
page: this.current_page,
|
||||
per_page: this.per_page
|
||||
per_page: this.per_page,
|
||||
create_time_start: this.filterTime ? this.filterTime[0] : '',
|
||||
create_time_end: this.filterTime ? this.filterTime[1] : '',
|
||||
sort_field: this.sort_field || 'id',
|
||||
sort_value: this.sort_value || 'desc'
|
||||
}
|
||||
goods(page).then((res) => {
|
||||
params.type_id = params.type_id || ''
|
||||
goods(params).then((res) => {
|
||||
this.tableData = res.data.data
|
||||
this.tableData = this.tableData.map((item) => {
|
||||
item = {
|
||||
@ -614,61 +445,28 @@
|
||||
}
|
||||
this.is_admin = res.data.manage && res.data.manage.is_admin
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 筛选
|
||||
handleChoose(page) {
|
||||
this.form = {
|
||||
...this.form,
|
||||
page: page,
|
||||
per_page: this.per_page
|
||||
}
|
||||
|
||||
// 对象值为空清除
|
||||
const newObj = filterParams(this.form);
|
||||
function filterParams(obj) {
|
||||
const _newPar = {}
|
||||
for (const key in obj) {
|
||||
// 如果对象属性的值不为空,就保存该属性(这里我做了限制,如果属性的值为0,保存该属性。如果属性的值全部是空格,属于为空。)
|
||||
if (
|
||||
(obj[key] === 0 || obj[key]) &&
|
||||
obj[key].toString().replace(/(^\s*)|(\s*$)/g, '') !== ''
|
||||
) {
|
||||
// 记录属性
|
||||
_newPar[key] = obj[key];
|
||||
}
|
||||
}
|
||||
// 返回对象
|
||||
return _newPar
|
||||
}
|
||||
newObj.create_time_start = this.filterTime ? this.filterTime[0] : ''
|
||||
newObj.create_time_end = this.filterTime ? this.filterTime[1] : ''
|
||||
goods(newObj).then((res) => {
|
||||
this.tableData = res.data.data
|
||||
this.tableData = this.tableData.map((item) => {
|
||||
item = {
|
||||
...item,
|
||||
arrived_today_num11: 0
|
||||
}
|
||||
return item
|
||||
})
|
||||
this.total = res.data.meta.total
|
||||
this.Paginationdata = res.data.meta
|
||||
})
|
||||
handleChoose() {
|
||||
this.current_page = 1
|
||||
this.getList()
|
||||
},
|
||||
|
||||
// 重置筛选
|
||||
handleReChoose() {
|
||||
this.form = {
|
||||
external_sku_id: '',
|
||||
goods_title: '', // 商品名称
|
||||
type_id: null, // 商品种类id
|
||||
brand_id: '', // 商品品牌id
|
||||
sku_title: '', // 商品规格
|
||||
status: '' // 商品状态
|
||||
goods_title: '',
|
||||
type_id: null,
|
||||
brand_id: '',
|
||||
sku_title: '',
|
||||
status: ''
|
||||
}
|
||||
this.datePicker = ''
|
||||
this.filterTime = []
|
||||
},
|
||||
|
||||
// 导入商品按钮
|
||||
@ -709,32 +507,28 @@
|
||||
// 复选框按钮
|
||||
handleSelectionChange(val) {
|
||||
this.chooseList = JSON.parse(JSON.stringify(val))
|
||||
console.log(this.chooseList)
|
||||
},
|
||||
// 新增商品跳转
|
||||
addNewgoods() {
|
||||
// this.$router.push("/ADDGOODS")
|
||||
this.showAdd = true
|
||||
},
|
||||
refreshList() {
|
||||
this.handleChoose(this.current_page)
|
||||
this.handleChoose()
|
||||
},
|
||||
|
||||
//分页功能
|
||||
handleSizeChange(val) {
|
||||
//当前条数
|
||||
this.per_page = val
|
||||
this.handleChoose(1)
|
||||
this.getList()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
//当前页
|
||||
this.current_page = val
|
||||
this.handleChoose(this.current_page)
|
||||
this.getList()
|
||||
},
|
||||
|
||||
//取消上新or库存盘点
|
||||
cancel() {
|
||||
this.handleChoose(this.current_page)
|
||||
this.current_page = 1
|
||||
this.getList()
|
||||
this.isShow = false
|
||||
this.stock = false
|
||||
},
|
||||
@ -758,7 +552,12 @@
|
||||
.map(key => encodeURIComponent(key) + '=' + (obj[key] ? encodeURIComponent(obj[key]) : ''))
|
||||
.join('&');
|
||||
},
|
||||
|
||||
sortChange(column) {
|
||||
this.sort_field = column.order ? column.prop : ''
|
||||
this.sort_value = column.order ? (column.order == 'descending' ? 'desc' : 'asc') : ''
|
||||
this.current_page = 1
|
||||
this.getList()
|
||||
},
|
||||
// 点击上新or库存盘点后确认
|
||||
onSubmit() {
|
||||
//判断点击的是上新,再发送上新请求
|
||||
@ -887,7 +686,8 @@
|
||||
}).then((res) => {
|
||||
if (res.status === 200) {
|
||||
this.$message.success("导入成功")
|
||||
this.handleChoose(1)
|
||||
this.current_page = 1
|
||||
this.getList()
|
||||
this.commitloading = false
|
||||
this.docImportDrawer = false
|
||||
} else {
|
||||
@ -904,47 +704,10 @@
|
||||
this.excelTemplatePath = res
|
||||
})
|
||||
},
|
||||
|
||||
// 表格导出
|
||||
derivation() {
|
||||
window.open("/goods_skus/export?exportType=" + this.value)
|
||||
},
|
||||
|
||||
// 点击记录按钮跳转商品记录
|
||||
goodslog(row) {
|
||||
this.$router.push({
|
||||
path: "/GOODS_LOG",
|
||||
query: {
|
||||
id: row.id
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除
|
||||
deleteSku(rowData) {
|
||||
|
||||
},
|
||||
|
||||
// 获取筛选时间
|
||||
getSTime(val) {
|
||||
this.form.keyword_value = val.join(" - ")
|
||||
},
|
||||
|
||||
// 参考价格点击修改
|
||||
referencePriceClick(id) {
|
||||
this.updateField = "reference_price"
|
||||
this.editPriceId = id
|
||||
this.editReserveId = id
|
||||
this.editLossId = ''
|
||||
},
|
||||
|
||||
// 参考价格input框失去焦点弹出确认框
|
||||
referencePriceBlur(row) {
|
||||
this.dialogVisible3 = true
|
||||
this.publicId = row.id
|
||||
this.reference_price = row.reference_price
|
||||
},
|
||||
|
||||
//参考价格弹出框确认修改请求
|
||||
referencePriceRequest() {
|
||||
let reference_priceData = {
|
||||
@ -960,35 +723,12 @@
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onGoal(row) {
|
||||
this.updateField = "goal_rate"
|
||||
this.editGoalId = row.id
|
||||
this.lastVal = row.goal_rate
|
||||
this.editReserveId = ''
|
||||
this.editLossId = ''
|
||||
this.editPriceId = ''
|
||||
},
|
||||
|
||||
blurGoal() {
|
||||
this.updateField = ''
|
||||
this.editGoalId = ''
|
||||
},
|
||||
|
||||
changeGoal(row) {
|
||||
this.noRow = row
|
||||
this.dialogVisible5 = true
|
||||
this.publicId = row.id
|
||||
this.nowVal = row.goal_rate
|
||||
},
|
||||
|
||||
cancelGoal() {
|
||||
this.dialogVisible5 = false
|
||||
this.updateField = "goal_rate"
|
||||
this.editGoalId = this.publicId
|
||||
this.noRow.goal_rate = this.lastVal
|
||||
},
|
||||
|
||||
confirmGoal() {
|
||||
let data = {
|
||||
updateField: 'goal_rate',
|
||||
@ -1003,87 +743,6 @@
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onreserve(row) {
|
||||
this.updateField = "reserve"
|
||||
this.editReserveId = row.id
|
||||
this.lastVal = row.reserve
|
||||
this.editLossId = ''
|
||||
this.editPriceId = ''
|
||||
this.editGoalId = ''
|
||||
},
|
||||
|
||||
cancelReserve() {
|
||||
this.updateField = ''
|
||||
this.editReserveId = ''
|
||||
},
|
||||
|
||||
// 预留量 失去焦点触发确认框
|
||||
reservebBlur(row) {
|
||||
this.noRow = row
|
||||
this.dialogVisible4 = true
|
||||
this.publicId = row.id
|
||||
this.nowVal = row.reserve
|
||||
},
|
||||
|
||||
reserveCancel() {
|
||||
this.dialogVisible4 = false
|
||||
this.updateField = "reserve"
|
||||
this.editReserveId = this.publicId
|
||||
this.noRow.reserve = this.lastVal
|
||||
},
|
||||
|
||||
// 预留量弹出框确认请求
|
||||
reserveRequest() {
|
||||
let reservebData = {
|
||||
updateField: 'reserve',
|
||||
reserve: this.nowVal
|
||||
}
|
||||
singleUpdate(this.publicId, reservebData).then((res) => {
|
||||
this.editReserveId = ''
|
||||
this.dialogVisible4 = false
|
||||
this.$message({
|
||||
message: "预留量修改成功!",
|
||||
type: "success"
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
loss(id) {
|
||||
this.updateField = "loss_num";
|
||||
this.editLossId = id;
|
||||
|
||||
this.editPriceId = ''
|
||||
this.editReserveId = ''
|
||||
this.editGoalId = ''
|
||||
},
|
||||
|
||||
// 添加损耗
|
||||
onLoss(row) {
|
||||
let id = row.id;
|
||||
let lossData = {
|
||||
updateField: 'loss_num',
|
||||
reason: this.radio,
|
||||
loss_num: row.daily.loss_num
|
||||
}
|
||||
singleUpdate(id, lossData).then((res) => {
|
||||
this.editLossId = ''
|
||||
this.$message({
|
||||
message: "损耗添加成功!",
|
||||
type: "success"
|
||||
})
|
||||
this.handleChoose()
|
||||
})
|
||||
this.updateField = ''
|
||||
this.editLossId = ''
|
||||
},
|
||||
|
||||
//损耗框取消
|
||||
noBubbles() {
|
||||
this.updateField = ''
|
||||
this.editLossId = ''
|
||||
},
|
||||
|
||||
// 获取商品种类
|
||||
getgoodsType() {
|
||||
let param = {
|
||||
@ -1093,38 +752,6 @@
|
||||
this.treeList = JSON.parse(JSON.stringify(res.data.data).replace(/name/g, "label"))
|
||||
})
|
||||
},
|
||||
|
||||
// 获取商品品牌
|
||||
getbrandType() {
|
||||
let parsm = {
|
||||
per_page: 99999
|
||||
}
|
||||
Brand_goods_types(parsm).then((res) => {
|
||||
this.brand = res.data.data
|
||||
})
|
||||
},
|
||||
beforeInventory() {
|
||||
this.loadingModule = this.$loading({
|
||||
lock: true,
|
||||
text: '导入中...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
},
|
||||
inventorySuccess(response) {
|
||||
this.$message({
|
||||
message: response.message,
|
||||
type: "success"
|
||||
})
|
||||
this.loadingModule.close()
|
||||
},
|
||||
inventoryError(err) {
|
||||
this.$message({
|
||||
message: err.errorMessage,
|
||||
type: "error"
|
||||
})
|
||||
this.loadingModule.close()
|
||||
},
|
||||
petchEditStock() {
|
||||
this.showUpdate = true
|
||||
},
|
||||
@ -1195,10 +822,6 @@
|
||||
this.getList()
|
||||
this.getStockInfo()
|
||||
this.getgoodsType()
|
||||
// this.getbrandType()
|
||||
this.editPriceId = ''
|
||||
this.editReserveId = ''
|
||||
this.editLossId = ''
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleSearch">筛选</el-button>
|
||||
<el-button type="warning" @click="handleExport" icon="el-icon-download">数据导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -88,6 +89,7 @@
|
||||
<script>
|
||||
import { getAfterSaleOrders } from "@/api/plat"
|
||||
import { storeList } from "@/api/shop"
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -172,9 +174,25 @@ export default {
|
||||
this.Shops[it.id] = it.name
|
||||
})
|
||||
})
|
||||
},
|
||||
handleExport() {
|
||||
let params = {
|
||||
...this.filter,
|
||||
created_at_start: this.addTime ? this.addTime[0] : '',
|
||||
created_at_end: this.addTime ? this.addTime[1] : ''
|
||||
}
|
||||
window.open("/api/plat_after_sale_orders?" + this.objectToQueryString(params))
|
||||
},
|
||||
objectToQueryString(obj) {
|
||||
return Object.keys(obj)
|
||||
.map(key => encodeURIComponent(key) + '=' + (obj[key] ? encodeURIComponent(obj[key]) : ''))
|
||||
.join('&');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let end = dayjs().format('YYYY-MM-DD') + ' 23:59:59'
|
||||
let start = dayjs().subtract(30, 'day').format('YYYY-MM-DD') + ' 00:00:00'
|
||||
this.addTime = [start, end]
|
||||
this.getShopsList()
|
||||
this.fetchList()
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="下单时间:">
|
||||
<el-date-picker v-model="form.confirm_at" type="datetimerange" range-separator="-" start-placeholder="起"
|
||||
<el-date-picker v-model="confirmAt" type="datetimerange" range-separator="-" start-placeholder="起"
|
||||
end-placeholder="止" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
@ -82,9 +82,10 @@
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleChoose">筛选</el-button>
|
||||
<el-button plain @click="handleReChoose">重置筛选</el-button>
|
||||
</el-form-item>
|
||||
<el-button type="primary" @click="print">打印</el-button>
|
||||
<el-button v-if="form.goods_sku_num === 2" type="primary">配货单导出</el-button>
|
||||
<el-button type="warning" @click="handleExport" icon="el-icon-download">数据导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
@ -127,7 +128,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="confirm_at" label="下单时间" width="100"></el-table-column>
|
||||
<el-table-column prop="print_status" label="打印次数"></el-table-column>
|
||||
<!-- <el-table-column prop="print_status" label="打印次数"></el-table-column> -->
|
||||
</el-table>
|
||||
|
||||
<!-- 分页功能 -->
|
||||
@ -158,9 +159,8 @@ export default {
|
||||
// supply_participate_no: "",
|
||||
// participate_no: "",
|
||||
goods_sku_num: "",
|
||||
print_status: "0",
|
||||
// print_status: "0",
|
||||
external_sku_ids: [],
|
||||
confirm_at: [],
|
||||
ids: [],
|
||||
pno: '',
|
||||
},
|
||||
@ -207,10 +207,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.initConfirmAt();
|
||||
this.getPlatOrderList({
|
||||
confirm_at_start: this.form.confirm_at[0],
|
||||
confirm_at_end: this.form.confirm_at[1]
|
||||
});
|
||||
this.handleChoose();
|
||||
// this.initWebSocket();
|
||||
},
|
||||
mounted() {
|
||||
@ -226,10 +223,10 @@ export default {
|
||||
initConfirmAt() {
|
||||
const nowTimeDate = new Date();
|
||||
nowTimeDate.setHours(0, 0, 0, 0);
|
||||
this.form.confirm_at[0] = nowTimeDate.toLocaleString('zh', { hour12: false }).replaceAll('/', '-');
|
||||
let start = nowTimeDate.toLocaleString('zh', { hour12: false }).replaceAll('/', '-');
|
||||
nowTimeDate.setHours(23, 59, 59, 999);
|
||||
this.form.confirm_at[1] = nowTimeDate.toLocaleString('zh', { hour12: false }).replaceAll('/', '-');
|
||||
this.confirmAt = this.form.confirm_at;
|
||||
let end = nowTimeDate.toLocaleString('zh', { hour12: false }).replaceAll('/', '-');
|
||||
this.confirmAt = [start, end]
|
||||
},
|
||||
// 店铺列表
|
||||
getPlatOrderList(params = {}) {
|
||||
@ -265,14 +262,14 @@ export default {
|
||||
},
|
||||
// 筛选
|
||||
handleChoose() {
|
||||
this.form.confirm_at_start = this.form.confirm_at[0] ? this.form.confirm_at[0] : '',
|
||||
this.form.confirm_at_end = this.form.confirm_at[1] ? this.form.confirm_at[1] : '',
|
||||
this.form = {
|
||||
let params = {
|
||||
...this.form,
|
||||
page: 1,
|
||||
per_page: this.per_page,
|
||||
confirm_at_start: this.confirmAt[0] ? this.confirmAt[0] : '',
|
||||
confirm_at_end: this.confirmAt[1] ? this.confirmAt[1] : ''
|
||||
};
|
||||
this.getPlatOrderList(this.form);
|
||||
this.getPlatOrderList(params)
|
||||
},
|
||||
// 重置筛选
|
||||
handleReChoose() {
|
||||
@ -286,9 +283,8 @@ export default {
|
||||
// supply_participate_no: "",
|
||||
// participate_no: "",
|
||||
goods_sku_num: '',
|
||||
print_status: 0,
|
||||
// print_status: 0,
|
||||
external_sku_ids: [],
|
||||
confirm_at: this.confirmAt,
|
||||
ids: [],
|
||||
pno: ''
|
||||
};
|
||||
@ -502,9 +498,25 @@ export default {
|
||||
}
|
||||
|
||||
return uuid.join('');
|
||||
}
|
||||
},
|
||||
};
|
||||
handleExport() {
|
||||
let params = {
|
||||
...this.form,
|
||||
page: 1,
|
||||
per_page: this.per_page,
|
||||
confirm_at_start: this.confirmAt[0] ? this.confirmAt[0] : '',
|
||||
confirm_at_end: this.confirmAt[1] ? this.confirmAt[1] : '',
|
||||
is_export: 1
|
||||
}
|
||||
window.open("/api/plat_orders?" + this.objectToQueryString(params))
|
||||
},
|
||||
objectToQueryString(obj) {
|
||||
return Object.keys(obj)
|
||||
.map(key => encodeURIComponent(key) + '=' + (obj[key] ? encodeURIComponent(obj[key]) : ''))
|
||||
.join('&');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user