Commit 0bf39369 authored by hangjun83's avatar hangjun83

前端:百化销售订单退货功能页面

parent 6f917e07
.url-remark {
font-size: 14px;
color: #515a6e;
display: block;
color: #9a9a9a;
margin-bottom: -16px;
font-style: italic;
}
\ No newline at end of file
<style lang="less">
@import "@/styles/table-common.less";
@import "./orders.less";
</style>
<template>
<div class="search">
<Card>
<Row>
<Form ref="searchForm" :model="searchForm" inline :label-width="100">
<FormItem label="百化订单号:" prop="bhOrderNo">
<Input type="text" v-model="searchForm.bhOrderNo" clearable placeholder="请输入订单号" style="width: 200px" />
</FormItem>
<FormItem style="margin-left: -70px" class="br">
<Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button>
<Button @click="handleReset">重置</Button>
</FormItem>
</Form>
</Row>
<Table :loading="loading" :columns="columns" :data="data" sortable="custom" ref="table"></Table>
<Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator show-sizer></Page>
</Row>
</Card>
</div>
</template>
<script>
import {
getBhPordersListData,
editBhOrders
} from "@/api/index";
import util from "@/libs/util.js";
export default {
name: "menu-manage",
components: {},
data() {
return {
loading: false,
maxHeight: "500px",
selected: false,
searchForm: {
bhOrderNo: "",
pageNumber: 1,
pageSize: 10,
},
formValidate: {
bhOrderId: [{
required: true,
message: "号不能为空",
trigger: "change"
}],
},
form: {},
columns: [{
type: "index",
width: 60,
align: "center",
fixed: "left",
},
{
title: "采购订单编号",
key: "poNo",
minWidth: 145,
fixed: "left",
},
{
title: "供应商编号",
key: "supNo",
minWidth: 135,
fixed: "left",
},
{
title: "供应商订单编号",
key: "poSupOrder",
minWidth: 175,
fixed: "left",
render: (h, params) => {
return h(
"Input", {
props: {
type: 'text',
value: params.row.poSupOrder,
},
on: {
'on-blur': (event) => {
this.editSupOrder(params, event, 'poSupOrder');
},
},
},
);
},
},
{
title: "订单类型",
key: "poType",
minWidth: 125,
},
{
title: "付款类型",
key: "poPayType",
minWidth: 125,
},
{
title: "审核状态",
key: "poReviewStatus",
minWidth: 125,
},
{
title: "订单金额",
key: "poTotal",
minWidth: 125,
},
{
title: "是否直发",
key: "poIfDirect",
minWidth: 125,
fixed: "left",
render: (h, params) => {
return h('Select', {
props: {
value: params.row.poIfDirect,
label: params.row.poIfDirectLabel,
transfer: true //解决table中被遮挡
},
on: {
'on-change': e => {
this.editSupOrder(params, e, 'poIfDirect');
}
}
},
[
h('Option', {
props: {
value: '0',
}
}, ''),
h('Option', {
props: {
value: '1',
}
}, '')
]
)
},
},
{
title: "开票状态",
key: "poInvoiceStatus",
minWidth: 125,
},
{
title: "已开票金额",
key: "poInvoiceAmount",
minWidth: 180,
},
],
submitLoading: false,
data: [],
total: 0,
ifDirectValue: null
};
},
methods: {
getDataList() {
// 多条件搜索用户列表
this.loading = true;
getBhPordersListData(this.searchForm).then((res) => {
this.loading = false;
if (res.status == 'success') {
this.data = res.data.list;
this.total = res.data.total;
if (this.data.length == 0 && this.searchForm.pageNumber > 1) {
this.searchForm.pageNumber -= 1;
this.getDataList();
}
}
});
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
handleReset() {
this.$refs.searchForm.resetFields();
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.selectDate = null;
this.searchForm.startDate = "";
this.searchForm.endDate = "";
this.selectDep = [];
// 重新加载数据
this.getDataList();
},
changePage(v) {
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
selectDateRange(v) {
if (v) {
this.searchForm.startDate = v[0];
this.searchForm.endDate = v[1];
}
},
editSupOrder(v, e, type) {
if (type == 'poSupOrder') {
if (e.target.value == v.row.poSupOrder) {
return;
}
this.form.poSupOrder = e.target.value
} else {
if (this.ifDirectValue != null && this.ifDirectValue == e) {
return;
} else {
if (e == undefined) {
return;
}
this.ifDirectValue = e;
this.form.poIfDirect = e
}
}
this.form.poNo = v.row.poNo
editBhOrders(this.form).then((res) => {
this.loading = false;
if (res.status == 'success') {
this.$Message.success("操作成功");
this.getDataList();
}
});
}
},
mounted() {
// 计算高度
let height = document.documentElement.clientHeight;
this.maxHeight = Number(height - 287) + "px";
},
};
</script>
.url-remark {
font-size: 14px;
color: #515a6e;
display: block;
color: #9a9a9a;
margin-bottom: -16px;
font-style: italic;
}
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment