Merge remote-tracking branch 'origin/fix-release-1.0.0/yjc-migrate' into fix-release-1.0.0/yjc-migrate

This commit is contained in:
杨建炊 2024-11-04 14:44:47 +08:00
commit f2b52e5c88
29 changed files with 168 additions and 501 deletions

View File

@ -1 +0,0 @@
.skuBox[data-v-4de310da]{border:1px solid #e5e5e5;border-radius:5px;padding:15px 0;margin-bottom:15px;background-color:#f3f3f3}.skuBox .tit[data-v-4de310da]{padding-left:40px;font-weight:600;font-size:15px;margin-bottom:15px}.skuBox[data-v-3dbf163e]{border:1px solid #e5e5e5;border-radius:5px;padding:15px 0;margin-bottom:15px;background-color:#f3f3f3}.skuBox .tit[data-v-3dbf163e]{padding-left:40px;font-weight:600;font-size:15px;margin-bottom:15px}.table[data-v-22b837c9]{margin-top:20px;position:relative}.btn[data-v-22b837c9]{float:right}.flex[data-v-22b837c9]{display:flex;align-items:center}.goodBox .Img[data-v-22b837c9]{width:50px;height:50px;margin-right:12px;border-radius:4px}.goodBox .tit[data-v-22b837c9]{color:#000;font-size:13px}.confirmbtn[data-v-22b837c9]{width:114px;height:44px;border-radius:3px;margin-top:21px;margin-bottom:8px}.import-right[data-v-22b837c9]{margin-top:30px}.import-right a[data-v-22b837c9]{color:#409eff}[data-v-22b837c9] .btn11{padding:0;width:14px;height:14px}[data-v-22b837c9] .btn11 img{width:100%;height:100%}.page[data-v-22b837c9]{margin-top:20px}.searchBox[data-v-22b837c9]{display:flex;align-items:center;flex-wrap:wrap;white-space:nowrap}.searchBox .row[data-v-22b837c9]{font-size:14px;margin-bottom:20px;margin-right:15px;display:flex;align-items:center}.titBox[data-v-22b837c9]{display:flex;align-items:center}.red[data-v-22b837c9]{color:red}

View File

@ -1 +1 @@
#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.searchBox[data-v-35af9444]{display:flex;align-items:center;flex-wrap:wrap;white-space:nowrap;.row[data-v-35af9444]{font-size:14px;margin-bottom:20px;margin-right:15px;display:flex;align-items:center}}.opaBox[data-v-35af9444]{margin-bottom:15px}.btn[data-v-35af9444]{float:right}.commodityimg[data-v-35af9444]{width:59px;height:59px;background:hsla(0,0%,89%,.39);opacity:1;display:block;margin-right:12px}.Img[data-v-35af9444]{width:100%;height:100%}[data-v-35af9444] .flex .cell{display:flex;align-items:center}[data-v-35af9444] .btn11{padding:0;width:14px;height:14px}[data-v-35af9444] .btn11 img{width:100%;height:100%}.page[data-v-35af9444]{margin-top:20px} #nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.searchBox[data-v-29045bd9]{display:flex;align-items:center;flex-wrap:wrap;white-space:nowrap;.row[data-v-29045bd9]{font-size:14px;margin-bottom:20px;margin-right:15px;display:flex;align-items:center}}.opaBox[data-v-29045bd9]{margin-bottom:15px}.btn[data-v-29045bd9]{float:right}.commodityimg[data-v-29045bd9]{width:59px;height:59px;background:hsla(0,0%,89%,.39);opacity:1;display:block;margin-right:12px}.Img[data-v-29045bd9]{width:100%;height:100%}[data-v-29045bd9] .flex .cell{display:flex;align-items:center}[data-v-29045bd9] .btn11{padding:0;width:14px;height:14px}[data-v-29045bd9] .btn11 img{width:100%;height:100%}.page[data-v-29045bd9]{margin-top:20px}

View File

@ -1 +1 @@
#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.block[data-v-1eb6ff3a]{margin-top:20px} #nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.block[data-v-58627217]{margin-top:20px}

View File

@ -1 +1 @@
#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.searchBox[data-v-59efa2f0]{display:flex;align-items:center;flex-wrap:wrap;white-space:nowrap}.searchBox .row[data-v-59efa2f0]{font-size:14px;margin-bottom:20px;margin-right:15px;display:flex;align-items:center}.imgBox .img[data-v-59efa2f0]{width:55px;height:55px;border-radius:4px;margin:3px} #nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.searchBox[data-v-326a4ffe]{display:flex;align-items:center;flex-wrap:wrap;white-space:nowrap}.searchBox .row[data-v-326a4ffe]{font-size:14px;margin-bottom:20px;margin-right:15px;display:flex;align-items:center}.imgBox .img[data-v-326a4ffe]{width:55px;height:55px;border-radius:4px;margin:3px}

1
public/dist/css/769.af7ff3f3.css vendored Normal file
View File

@ -0,0 +1 @@
.skuBox[data-v-4de310da]{border:1px solid #e5e5e5;border-radius:5px;padding:15px 0;margin-bottom:15px;background-color:#f3f3f3}.skuBox .tit[data-v-4de310da]{padding-left:40px;font-weight:600;font-size:15px;margin-bottom:15px}.skuBox[data-v-3dbf163e]{border:1px solid #e5e5e5;border-radius:5px;padding:15px 0;margin-bottom:15px;background-color:#f3f3f3}.skuBox .tit[data-v-3dbf163e]{padding-left:40px;font-weight:600;font-size:15px;margin-bottom:15px}.table[data-v-0b7fe2a3]{margin-top:20px;position:relative}.btn[data-v-0b7fe2a3]{float:right}.flex[data-v-0b7fe2a3]{display:flex;align-items:center}.goodBox .Img[data-v-0b7fe2a3]{width:50px;height:50px;margin-right:12px;border-radius:4px}.goodBox .tit[data-v-0b7fe2a3]{color:#000;font-size:13px}.confirmbtn[data-v-0b7fe2a3]{width:114px;height:44px;border-radius:3px;margin-top:21px;margin-bottom:8px}.import-right[data-v-0b7fe2a3]{margin-top:30px}.import-right a[data-v-0b7fe2a3]{color:#409eff}[data-v-0b7fe2a3] .btn11{padding:0;width:14px;height:14px}[data-v-0b7fe2a3] .btn11 img{width:100%;height:100%}.page[data-v-0b7fe2a3]{margin-top:20px}.searchBox[data-v-0b7fe2a3]{display:flex;align-items:center;flex-wrap:wrap;white-space:nowrap}.searchBox .row[data-v-0b7fe2a3]{font-size:14px;margin-bottom:20px;margin-right:15px;display:flex;align-items:center}.titBox[data-v-0b7fe2a3]{display:flex;align-items:center}.red[data-v-0b7fe2a3]{color:red}

View File

@ -1 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>erp</title><script defer="defer" src="js/chunk-vendors.04652b46.js"></script><script defer="defer" src="js/app.759b64a1.js"></script><link href="css/chunk-vendors.77489a8d.css" rel="stylesheet"><link href="css/app.7e37f273.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but erp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html> <!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>erp</title><script defer="defer" src="js/chunk-vendors.04652b46.js"></script><script defer="defer" src="js/app.b70d2a52.js"></script><link href="css/chunk-vendors.77489a8d.css" rel="stylesheet"><link href="css/app.7e37f273.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but erp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
public/dist/js/415.53fdfe41.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/dist/js/415.53fdfe41.js.map vendored Normal file

File diff suppressed because one or more lines are too long

2
public/dist/js/609.f13bde2b.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/dist/js/609.f13bde2b.js.map vendored Normal file

File diff suppressed because one or more lines are too long

2
public/dist/js/67.159af9a1.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/dist/js/67.159af9a1.js.map vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
public/dist/js/769.8d06d508.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/dist/js/769.8d06d508.js.map vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
public/dist/js/app.b70d2a52.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -42,7 +42,7 @@
</div> </div>
<el-table v-loading="loading" ref="multipleTable" :data="tableData" class="table" tooltip-effect="dark" border <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"> <el-table-column label="商品信息" width="400" class-name="flex">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="commodityimg"> <div class="commodityimg">
@ -56,11 +56,13 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="num" label="组合数量" align="center"></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"> <el-table-column label="剩余库存" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="!scope.row.children">{{ scope.row.stock }}</span> <span v-if="!scope.row.children">{{ scope.row.stock }}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="reference_price" label="售价"></el-table-column> --> <!-- <el-table-column prop="reference_price" label="售价"></el-table-column> -->
<!-- <el-table-column sortable label="今日7点以后订单"> <!-- <el-table-column sortable label="今日7点以后订单">
<template slot-scope="scope"> <template slot-scope="scope">
@ -80,7 +82,7 @@
</template> </template>
</el-table-column> --> </el-table-column> -->
<!-- <el-table-column sortable prop="total_orders_num" label="累计订单"></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 prop="status" label="状态" align="center"></el-table-column>
<el-table-column label="操作" width="130" align="center" v-if="is_admin"> <el-table-column label="操作" width="130" align="center" v-if="is_admin">
<template slot-scope="scope"> <template slot-scope="scope">
@ -95,7 +97,7 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="current_page" :current-page="current_page"
:page-sizes="[15, 50, 100, 150, 200]" :page-sizes="[10, 50, 100, 150, 200]"
:page-size="per_page" :page-size="per_page"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="Paginationdata.total"> :total="Paginationdata.total">
@ -150,9 +152,11 @@
external_sku_id: '', external_sku_id: '',
sku_title: '' // sku_title: '' //
}, },
sort_field: '',
sort_value: '',
Paginationdata: {}, // Paginationdata: {}, //
current_page: 1, // current_page: 1, //
per_page: 100, // per_page: 10, //
dynamicValidateForm: { dynamicValidateForm: {
id: 0, id: 0,
title: '', 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) => { getGoodsCombination(params).then((res) => {
this.tableData = res.data.data this.tableData = res.data.data
this.Paginationdata = res.data.meta this.Paginationdata = res.data.meta
@ -189,27 +203,23 @@
this.per_page = parseInt(res.data.meta.per_page) this.per_page = parseInt(res.data.meta.per_page)
this.is_admin = res.data.manage && res.data.manage.is_admin this.is_admin = res.data.manage && res.data.manage.is_admin
this.loading = false this.loading = false
}).catch(() => {
this.loading = false
}) })
}, },
// //
handleChoose() { handleChoose() {
this.searchForm = { this.current_page = 1
...this.searchForm, this.getList()
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)
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.per_page = val
this.current_page = 1 this.current_page = 1
this.handleChoose() this.per_page = val
this.getList()
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.current_page = val this.current_page = val
this.handleChoose() this.getList()
}, },
submitForm(formName) { submitForm(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
@ -220,10 +230,8 @@
type: 'success' type: 'success'
}) })
this.dialogVisible = false this.dialogVisible = false
this.handleCurrentChange(1) this.handleChoose()
}) })
} else {
return false
} }
}) })
}, },
@ -298,6 +306,12 @@
return Object.keys(obj) return Object.keys(obj)
.map(key => encodeURIComponent(key) + '=' + (obj[key] ? encodeURIComponent(obj[key]) : '')) .map(key => encodeURIComponent(key) + '=' + (obj[key] ? encodeURIComponent(obj[key]) : ''))
.join('&'); .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() { mounted() {

View File

@ -20,13 +20,6 @@
<div slot="value-label" slot-scope="{ node }">{{ parseLabel(node) }}</div> <div slot="value-label" slot-scope="{ node }">{{ parseLabel(node) }}</div>
</treeselect> </treeselect>
</div> </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"> <div class="row">
<span>商品编码</span> <span>商品编码</span>
<el-input v-model="form.external_sku_id" placeholder="商品编码" clearable></el-input> <el-input v-model="form.external_sku_id" placeholder="商品编码" clearable></el-input>
@ -52,18 +45,8 @@
style="width: 250px;"> style="width: 250px;">
</el-date-picker> </el-date-picker>
</div> </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"> <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> <el-button plain @click="handleReChoose" icon="el-icon-refresh">重置筛选</el-button>
</div> </div>
</div> </div>
@ -75,31 +58,17 @@
<div> <div>
<span>全部商品({{ total }})</span> <span>全部商品({{ total }})</span>
<div class="btn"> <div class="btn">
<!-- <el-button @click="resetOrderCount" icon="el-icon-refresh">订单重置</el-button> --> <el-button type="primary" @click="petchEditStock" icon="el-icon-edit" :disabled="!chooseList.length">批量更新在售库存</el-button>
<!-- <el-button type="primary" plain @click="update">上新</el-button> --> <el-button type="primary" v-if="is_admin" @click="addNewgoods" icon="el-icon-plus">新增商品</el-button>
<!-- <el-upload ref="newset" action="/api/new/set/goods_skus" :multiple="false" name="newSetFile" <el-button type="primary" plain v-if="is_admin" @click="handleImport" icon="el-icon-upload2">在售库存导入</el-button>
:show-file-list="false" :on-success="inventorySuccess" :before-upload="beforeInventory" <el-button type="warning" @click="handleTypeExport" icon="el-icon-download">选择类型导出</el-button>
:on-error="inventoryError" style="display:inline-block;margin: 0 10px 0 10px;"> <el-button type="warning" @click="handleExport" icon="el-icon-download">数据导出</el-button>
<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>
</div> </div>
<!-- 表格 --> <!-- 表格 -->
<el-table v-loading="loading" ref="multipleTable" border :data="tableData" class="table" tooltip-effect="dark" <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 type="selection" align="center"></el-table-column>
<el-table-column label="商品信息" width="300"> <el-table-column label="商品信息" width="300">
@ -114,33 +83,6 @@
</div> </div>
</template> </template>
</el-table-column> </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"> <el-table-column prop="cost" label="成本" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex" style="justify-content: center;"> <div class="flex" style="justify-content: center;">
@ -152,49 +94,7 @@
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="reference_price" sortable label="售价"> <el-table-column prop="order_goods_num" sortable="custom" label="销量" align="center">
<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">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.order_goods_num }}</span> <span>{{ scope.row.order_goods_num }}</span>
<el-popover placement="right-start" trigger="hover" <el-popover placement="right-start" trigger="hover"
@ -209,41 +109,8 @@
</template> </template>
</el-table-column> </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="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"> <template slot-scope="scope">
<div class="titBox" v-if="scope.row.edit"> <div class="titBox" v-if="scope.row.edit">
<el-input v-model="scope.row.sale_stock" placeholder="可售库存" size="mini" style="width: 100%;"></el-input> <el-input v-model="scope.row.sale_stock" placeholder="可售库存" size="mini" style="width: 100%;"></el-input>
@ -258,43 +125,15 @@
</div> </div>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<span :class="scope.row.stock * 1 < 0 ? 'red' : ''">{{ scope.row.stock }}</span> <span :class="scope.row.stock * 1 < 0 ? 'red' : ''">{{ scope.row.stock }}</span>
</template> </template>
</el-table-column> </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 prop="status" label="状态" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="120" v-if="is_admin"> <el-table-column label="操作" align="center" width="120" v-if="is_admin">
<template slot-scope="scope"> <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="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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -306,7 +145,6 @@
<el-button type="primary" class="confirmbtn" @click="onSubmit()">保存</el-button> <el-button type="primary" class="confirmbtn" @click="onSubmit()">保存</el-button>
</div> </div>
<!-- 分页功能 -->
<div class="page-pagination"> <div class="page-pagination">
<el-pagination <el-pagination
@size-change="handleSizeChange" @size-change="handleSizeChange"
@ -332,21 +170,20 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="yesterday_num" label="1天前库存"> <el-table-column prop="yesterday_num" label="1天前库存">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<el-input v-model="scope.row.yesterday_num" :disabled="true"></el-input> <el-input v-model="scope.row.yesterday_num" :disabled="true"></el-input>
<el-input v-model="scope.row.yesterday_num"></el-input> <el-input v-model="scope.row.yesterday_num"></el-input>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column sortable label="今日到货"> <el-table-column sortable label="今日到货">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<el-input v-model="scope.row.daily.arrived_today_num" :disabled="true"> <el-input v-model="scope.row.daily.arrived_today_num" :disabled="true"></el-input>
</el-input> <el-input v-model="scope.row.daily.arrived_today_num"></el-input>
<el-input v-model="scope.row.daily.arrived_today_num"></el-input> </div>
</div> </template>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -365,15 +202,6 @@
</span> </span>
</el-dialog> </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"> <el-dialog title="提示" :visible.sync="dialogVisible5" width="20%" :close-on-click-modal="false">
<span>确定要修改目标去化率吗?</span> <span>确定要修改目标去化率吗?</span>
@ -475,19 +303,16 @@
return { return {
editPriceId: '', //id editPriceId: '', //id
editGoalId: '', editGoalId: '',
editReserveId: '', //id
editLossId: '', //id
total: 0, // total: 0, //
rose_num: 0, // rose_num: 0, //
other_num: 0, // other_num: 0, //
radio: '', // radio: '', //
brand: [], // brand: [], //
treeList: [], // treeList: [], //
loading: true, loading: false,
tableData: [], // tableData: [], //
shopsData: [], // shopsData: [], //
sku_code: {}, // sku_code: {}, //
// shopOrder: {}, //
options: [ options: [
{ id: 1, label: '在售' }, { id: 1, label: '在售' },
{ id: 2, label: '预警' }, { id: 2, label: '预警' },
@ -551,12 +376,10 @@
visible: false, visible: false,
updateField: '', //reference_price-, reserve-, loss_num-, status- updateField: '', //reference_price-, reserve-, loss_num-, status-
reserveShow: false, //-input reserveShow: false, //-input
datePicker: '', //
ommodityInventory: [], // ommodityInventory: [], //
dialogVisible: false, // dialogVisible: false, //
dialogVisible2: false, // dialogVisible2: false, //
dialogVisible3: false, // dialogVisible3: false, //
dialogVisible4: false, //
dialogVisible5: false, dialogVisible5: false,
publicId: '', publicId: '',
lastVal: 0, lastVal: 0,
@ -570,7 +393,9 @@
showAdd: false, showAdd: false,
showEdit: false, showEdit: false,
curId: 0, curId: 0,
filterTime: [] filterTime: [],
sort_field: '',
sort_value: '',
} }
}, },
methods: { methods: {
@ -583,18 +408,24 @@
}, },
// //
handleEdit(id) { handleEdit(id) {
// this.$router.push({ path: "EDIT_GOODS", query: { id: id } })
this.curId = id this.curId = id
this.showEdit = true this.showEdit = true
}, },
// //
getList() { getList() {
let page = { this.loading = true
let params = {
...this.form,
page: this.current_page, 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 = res.data.data
this.tableData = this.tableData.map((item) => { this.tableData = this.tableData.map((item) => {
item = { item = {
@ -614,61 +445,28 @@
} }
this.is_admin = res.data.manage && res.data.manage.is_admin this.is_admin = res.data.manage && res.data.manage.is_admin
this.loading = false this.loading = false
}).catch(() => {
this.loading = false
}) })
}, },
// //
handleChoose(page) { handleChoose() {
this.form = { this.current_page = 1
...this.form, this.getList()
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
})
}, },
// //
handleReChoose() { handleReChoose() {
this.form = { this.form = {
external_sku_id: '', external_sku_id: '',
goods_title: '', // goods_title: '',
type_id: null, // id type_id: null,
brand_id: '', // id brand_id: '',
sku_title: '', // sku_title: '',
status: '' // status: ''
} }
this.datePicker = '' this.filterTime = []
}, },
// //
@ -709,32 +507,28 @@
// //
handleSelectionChange(val) { handleSelectionChange(val) {
this.chooseList = JSON.parse(JSON.stringify(val)) this.chooseList = JSON.parse(JSON.stringify(val))
console.log(this.chooseList)
}, },
//
addNewgoods() { addNewgoods() {
// this.$router.push("/ADDGOODS")
this.showAdd = true this.showAdd = true
}, },
refreshList() { refreshList() {
this.handleChoose(this.current_page) this.handleChoose()
}, },
// //
handleSizeChange(val) { handleSizeChange(val) {
//
this.per_page = val this.per_page = val
this.handleChoose(1) this.getList()
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
//
this.current_page = val this.current_page = val
this.handleChoose(this.current_page) this.getList()
}, },
//or //or
cancel() { cancel() {
this.handleChoose(this.current_page) this.current_page = 1
this.getList()
this.isShow = false this.isShow = false
this.stock = false this.stock = false
}, },
@ -758,7 +552,12 @@
.map(key => encodeURIComponent(key) + '=' + (obj[key] ? encodeURIComponent(obj[key]) : '')) .map(key => encodeURIComponent(key) + '=' + (obj[key] ? encodeURIComponent(obj[key]) : ''))
.join('&'); .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 // or
onSubmit() { onSubmit() {
// //
@ -887,7 +686,8 @@
}).then((res) => { }).then((res) => {
if (res.status === 200) { if (res.status === 200) {
this.$message.success("导入成功") this.$message.success("导入成功")
this.handleChoose(1) this.current_page = 1
this.getList()
this.commitloading = false this.commitloading = false
this.docImportDrawer = false this.docImportDrawer = false
} else { } else {
@ -904,47 +704,10 @@
this.excelTemplatePath = res this.excelTemplatePath = res
}) })
}, },
// //
derivation() { derivation() {
window.open("/goods_skus/export?exportType=" + this.value) 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() { referencePriceRequest() {
let reference_priceData = { 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() { cancelGoal() {
this.dialogVisible5 = false this.dialogVisible5 = false
this.updateField = "goal_rate" this.updateField = "goal_rate"
this.editGoalId = this.publicId this.editGoalId = this.publicId
this.noRow.goal_rate = this.lastVal this.noRow.goal_rate = this.lastVal
}, },
confirmGoal() { confirmGoal() {
let data = { let data = {
updateField: 'goal_rate', 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() { getgoodsType() {
let param = { let param = {
@ -1093,38 +752,6 @@
this.treeList = JSON.parse(JSON.stringify(res.data.data).replace(/name/g, "label")) 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() { petchEditStock() {
this.showUpdate = true this.showUpdate = true
}, },
@ -1195,10 +822,6 @@
this.getList() this.getList()
this.getStockInfo() this.getStockInfo()
this.getgoodsType() this.getgoodsType()
// this.getbrandType()
this.editPriceId = ''
this.editReserveId = ''
this.editLossId = ''
} }
} }
</script> </script>

View File

@ -38,6 +38,7 @@
</div> </div>
<div class="row"> <div class="row">
<el-button type="primary" icon="el-icon-search" @click="handleSearch">筛选</el-button> <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> </div>
</div> </div>
@ -88,6 +89,7 @@
<script> <script>
import { getAfterSaleOrders } from "@/api/plat" import { getAfterSaleOrders } from "@/api/plat"
import { storeList } from "@/api/shop" import { storeList } from "@/api/shop"
import dayjs from 'dayjs'
export default { export default {
data() { data() {
@ -172,9 +174,25 @@ export default {
this.Shops[it.id] = it.name 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() { 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.getShopsList()
this.fetchList() this.fetchList()
} }

View File

@ -69,7 +69,7 @@
</el-form-item> </el-form-item>
<el-form-item label="下单时间:"> <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"> end-placeholder="止" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -82,9 +82,10 @@
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleChoose">筛选</el-button> <el-button type="primary" @click="handleChoose">筛选</el-button>
<el-button plain @click="handleReChoose">重置筛选</el-button> <el-button plain @click="handleReChoose">重置筛选</el-button>
<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-item>
<el-button type="primary" @click="print">打印</el-button>
<el-button v-if="form.goods_sku_num === 2" type="primary">配货单导出</el-button>
</el-form> </el-form>
</el-card> </el-card>
@ -127,7 +128,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="confirm_at" label="下单时间" width="100"></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> </el-table>
<!-- 分页功能 --> <!-- 分页功能 -->
@ -158,9 +159,8 @@ export default {
// supply_participate_no: "", // supply_participate_no: "",
// participate_no: "", // participate_no: "",
goods_sku_num: "", goods_sku_num: "",
print_status: "0", // print_status: "0",
external_sku_ids: [], external_sku_ids: [],
confirm_at: [],
ids: [], ids: [],
pno: '', pno: '',
}, },
@ -207,10 +207,7 @@ export default {
}, },
created() { created() {
this.initConfirmAt(); this.initConfirmAt();
this.getPlatOrderList({ this.handleChoose();
confirm_at_start: this.form.confirm_at[0],
confirm_at_end: this.form.confirm_at[1]
});
// this.initWebSocket(); // this.initWebSocket();
}, },
mounted() { mounted() {
@ -226,10 +223,10 @@ export default {
initConfirmAt() { initConfirmAt() {
const nowTimeDate = new Date(); const nowTimeDate = new Date();
nowTimeDate.setHours(0, 0, 0, 0); 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); nowTimeDate.setHours(23, 59, 59, 999);
this.form.confirm_at[1] = nowTimeDate.toLocaleString('zh', { hour12: false }).replaceAll('/', '-'); let end = nowTimeDate.toLocaleString('zh', { hour12: false }).replaceAll('/', '-');
this.confirmAt = this.form.confirm_at; this.confirmAt = [start, end]
}, },
// //
getPlatOrderList(params = {}) { getPlatOrderList(params = {}) {
@ -265,14 +262,14 @@ export default {
}, },
// //
handleChoose() { handleChoose() {
this.form.confirm_at_start = this.form.confirm_at[0] ? this.form.confirm_at[0] : '', let params = {
this.form.confirm_at_end = this.form.confirm_at[1] ? this.form.confirm_at[1] : '', ...this.form,
this.form = { page: 1,
...this.form, per_page: this.per_page,
page: 1, confirm_at_start: this.confirmAt[0] ? this.confirmAt[0] : '',
per_page: this.per_page, confirm_at_end: this.confirmAt[1] ? this.confirmAt[1] : ''
}; };
this.getPlatOrderList(this.form); this.getPlatOrderList(params)
}, },
// //
handleReChoose() { handleReChoose() {
@ -286,9 +283,8 @@ export default {
// supply_participate_no: "", // supply_participate_no: "",
// participate_no: "", // participate_no: "",
goods_sku_num: '', goods_sku_num: '',
print_status: 0, // print_status: 0,
external_sku_ids: [], external_sku_ids: [],
confirm_at: this.confirmAt,
ids: [], ids: [],
pno: '' pno: ''
}; };
@ -502,9 +498,25 @@ export default {
} }
return uuid.join(''); 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>