从商品库存-库存记录-点击订单号跳转过来

This commit is contained in:
duan 2024-07-17 18:06:13 +08:00
parent cfa32e18ba
commit 7cadb25712
4 changed files with 70 additions and 66 deletions

View File

@ -241,6 +241,16 @@ export function stockStateChange(params) {
} }
}); });
} }
// 下架
export function stockStateChangess(params) {
return request({
url: `/api/stock/grounding`,
method: "put",
params: {
...params
}
});
}
// 警戒设置 // 警戒设置
export function stockStatewarnLine(params) { export function stockStatewarnLine(params) {
return request({ return request({

View File

@ -43,6 +43,13 @@
{{ scope.row.leftNumber + scope.row.stockNumber }} {{ scope.row.unitName }} {{ scope.row.leftNumber + scope.row.stockNumber }} {{ scope.row.unitName }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="订单号">
<template v-slot="scope">
<span @click="goUrl(scope.row.orderNo)" style="color: blue;cursor: pointer">
{{ scope.row.orderNo }}
</span>
</template>
</el-table-column>
<el-table-column label="操作时间" prop="updatedAt"> <el-table-column label="操作时间" prop="updatedAt">
<template v-slot="scope"> <template v-slot="scope">
{{ dayjs(scope.row.updatedAt).format('YYYY-MM-DD HH:mm:ss') }} {{ dayjs(scope.row.updatedAt).format('YYYY-MM-DD HH:mm:ss') }}
@ -112,6 +119,9 @@ export default {
this.tableData.page = e - 1 this.tableData.page = e - 1
this.getTableData() this.getTableData()
}, },
goUrl(orderNo) {
this.$router.push({ path: '/order_manage/order_list', query: { orderNo } })
},
// //
resetHandle() { resetHandle() {
this.query.blurry = '' this.query.blurry = ''

View File

@ -82,12 +82,19 @@
v-if="scope.row.hasChildren || scope.row.hasChildren == false" v-if="scope.row.hasChildren || scope.row.hasChildren == false"
@change="showChanges($event, scope.row, 'proId', 'distribute')"></el-switch> @change="showChanges($event, scope.row, 'proId', 'distribute')"></el-switch>
</template> </template>
</el-table-column> <el-table-column label=""> </el-table-column>
<el-table-column label="售罄">
<template v-slot="scope"> <template v-slot="scope">
<el-switch v-model="scope.row.isPauseSale" :active-value="1" :inactive-value="0" <el-switch v-model="scope.row.isPauseSale" :active-value="1" :inactive-value="0"
@change="showChangess($event, scope.row)"></el-switch> @change="showChangess($event, scope.row)"></el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="下架">
<template v-slot="scope">
<el-switch v-model="scope.row.isGrounding" :active-value="true" :inactive-value="false"
@change="showChangesss($event, scope.row)"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" width="240px"> <el-table-column label="操作" width="240px">
<template v-slot="scope"> <template v-slot="scope">
<el-button type="text" size="mini" <el-button type="text" size="mini"
@ -128,7 +135,7 @@
</template> </template>
<script> <script>
import { stock, stockdownload, stockdoImport, stockStatewarnLine, stockStateChanges, stocks } from '@/api/invoicing' import { stock, stockdownload, stockdoImport, stockStatewarnLine, stockStateChanges, stocks, stockStateChangess } from '@/api/invoicing'
import { tbShopCategoryGet } from '@/api/shop' import { tbShopCategoryGet } from '@/api/shop'
import settings from '@/settings' import settings from '@/settings'
import invoicingDetail from './components/invoicingDetail' import invoicingDetail from './components/invoicingDetail'
@ -280,6 +287,18 @@ export default {
} }
}, },
//
async showChangesss(e, row) {
await stockStateChangess({
"isGrounding": row.isGrounding,
skuId: row.skuId,
shopId: localStorage.getItem('shopId')
})
this.$message({
type: "success",
message: "修改成功"
})
},
async getTableData() { async getTableData() {
this.tableData.loading = true this.tableData.loading = true
try { try {

View File

@ -10,11 +10,7 @@
<el-form-item label="订单状态"> <el-form-item label="订单状态">
<el-radio-group v-model="query.status"> <el-radio-group v-model="query.status">
<el-radio-button label="">全部</el-radio-button> <el-radio-button label="">全部</el-radio-button>
<el-radio-button <el-radio-button :label="item.key" v-for="item in orderEnum.status" :key="item.key">
:label="item.key"
v-for="item in orderEnum.status"
:key="item.key"
>
{{ item.label }} {{ item.label }}
</el-radio-button> </el-radio-button>
</el-radio-group> </el-radio-group>
@ -22,11 +18,7 @@
<el-form-item label="支付方式"> <el-form-item label="支付方式">
<el-radio-group v-model="query.payType"> <el-radio-group v-model="query.payType">
<el-radio-button label="">全部</el-radio-button> <el-radio-button label="">全部</el-radio-button>
<el-radio-button <el-radio-button :label="item.payType" v-for="item in payTypes" :key="item.payType">
:label="item.payType"
v-for="item in payTypes"
:key="item.payType"
>
{{ item.payName }} {{ item.payName }}
</el-radio-button> </el-radio-button>
</el-radio-group> </el-radio-group>
@ -42,31 +34,16 @@
<el-radio-button label="month">本月</el-radio-button> <el-radio-button label="month">本月</el-radio-button>
<el-radio-button label="custom">自定义</el-radio-button> <el-radio-button label="custom">自定义</el-radio-button>
</el-radio-group> </el-radio-group>
<el-date-picker <el-date-picker v-model="query.createdAt" type="daterange" range-separator="" start-placeholder="开始日期"
v-model="query.createdAt" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" v-if="timeValue == 'custom'">
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
value-format="yyyy-MM-dd HH:mm:ss"
v-if="timeValue == 'custom'"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="订单号"> <el-form-item label="订单号">
<el-input <el-input v-model="query.orderNo" placeholder="请输入订单号" style="width: 300px;"></el-input>
v-model="query.orderNo"
placeholder="请输入订单号"
style="width: 300px;"
></el-input>
<el-button type="primary" @click="getTableData">查询</el-button> <el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button> <el-button @click="resetHandle">重置</el-button>
<el-button <el-button icon="el-icon-download" v-loading="downloadLoading" @click="downloadHandle">
icon="el-icon-download"
v-loading="downloadLoading"
@click="downloadHandle"
>
<span v-if="!downloadLoading">导出Excel</span> <span v-if="!downloadLoading">导出Excel</span>
<span v-else>下载中...</span> <span v-else>下载中...</span>
</el-button> </el-button>
@ -112,20 +89,12 @@
<el-table-column label="商品信息"> <el-table-column label="商品信息">
<template v-slot="scope"> <template v-slot="scope">
<div class="goods_info"> <div class="goods_info">
<div <div class="row" v-for="item in scope.row.detailList" :key="item.id">
class="row"
v-for="item in scope.row.detailList"
:key="item.id"
>
<el-image :src="item.productImg" class="cover" lazy></el-image> <el-image :src="item.productImg" class="cover" lazy></el-image>
<div class="info"> <div class="info">
<div class="name"> <div class="name">
{{ item.productName }} {{ item.productName }}
<span <span class="refund" v-if="item.refundNumber">(退 - {{ item.refundNumber }})</span>
class="refund"
v-if="item.refundNumber"
>(退 - {{ item.refundNumber }})</span
>
</div> </div>
<div class="sku">{{ item.productSkuName }}</div> <div class="sku">{{ item.productSkuName }}</div>
</div> </div>
@ -137,12 +106,9 @@
<el-table-column label="订单金额"> <el-table-column label="订单金额">
<template v-slot="scope"> <template v-slot="scope">
<div>{{ scope.row.orderType | orderTypeFilter }}</div> <div>{{ scope.row.orderType | orderTypeFilter }}</div>
<div <div class="refund" v-if="
class="refund"
v-if="
scope.row.orderType == 'return' scope.row.orderType == 'return'
" ">
>
退款-{{ scope.row.orderAmount }} 退款-{{ scope.row.orderAmount }}
</div> </div>
<div v-else>{{ scope.row.orderAmount }}</div> <div v-else>{{ scope.row.orderAmount }}</div>
@ -150,11 +116,9 @@
</el-table-column> </el-table-column>
<el-table-column label="状态"> <el-table-column label="状态">
<template v-slot="scope"> <template v-slot="scope">
<template <template v-if="
v-if="
scope.row.status == 'refund' && scope.row.orderType != 'return' scope.row.status == 'refund' && scope.row.orderType != 'return'
" ">
>
<el-tag type="primary">已完成</el-tag> <el-tag type="primary">已完成</el-tag>
</template> </template>
<template v-else> <template v-else>
@ -174,22 +138,15 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100"> <el-table-column label="操作" width="100">
<template v-slot="scope"> <template v-slot="scope">
<el-button type="text" @click="$refs.orderDetail.show(scope.row)" <el-button type="text" @click="$refs.orderDetail.show(scope.row)">详情</el-button>
>详情</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="head-container"> <div class="head-container">
<el-pagination <el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
:total="tableData.total" @current-change="paginationChange" @size-change="sizeChange"
:current-page="tableData.page + 1" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
:page-size="tableData.size"
@current-change="paginationChange"
@size-change="sizeChange"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</div> </div>
<orderDetail ref="orderDetail" /> <orderDetail ref="orderDetail" />
</div> </div>
@ -232,6 +189,7 @@ export default {
payCountTotal: 0 payCountTotal: 0
}; };
}, },
filters: { filters: {
orderTypeFilter(t) { orderTypeFilter(t) {
if (t) { if (t) {
@ -259,12 +217,19 @@ export default {
} }
}, },
mounted() { mounted() {
if(this.$route.query.tableName){ if (this.$route.query.tableName) {
this.query.tableName = this.$route.query.tableName this.query.tableName = this.$route.query.tableName
} }
this.resetQuery = { ...this.query }; this.resetQuery = { ...this.query };
this.tbShopPayTypeGet(); this.tbShopPayTypeGet();
this.getTableData(); this.getTableData();
// --
if (this.$route.query.orderNo) {
this.query.orderNo = this.$route.query.orderNo
setTimeout(() => {
this.getTableData();
}, 200);
}
}, },
methods: { methods: {
// //