|
@@ -81,10 +81,12 @@
|
|
icon="el-icon-search"
|
|
icon="el-icon-search"
|
|
size="mini"
|
|
size="mini"
|
|
@click="pageParams.pageNum = 1;handleQuery()"
|
|
@click="pageParams.pageNum = 1;handleQuery()"
|
|
- >搜索</el-button
|
|
|
|
|
|
+ >搜索
|
|
|
|
+ </el-button
|
|
>
|
|
>
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
- >重置</el-button
|
|
|
|
|
|
+ >重置
|
|
|
|
+ </el-button
|
|
>
|
|
>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
@@ -98,9 +100,21 @@
|
|
size="small"
|
|
size="small"
|
|
@click="handleExportDraw"
|
|
@click="handleExportDraw"
|
|
v-hasPermi="['order:deliver:export']"
|
|
v-hasPermi="['order:deliver:export']"
|
|
- >导出订单</el-button
|
|
|
|
|
|
+ >导出订单
|
|
|
|
+ </el-button
|
|
>
|
|
>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
+ <el-button
|
|
|
|
+ type="info"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-upload2"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="handleImport"
|
|
|
|
+ v-hasPermi="['order:deliver:ship']"
|
|
|
|
+ >批量发货
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>
|
|
<right-toolbar
|
|
<right-toolbar
|
|
:showSearch.sync="showSearch"
|
|
:showSearch.sync="showSearch"
|
|
@queryTable="getList"
|
|
@queryTable="getList"
|
|
@@ -131,7 +145,7 @@
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="商品名称" prop="title" min-width="80" />
|
|
|
|
|
|
+ <el-table-column label="商品名称" prop="title" min-width="80"/>
|
|
<el-table-column label="规格" min-width="100">
|
|
<el-table-column label="规格" min-width="100">
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
<div>{{ row.properties || "--" }}</div>
|
|
<div>{{ row.properties || "--" }}</div>
|
|
@@ -146,7 +160,7 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<!-- 不展开列表 -->
|
|
<!-- 不展开列表 -->
|
|
- <el-table-column label="订单号" prop="orderId" min-width="80" />
|
|
|
|
|
|
+ <el-table-column label="订单号" prop="orderId" min-width="80"/>
|
|
<el-table-column label="下单时间" min-width="100">
|
|
<el-table-column label="下单时间" min-width="100">
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
<div>
|
|
<div>
|
|
@@ -164,7 +178,7 @@
|
|
<div>{{ $numberFormat(row.payAmt) }}</div>
|
|
<div>{{ $numberFormat(row.payAmt) }}</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="用户昵称" prop="nickName" min-width="80" />
|
|
|
|
|
|
+ <el-table-column label="用户昵称" prop="nickName" min-width="80"/>
|
|
<el-table-column label="收货人/收货地址" prop="addr" min-width="120">
|
|
<el-table-column label="收货人/收货地址" prop="addr" min-width="120">
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
<div>
|
|
<div>
|
|
@@ -183,8 +197,9 @@
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
<div>
|
|
<div>
|
|
<el-tag :type="row.status.value === 1 ? 'success' : 'info'" v-if="row.status.value !== 2">{{
|
|
<el-tag :type="row.status.value === 1 ? 'success' : 'info'" v-if="row.status.value !== 2">{{
|
|
- row.status.desc
|
|
|
|
- }}</el-tag>
|
|
|
|
|
|
+ row.status.desc
|
|
|
|
+ }}
|
|
|
|
+ </el-tag>
|
|
<el-tag type="info" v-else>已发货</el-tag>
|
|
<el-tag type="info" v-else>已发货</el-tag>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -196,19 +211,48 @@
|
|
v-hasPermi="['order:deliver:query']"
|
|
v-hasPermi="['order:deliver:query']"
|
|
type="text"
|
|
type="text"
|
|
@click="getDetail(row)"
|
|
@click="getDetail(row)"
|
|
- >查看详情</el-button
|
|
|
|
|
|
+ >查看详情
|
|
|
|
+ </el-button
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
v-if="row.status.value === 1 || row.status.value === 4"
|
|
v-if="row.status.value === 1 || row.status.value === 4"
|
|
v-hasPermi="['order:deliver:ship']"
|
|
v-hasPermi="['order:deliver:ship']"
|
|
type="text"
|
|
type="text"
|
|
@click="toGoods(row)"
|
|
@click="toGoods(row)"
|
|
- >发货</el-button
|
|
|
|
|
|
+ >发货
|
|
|
|
+ </el-button
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
|
|
+ <!-- 用户导入对话框 -->
|
|
|
|
+ <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
|
+ <el-upload
|
|
|
|
+ ref="upload"
|
|
|
|
+ :limit="1"
|
|
|
|
+ :data="reqData"
|
|
|
|
+ accept=".xlsx, .xls"
|
|
|
|
+ :headers="upload.headers"
|
|
|
|
+ :action="upload.url"
|
|
|
|
+ :disabled="upload.isUploading"
|
|
|
|
+ :on-progress="handleFileUploadProgress"
|
|
|
|
+ :on-success="handleFileSuccess"
|
|
|
|
+ :auto-upload="false"
|
|
|
|
+ :http-request="reqUploadFile"
|
|
|
|
+ drag
|
|
|
|
+ >
|
|
|
|
+ <i class="el-icon-upload"></i>
|
|
|
|
+ <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
|
+ <div class="el-upload__tip text-center" slot="tip">
|
|
|
|
+ <span>仅允许导入 xls xlsx 格式文件。</span>
|
|
|
|
+ </div>
|
|
|
|
+ </el-upload>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="upload.open = false">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
|
|
<!-- 分页 -->
|
|
<!-- 分页 -->
|
|
<pagination
|
|
<pagination
|
|
@@ -220,16 +264,18 @@
|
|
/>
|
|
/>
|
|
|
|
|
|
<!-- 发货 -->
|
|
<!-- 发货 -->
|
|
- <send-goods :send-show="goodsShow" :goods-info="goodsInfo" @close="close" />
|
|
|
|
|
|
+ <send-goods :send-show="goodsShow" :goods-info="goodsInfo" @close="close"/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import {
|
|
import {
|
|
getDeliverList,
|
|
getDeliverList,
|
|
- deliverOrderExport,
|
|
|
|
|
|
+ deliverOrderExport, setBatchShip
|
|
} from "@/api/business/order";
|
|
} from "@/api/business/order";
|
|
-import { publicFileGetUrl } from "@/api/common";
|
|
|
|
|
|
+import {publicFileGetUrl} from "@/api/common";
|
|
|
|
+import {getToken, getSign} from "@/utils/auth";
|
|
import SendGoods from "./components/SendGoods";
|
|
import SendGoods from "./components/SendGoods";
|
|
|
|
+import { randomStr20 } from '@/utils/util'
|
|
export default {
|
|
export default {
|
|
name: "Deliver",
|
|
name: "Deliver",
|
|
components: {
|
|
components: {
|
|
@@ -247,7 +293,7 @@ export default {
|
|
startTime: "",
|
|
startTime: "",
|
|
endTime: "",
|
|
endTime: "",
|
|
status: "",
|
|
status: "",
|
|
- tel:"",
|
|
|
|
|
|
+ tel: "",
|
|
},
|
|
},
|
|
// 分页
|
|
// 分页
|
|
pageParams: {
|
|
pageParams: {
|
|
@@ -267,6 +313,16 @@ export default {
|
|
goodsShow: false,
|
|
goodsShow: false,
|
|
// 订单详情
|
|
// 订单详情
|
|
goodsInfo: {},
|
|
goodsInfo: {},
|
|
|
|
+ // 用户导入参数
|
|
|
|
+ upload: {
|
|
|
|
+ open: false,// 是否显示弹出层(用户导入)
|
|
|
|
+ title: "",// 弹出层标题(用户导入)
|
|
|
|
+ isUploading: false,// 是否禁用上传
|
|
|
|
+ url: "",// 上传的地址
|
|
|
|
+ headers: {},//请求头
|
|
|
|
+ },
|
|
|
|
+ fileSaveUrl: '',
|
|
|
|
+ reqData: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -275,16 +331,17 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
// 订单列表
|
|
// 订单列表
|
|
getList() {
|
|
getList() {
|
|
- let data = {...this.queryParams,
|
|
|
|
- resource:Number(this.queryParams.resource)
|
|
|
|
|
|
+ let data = {
|
|
|
|
+ ...this.queryParams,
|
|
|
|
+ resource: Number(this.queryParams.resource)
|
|
}
|
|
}
|
|
this.loading = true;
|
|
this.loading = true;
|
|
getDeliverList(
|
|
getDeliverList(
|
|
"pageNum=" +
|
|
"pageNum=" +
|
|
- this.pageParams.pageNum +
|
|
|
|
- "&pageSize=" +
|
|
|
|
- this.pageParams.pageSize +
|
|
|
|
- "&",
|
|
|
|
|
|
+ this.pageParams.pageNum +
|
|
|
|
+ "&pageSize=" +
|
|
|
|
+ this.pageParams.pageSize +
|
|
|
|
+ "&",
|
|
data
|
|
data
|
|
)
|
|
)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
@@ -312,6 +369,67 @@ export default {
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ //请求头
|
|
|
|
+ getHttpHeader() {
|
|
|
|
+ let timestamp = parseInt(new Date().getTime()),
|
|
|
|
+ nonce = randomStr20();
|
|
|
|
+ var sign = getSign(this.reqData || {}, timestamp)
|
|
|
|
+ let url = process.env.VUE_APP_BASE_API + '/api/v1/mp/admin/deliver/order/batchShip' + '?sign=' + sign + '&nonce=' + nonce;
|
|
|
|
+ this.upload.url = url
|
|
|
|
+ var headers = {
|
|
|
|
+ "Authorization": "Bearer " + getToken(),
|
|
|
|
+ "x-zz-timestamp": timestamp
|
|
|
|
+ }
|
|
|
|
+ this.upload.headers = headers
|
|
|
|
+ console.log(this.upload)
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 自定义文件上传的实现
|
|
|
|
+ reqUploadFile(param) {
|
|
|
|
+ var data = this.reqData || {}
|
|
|
|
+ var params = {
|
|
|
|
+ file: param.file,
|
|
|
|
+ ...data
|
|
|
|
+ }
|
|
|
|
+ setBatchShip(params, this.headers).then(response => {
|
|
|
|
+ // console.log("importFileSaveAPI============ response.msg"+response.msg)
|
|
|
|
+ this.upload.open = false;
|
|
|
|
+ this.upload.isUploading = false;
|
|
|
|
+ this.$refs.upload.clearFiles();
|
|
|
|
+ this.$alert(response.data, "导入结果", { dangerouslyUseHTMLString: true, customClass: 'msgbox' });
|
|
|
|
+ this.close()
|
|
|
|
+ }).catch(response => {
|
|
|
|
+ this.upload.open = false;
|
|
|
|
+ this.upload.isUploading = false;
|
|
|
|
+ this.$refs.upload.clearFiles();
|
|
|
|
+ this.$alert(response.data, "导入结果", { dangerouslyUseHTMLString: true, customClass: 'msgbox' });
|
|
|
|
+ this.vloading.close();
|
|
|
|
+ //param.onError()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //导入按钮操作
|
|
|
|
+ handleImport() {
|
|
|
|
+ this.upload.title = "用户导入";
|
|
|
|
+ this.upload.open = true;
|
|
|
|
+ this.getHttpHeader()
|
|
|
|
+ },
|
|
|
|
+ // 文件上传中处理
|
|
|
|
+ handleFileUploadProgress(event, file, fileList) {
|
|
|
|
+ console.log(file)
|
|
|
|
+ this.upload.isUploading = true;
|
|
|
|
+ },
|
|
|
|
+ // 文件上传成功处理
|
|
|
|
+ handleFileSuccess(response, file, fileList) {
|
|
|
|
+ this.upload.open = false;
|
|
|
|
+ this.upload.isUploading = false;
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ // 提交上传文件
|
|
|
|
+ submitFileForm() {
|
|
|
|
+ this.$refs.upload.submit();
|
|
|
|
+ },
|
|
|
|
+
|
|
// 重置
|
|
// 重置
|
|
resetQuery() {
|
|
resetQuery() {
|
|
this.queryParams = {
|
|
this.queryParams = {
|
|
@@ -355,7 +473,7 @@ export default {
|
|
|
|
|
|
// 查看详情
|
|
// 查看详情
|
|
getDetail(row) {
|
|
getDetail(row) {
|
|
- this.$router.push({ name: "DeliverDetail", query: { id: row.orderId } });
|
|
|
|
|
|
+ this.$router.push({name: "DeliverDetail", query: {id: row.orderId}});
|
|
},
|
|
},
|
|
|
|
|
|
// 点击发货
|
|
// 点击发货
|
|
@@ -400,4 +518,10 @@ export default {
|
|
::v-deep .el-tabs--border-card > .el-tabs__content {
|
|
::v-deep .el-tabs--border-card > .el-tabs__content {
|
|
padding: 0;
|
|
padding: 0;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+</style>
|
|
|
|
+<style lang="scss">
|
|
|
|
+.msgbox {
|
|
|
|
+ width: 60%;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|