✨ feat: 家具初版
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="客户名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
@@ -18,18 +18,19 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户来源" prop="source">
|
||||
<el-select v-model="queryParams.source" placeholder="请选择客户来源" clearable>
|
||||
<el-select v-model="queryParams.source" placeholder="请选择客户来源" style="width: 150px;" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.customer_from"
|
||||
v-for="dict in customer_from"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
<!-- <el-input v-model="queryParams.source" placeholder="请输入客户来源" clearable @keyup.enter.native="handleQuery" /> -->
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" icon="Search" size="small" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" size="small" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -38,8 +39,8 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
icon="Plus"
|
||||
size="small"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
@@ -47,8 +48,8 @@
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
icon="Edit"
|
||||
size="small"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
@@ -57,8 +58,8 @@
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
icon="Delete"
|
||||
size="small"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
@@ -67,17 +68,17 @@
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
icon="Download"
|
||||
size="small"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<KLPTable v-loading="loading" :data="customerList" @selection-change="handleSelectionChange" :customColumns="customColumns">
|
||||
<el-table v-loading="loading" :data="customerList" @selection-change="handleSelectionChange" :customColumns="customColumns">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column label="编号,主键自增" align="center" prop="customerId" v-if="false"/>
|
||||
<el-table-column label="编号,主键自增" align="center" prop="customerId" v-if="false"/>
|
||||
<el-table-column label="客户名称" align="center" prop="name" />
|
||||
<el-table-column label="手机" align="center" prop="mobile" />
|
||||
<el-table-column label="电话" align="center" prop="telephone" />
|
||||
@@ -88,28 +89,28 @@
|
||||
<el-table-column label="详细地址" align="center" prop="detailAddress" />
|
||||
<el-table-column label="客户等级" align="center" prop="level" />
|
||||
<el-table-column label="客户来源" align="center" prop="source">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.customer_from" :value="scope.row.source"/>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="customer_from" :value="scope.row.source"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
size="small"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
size="small"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</KLPTable>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
@@ -120,7 +121,7 @@
|
||||
/>
|
||||
|
||||
<!-- 添加或修改CRM 客户对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="客户名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入客户名称" />
|
||||
@@ -152,12 +153,13 @@
|
||||
<el-form-item label="客户来源" prop="source">
|
||||
<el-select v-model="form.source" placeholder="请选择客户来源">
|
||||
<el-option
|
||||
v-for="dict in dict.type.customer_from"
|
||||
v-for="dict in customer_from"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="parseInt(dict.value)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<!-- <el-input v-model="form.source" placeholder="请输入客户来源" /> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
@@ -173,74 +175,76 @@
|
||||
|
||||
<script>
|
||||
import { listCustomer, getCustomer, delCustomer, addCustomer, updateCustomer } from "@/api/wms/customer";
|
||||
import KLPTable from '@/components/KLPUI/KLPTable/index.vue';
|
||||
|
||||
export default {
|
||||
name: "Customer",
|
||||
dicts: ['customer_from'],
|
||||
components: {
|
||||
KLPTable
|
||||
setup() {
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { customer_from } = proxy.useDict("customer_from");
|
||||
return {
|
||||
customer_from
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
customColumns: [
|
||||
{
|
||||
label: '客户名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
label: '手机',
|
||||
prop: 'mobile'
|
||||
},
|
||||
{
|
||||
label: '电话',
|
||||
prop: 'telephone'
|
||||
},
|
||||
{
|
||||
label: 'QQ',
|
||||
prop: 'qq'
|
||||
},
|
||||
{
|
||||
label: '微信',
|
||||
prop: 'wechat'
|
||||
},
|
||||
{
|
||||
label: '邮箱',
|
||||
prop: 'email'
|
||||
},
|
||||
{
|
||||
label: '地区编号',
|
||||
prop: 'areaId'
|
||||
},
|
||||
{
|
||||
label: '详细地址',
|
||||
prop: 'detailAddress',
|
||||
eclipse: true
|
||||
},
|
||||
{
|
||||
label: '客户等级',
|
||||
prop: 'level'
|
||||
},
|
||||
{
|
||||
label: '客户来源',
|
||||
prop: 'source'
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark'
|
||||
},
|
||||
{
|
||||
label: '操作',
|
||||
width: 150,
|
||||
fixed: 'right',
|
||||
render: (h, row) => {
|
||||
const actions = [];
|
||||
actions.push(<el-button type="text" size="mini" icon="el-icon-edit" onClick={() => this.handleUpdate(row)}>修改</el-button>)
|
||||
actions.push(<el-button type="text" size="mini" icon="el-icon-delete" onClick={() => this.handleDelete(row)}>删除</el-button>)
|
||||
return actions;
|
||||
}
|
||||
}
|
||||
],
|
||||
// customColumns: [
|
||||
// {
|
||||
// label: '客户名称',
|
||||
// prop: 'name'
|
||||
// },
|
||||
// {
|
||||
// label: '手机',
|
||||
// prop: 'mobile'
|
||||
// },
|
||||
// {
|
||||
// label: '电话',
|
||||
// prop: 'telephone'
|
||||
// },
|
||||
// {
|
||||
// label: 'QQ',
|
||||
// prop: 'qq'
|
||||
// },
|
||||
// {
|
||||
// label: '微信',
|
||||
// prop: 'wechat'
|
||||
// },
|
||||
// {
|
||||
// label: '邮箱',
|
||||
// prop: 'email'
|
||||
// },
|
||||
// {
|
||||
// label: '地区编号',
|
||||
// prop: 'areaId'
|
||||
// },
|
||||
// {
|
||||
// label: '详细地址',
|
||||
// prop: 'detailAddress',
|
||||
// eclipse: true
|
||||
// },
|
||||
// {
|
||||
// label: '客户等级',
|
||||
// prop: 'level'
|
||||
// },
|
||||
// {
|
||||
// label: '客户来源',
|
||||
// prop: 'source'
|
||||
// },
|
||||
// {
|
||||
// label: '备注',
|
||||
// prop: 'remark'
|
||||
// },
|
||||
// {
|
||||
// label: '操作',
|
||||
// width: 150,
|
||||
// fixed: 'right',
|
||||
// render: (h, row) => {
|
||||
// const actions = [];
|
||||
// actions.push(<el-button type="text" size="small" icon="el-icon-edit" onClick={() => this.handleUpdate(row)}>修改</el-button>)
|
||||
// actions.push(<el-button type="text" size="small" icon="el-icon-delete" onClick={() => this.handleDelete(row)}>删除</el-button>)
|
||||
// return actions;
|
||||
// }
|
||||
// }
|
||||
// ],
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="日期" prop="journalDate">
|
||||
<el-date-picker clearable v-model="queryParams.journalDate" type="date" value-format="yyyy-MM-dd"
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<!-- <el-form-item label="日期" prop="journalDate">
|
||||
<el-date-picker clearable v-model="queryParams.journalDate" type="date" value-format="YYYY-MM-DD"
|
||||
placeholder="请选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="摘要" prop="summary">
|
||||
<el-input v-model="queryParams.summary" placeholder="请输入摘要" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
@@ -15,46 +15,35 @@
|
||||
<el-form-item label="对方户名" prop="counterpart">
|
||||
<el-input v-model="queryParams.counterpart" placeholder="请输入对方户名" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收入金额" prop="incomeAmount">
|
||||
<el-input v-model="queryParams.incomeAmount" placeholder="请输入收入金额" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="支出金额" prop="expenseAmount">
|
||||
<el-input v-model="queryParams.expenseAmount" placeholder="请输入支出金额" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="余额" prop="balanceAmount">
|
||||
<el-input v-model="queryParams.balanceAmount" placeholder="请输入余额" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" icon="Search" size="small" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" size="small" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" size="small" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
|
||||
<el-button type="success" plain icon="Edit" size="small" :disabled="single"
|
||||
@click="handleUpdate">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
|
||||
<el-button type="danger" plain icon="Delete" size="small" :disabled="multiple"
|
||||
@click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||
<el-button type="warning" plain icon="Download" size="small" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<KLPTable v-loading="loading" :data="journalList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="journalList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键ID" align="center" prop="journalId" v-if="false" />
|
||||
<el-table-column label="日期" align="center" prop="journalDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.journalDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -63,7 +52,7 @@
|
||||
<el-table-column label="对方户名" align="center" prop="counterpart" />
|
||||
<el-table-column label="收入金额" align="center" prop="incomeAmount">
|
||||
<!-- 如果不是0用绿字展示,否则用正常颜色 -->
|
||||
<template slot-scope="scope">
|
||||
<template #default="scope">
|
||||
<span :style="Number(scope.row.incomeAmount) !== 0 ? { color: '#28a745' } : {}">
|
||||
{{ scope.row.incomeAmount }}
|
||||
</span>
|
||||
@@ -71,7 +60,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="支出金额" align="center" prop="expenseAmount">
|
||||
<!-- 如果不是0用红字展示,否则用正常颜色 -->
|
||||
<template slot-scope="scope">
|
||||
<template #default="scope">
|
||||
<span :style="Number(scope.row.expenseAmount) !== 0 ? { color: '#dc3545' } : {}">
|
||||
{{ scope.row.expenseAmount }}
|
||||
</span>
|
||||
@@ -80,21 +69,21 @@
|
||||
<el-table-column label="余额" align="center" prop="balanceAmount" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
<template #default="scope">
|
||||
<el-button size="small" type="text" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="small" type="text" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</KLPTable>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 添加或修改资金日记账对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="日期" prop="journalDate">
|
||||
<el-date-picker clearable v-model="form.journalDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
<el-date-picker clearable v-model="form.journalDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="请选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<OrderPage :isPre="false" />
|
||||
<OrderPage tradeType="0" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,26 +2,27 @@
|
||||
<div>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" size="mini" :disabled="!canEdit"
|
||||
<el-button type="primary" plain icon="Plus" size="small" :disabled="!canEdit"
|
||||
@click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" size="mini" :disabled="single || !canEdit"
|
||||
<el-button type="success" plain icon="Edit" size="small" :disabled="single || !canEdit"
|
||||
@click="handleUpdate">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" size="mini" :disabled="multiple || !canEdit"
|
||||
<el-button type="danger" plain icon="Delete" size="small" :disabled="multiple || !canEdit"
|
||||
@click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" size="mini" @click="handleExport">导出</el-button>
|
||||
<el-button type="warning" plain icon="Download" size="small" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<KLPTable v-loading="loading" :data="orderDetailList">
|
||||
<el-table v-loading="loading" :data="orderDetailList">
|
||||
<el-table-column label="订单明细ID" align="center" prop="detailId" v-if="true"/>
|
||||
<el-table-column label="产品" align="center">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo :product-id="scope.row.productId">
|
||||
<template #default="scope">
|
||||
<ProductInfo :productId="scope.row.productId">
|
||||
<template #default="{ product }">
|
||||
{{ product.productName }}<span v-if="product.productCode">({{ product.productCode }})</span>
|
||||
</template>
|
||||
@@ -29,7 +30,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="BOM" align="center">
|
||||
<template slot-scope="scope">
|
||||
<template #default="scope">
|
||||
<BomInfoMini item-type="product" :item-id="scope.row.productId" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -39,14 +40,14 @@
|
||||
<el-table-column label="无税单价" align="center" prop="noTaxPrice" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="Edit"
|
||||
<template #default="scope">
|
||||
<el-button size="small" type="text" icon="Edit"
|
||||
@click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="Delete"
|
||||
<el-button size="small" type="text" icon="Delete"
|
||||
@click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</KLPTable>
|
||||
</el-table>
|
||||
|
||||
<!-- 添加或修改订单明细对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
@@ -58,7 +59,7 @@
|
||||
<el-input v-model="form.quantity" placeholder="请输入产品数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="单位" :disabled="true" />
|
||||
<el-input v-model="form.unit" placeholder="单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="含税单价" prop="taxPrice">
|
||||
<el-input-number :controls=false controls-position="right" v-model="form.taxPrice" placeholder="请输入含税单价" />
|
||||
@@ -82,7 +83,7 @@
|
||||
<script>
|
||||
import { listOrderDetail, getOrderDetail, delOrderDetail, addOrderDetail, updateOrderDetail } from "@/api/wms/orderDetail";
|
||||
import { getOrder } from "@/api/wms/order";
|
||||
import ProductSelect from '@/components/Selector/ProductSelect';
|
||||
import ProductSelect from '@/components/ProductSelect';
|
||||
import { EOrderStatus } from "@/utils/enums";
|
||||
import ProductInfo from '@/components/Renderer/ProductInfo.vue';
|
||||
import BomInfoMini from '@/components/Renderer/BomInfoMini.vue';
|
||||
@@ -132,9 +133,6 @@ export default {
|
||||
orderId: [
|
||||
{ required: true, message: "订单ID不能为空", trigger: "blur" }
|
||||
],
|
||||
productId: [
|
||||
{ required: true, message: "产品ID不能为空", trigger: "blur" }
|
||||
],
|
||||
quantity: [
|
||||
{ required: true, message: "产品数量不能为空", trigger: "blur" },
|
||||
{ pattern: /^[1-9]\d*$/, message: "产品数量必须为正整数", trigger: "blur" }
|
||||
@@ -234,6 +232,7 @@ export default {
|
||||
});
|
||||
},
|
||||
onProductChange(product) {
|
||||
console.log(product, '切换产品');
|
||||
if (product) {
|
||||
this.form.unit = product.unit;
|
||||
} else {
|
||||
|
||||
@@ -5,40 +5,32 @@
|
||||
<!-- 左侧:使用klp-list组件(占6列) -->
|
||||
<el-col :span="6" style="display: table-cell;">
|
||||
<!-- 搜索表单 - 精简搜索项 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"
|
||||
class="mb-4">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="16">
|
||||
<el-input v-model="queryParams.orderCode" placeholder="请输入订单编号" clearable
|
||||
@change="handleQuery" />
|
||||
<el-input v-model="queryParams.orderCode" placeholder="请输入订单编号" clearable @change="handleQuery" />
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
class="w-full">新增订单</el-button>
|
||||
<el-button type="primary" plain icon="Plus" size="small" @click="handleAdd" class="w-full">新增订单</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<!-- klp-list组件 -->
|
||||
<klp-list
|
||||
:list-data="orderList"
|
||||
:model-value="selectedIds"
|
||||
title-field="orderCode"
|
||||
list-key="orderId"
|
||||
title-label="订单编号"
|
||||
:loading="loading"
|
||||
@item-click="handleRowClick"
|
||||
>
|
||||
<klp-list :list-data="orderList" :model-value="selectedIds" title-field="orderCode" list-key="orderId"
|
||||
title-label="订单编号" :loading="loading" @item-click="handleRowClick">
|
||||
<!-- 自定义操作按钮 -->
|
||||
<template #actions="{ item }">
|
||||
<!-- 删除按钮 -->
|
||||
<el-button size="mini" type="text" style="color: red" icon="el-icon-delete" @click.stop="handleDelete(item)"></el-button>
|
||||
<el-button size="small" type="text" style="color: red" icon="el-icon-delete"
|
||||
@click.stop="handleDelete(item)"></el-button>
|
||||
</template>
|
||||
</klp-list>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" class="mt-4" />
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" class="mt-4" layout="total, pager" />
|
||||
</el-col>
|
||||
|
||||
<!-- 右侧:详情区(占18列) -->
|
||||
@@ -58,47 +50,48 @@
|
||||
<el-form ref="detailForm" :model="form" :rules="rules" label-width="80px" size="small" class="mt-4">
|
||||
<el-form-item label="订单ID" prop="orderId">
|
||||
<el-input style="width: 60%;" v-model="form.orderId" placeholder="无" disabled>
|
||||
<el-button style="padding: -1;" slot="append" size="mini" type="text" icon="el-icon-document-copy"
|
||||
<el-button style="padding: -1;" slot="append" size="small" type="text" icon="el-icon-document-copy"
|
||||
@click.stop="copyOrderId(form.orderId)"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="订单编号" prop="orderCode">
|
||||
<el-input style="width: 60%;" v-model="form.orderCode" placeholder="无" disabled />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="客户名称" prop="customerId">
|
||||
<customer-select style="width: 60%;" v-model="form.customerId" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="销售经理" prop="salesManager">
|
||||
<el-input style="width: 60%;" v-model="form.salesManager" placeholder="无" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="含税金额" prop="taxAmount">
|
||||
<el-input-number style="width: 60%;" :controls="false" v-model="form.taxAmount" placeholder="0.00" precision="2"
|
||||
:min="0" />
|
||||
<el-input-number style="width: 60%;" :controls="false" v-model="form.taxAmount" placeholder="0.00"
|
||||
precision="2" :min="0" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="无税金额" prop="noTaxAmount">
|
||||
<el-input-number style="width: 60%;" :controls="false" v-model="form.noTaxAmount" placeholder="0.00" precision="2"
|
||||
:min="0" />
|
||||
<el-input-number style="width: 60%;" :controls="false" v-model="form.noTaxAmount" placeholder="0.00"
|
||||
precision="2" :min="0" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="订单状态" prop="orderStatus">
|
||||
<el-select style="width: 60%;" v-model="form.orderStatus" @change="handleOrderStatusChange" size="mini">
|
||||
<el-option v-for="item in dict.type.order_status" :key="item.value" :label="item.label"
|
||||
<el-select style="width: 60%;" v-model="form.orderStatus" @change="handleOrderStatusChange"
|
||||
size="small">
|
||||
<el-option v-for="item in order_status" :key="item.value" :label="item.label"
|
||||
:value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input style="width: 60%;" v-model="form.remark" placeholder="无" type="textarea" rows="4" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 更新按钮 -->
|
||||
<el-form-item class="text-right">
|
||||
<el-button type="primary" size="mini" :loading="buttonLoading"
|
||||
<el-button type="primary" size="small" :loading="buttonLoading"
|
||||
@click="submitDetailForm">更新订单信息</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -110,6 +103,12 @@
|
||||
<OrderDetailPanel :orderId="selectedOrderId" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="退换货" name="returnExchange">
|
||||
<div class="mt-4">
|
||||
<ReturnExchange :orderId="selectedOrderId" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
@@ -117,7 +116,7 @@
|
||||
</el-row>
|
||||
|
||||
<!-- 新增订单弹窗 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
|
||||
<el-form ref="addForm" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
@@ -137,8 +136,8 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="含税金额" prop="taxAmount">
|
||||
<el-input-number :controls="false" style="width: 100%;" v-model="form.taxAmount" placeholder="请输入含税金额" precision="2"
|
||||
:min="0" />
|
||||
<el-input-number :controls="false" style="width: 100%;" v-model="form.taxAmount" placeholder="请输入含税金额"
|
||||
precision="2" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -163,22 +162,33 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getOrder, delOrder, addOrder, updateOrder, listByStatus } from "@/api/wms/order";
|
||||
import { getOrder, delOrder, addOrder, updateOrder, listOrder } from "@/api/wms/order";
|
||||
import OrderDetailPanel from './detail.vue';
|
||||
import { EOrderStatus } from "@/utils/enums";
|
||||
import CustomerSelect from '@/components/KLPService/CustomerSelect/index.vue';
|
||||
import klpList from "@/components/KLPUI/KLPList/index.vue";
|
||||
import CustomerSelect from '@/components/CustomerSelect/index.vue';
|
||||
import klpList from "@/components/GearList/index.vue";
|
||||
import { getCurrentInstance } from "vue";
|
||||
import ReturnExchange from './return.vue';
|
||||
|
||||
export default {
|
||||
name: "Order",
|
||||
components: { OrderDetailPanel, CustomerSelect, klpList },
|
||||
dicts: ['order_status'],
|
||||
components: { OrderDetailPanel, CustomerSelect, klpList, ReturnExchange },
|
||||
props: {
|
||||
tradeType: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
setup() {
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { order_status } = proxy.useDict("order_status");
|
||||
|
||||
console.log(order_status);
|
||||
|
||||
return {
|
||||
order_status
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
orderQueryStatus() {
|
||||
return 0
|
||||
@@ -215,7 +225,6 @@ export default {
|
||||
orderCode: undefined,
|
||||
customerId: undefined,
|
||||
salesManager: undefined,
|
||||
orderStatus: undefined,
|
||||
tradeType: this.tradeType
|
||||
},
|
||||
// 表单参数
|
||||
@@ -224,7 +233,6 @@ export default {
|
||||
orderCode: undefined,
|
||||
customerId: undefined,
|
||||
salesManager: undefined,
|
||||
orderStatus: undefined,
|
||||
tradeType: this.tradeType,
|
||||
remark: undefined,
|
||||
delFlag: undefined,
|
||||
@@ -263,7 +271,7 @@ export default {
|
||||
/** 查询订单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listByStatus(this.queryParams).then(response => {
|
||||
listOrder(this.queryParams).then(response => {
|
||||
this.orderList = response.rows;
|
||||
this.total = response.total;
|
||||
|
||||
@@ -285,7 +293,7 @@ export default {
|
||||
handleRowClick(item) {
|
||||
this.selectedOrderId = item.orderId;
|
||||
this.loadOrderDetail(item.orderId);
|
||||
},
|
||||
},
|
||||
|
||||
/** 加载订单详情 */
|
||||
loadOrderDetail(orderId) {
|
||||
|
||||
267
gear-ui3/src/views/oms/order/panels/return.vue
Normal file
267
gear-ui3/src/views/oms/order/panels/return.vue
Normal file
@@ -0,0 +1,267 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="returnExchangeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="退换货ID" align="center" prop="returnExchangeId" v-if="false"/>
|
||||
<el-table-column label="关联订单明细ID" align="center" prop="orderDetailId" />
|
||||
<el-table-column label="客户" align="center" prop="customerName" />
|
||||
<el-table-column label="产品" align="center" prop="productName" />
|
||||
<el-table-column label="类型" align="center" prop="type" />
|
||||
<el-table-column label="原因" align="center" prop="reason" />
|
||||
<el-table-column label="状态" align="center" prop="status" />
|
||||
<el-table-column label="涉及金额" align="center" prop="amount" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改退换货管理对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="returnExchangeRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="关联订单明细ID" prop="orderDetailId">
|
||||
<el-input v-model="form.orderDetailId" placeholder="请输入关联订单明细ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户ID" prop="customerId">
|
||||
<CustomerSelect v-model="form.customerId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="原因" prop="reason">
|
||||
<el-input v-model="form.reason" placeholder="请输入原因" />
|
||||
</el-form-item>
|
||||
<el-form-item label="涉及金额" prop="amount">
|
||||
<el-input v-model="form.amount" placeholder="请输入涉及金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-input v-model="form.type" placeholder="请输入类型" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="ReturnExchange">
|
||||
import { listReturnExchange, getReturnExchange, delReturnExchange, addReturnExchange, updateReturnExchange } from "@/api/oa/returnExchange";
|
||||
import CustomerSelect from '@/components/CustomerSelect/index.vue';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const props = defineProps({
|
||||
orderId: {
|
||||
type: [String, Number],
|
||||
required: true
|
||||
}
|
||||
});
|
||||
|
||||
const returnExchangeList = ref([]);
|
||||
const open = ref(false);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const formatterTime = (time) => {
|
||||
return proxy.parseTime(time, '{y}-{m}-{d}')
|
||||
}
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
orderId: props.orderId,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orderDetailId: undefined,
|
||||
customerId: undefined,
|
||||
type: undefined,
|
||||
reason: undefined,
|
||||
status: undefined,
|
||||
amount: undefined,
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询退换货管理列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listReturnExchange(queryParams.value).then(response => {
|
||||
returnExchangeList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
returnExchangeId: null,
|
||||
orderDetailId: null,
|
||||
customerId: null,
|
||||
type: null,
|
||||
reason: null,
|
||||
status: null,
|
||||
amount: null,
|
||||
delFlag: null,
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
updateTime: null,
|
||||
updateBy: null
|
||||
};
|
||||
proxy.resetForm("returnExchangeRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.returnExchangeId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加退换货管理";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
loading.value = true
|
||||
reset();
|
||||
const _returnExchangeId = row.returnExchangeId || ids.value
|
||||
getReturnExchange(_returnExchangeId).then(response => {
|
||||
loading.value = false;
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改退换货管理";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["returnExchangeRef"].validate(valid => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.returnExchangeId != null) {
|
||||
updateReturnExchange(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
}).finally(() => {
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
} else {
|
||||
addReturnExchange(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
}).finally(() => {
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _returnExchangeIds = row.returnExchangeId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除退换货管理编号为"' + _returnExchangeIds + '"的数据项?').then(function() {
|
||||
loading.value = true;
|
||||
return delReturnExchange(_returnExchangeIds);
|
||||
}).then(() => {
|
||||
loading.value = true;
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('oa/returnExchange/export', {
|
||||
...queryParams.value
|
||||
}, `returnExchange_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<OrderPage :isPre="false" />
|
||||
<OrderPage tradeType="1" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
245
gear-ui3/src/views/oms/otherIncome/index.vue
Normal file
245
gear-ui3/src/views/oms/otherIncome/index.vue
Normal file
@@ -0,0 +1,245 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="收入来源" prop="source">
|
||||
<el-input v-model="queryParams.source" placeholder="请输入收入来源" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收入类型" prop="incomeType">
|
||||
<el-input v-model="queryParams.incomeType" placeholder="请输入收入类型" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="otherIncomeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="其他收入ID" align="center" prop="otherIncomeId" v-if="false" />
|
||||
<el-table-column label="收入日期" align="center" prop="incomeDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ formatterTime(scope.row.incomeDate) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收入类型" align="center" prop="incomeType" />
|
||||
<el-table-column label="收入金额" align="center" prop="amount" />
|
||||
<el-table-column label="收入来源" align="center" prop="source" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 添加或修改其他收入对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="otherIncomeRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="收入日期" prop="incomeDate">
|
||||
<el-date-picker clearable v-model="form.incomeDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="请选择收入日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="收入类型" prop="incomeType">
|
||||
<el-input v-model="form.incomeType" placeholder="请输入收入类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收入金额" prop="amount">
|
||||
<el-input v-model="form.amount" placeholder="请输入收入金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收入来源" prop="source">
|
||||
<el-input v-model="form.source" placeholder="请输入收入来源" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="OtherIncome">
|
||||
import { listOtherIncome, getOtherIncome, delOtherIncome, addOtherIncome, updateOtherIncome } from "@/api/oa/otherIncome";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const otherIncomeList = ref([]);
|
||||
const open = ref(false);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const formatterTime = (time) => {
|
||||
return proxy.parseTime(time, '{y}-{m}-{d}')
|
||||
}
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
incomeDate: undefined,
|
||||
incomeType: undefined,
|
||||
amount: undefined,
|
||||
source: undefined,
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询其他收入列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listOtherIncome(queryParams.value).then(response => {
|
||||
otherIncomeList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
otherIncomeId: null,
|
||||
incomeDate: null,
|
||||
incomeType: null,
|
||||
amount: null,
|
||||
source: null,
|
||||
remark: null,
|
||||
delFlag: null,
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
updateTime: null,
|
||||
updateBy: null
|
||||
};
|
||||
proxy.resetForm("otherIncomeRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.otherIncomeId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加其他收入";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
loading.value = true
|
||||
reset();
|
||||
const _otherIncomeId = row.otherIncomeId || ids.value
|
||||
getOtherIncome(_otherIncomeId).then(response => {
|
||||
loading.value = false;
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改其他收入";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["otherIncomeRef"].validate(valid => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.otherIncomeId != null) {
|
||||
updateOtherIncome(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
}).finally(() => {
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
} else {
|
||||
addOtherIncome(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
}).finally(() => {
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _otherIncomeIds = row.otherIncomeId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除其他收入编号为"' + _otherIncomeIds + '"的数据项?').then(function () {
|
||||
loading.value = true;
|
||||
return delOtherIncome(_otherIncomeIds);
|
||||
}).then(() => {
|
||||
loading.value = true;
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('oa/otherIncome/export', {
|
||||
...queryParams.value
|
||||
}, `otherIncome_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
<VendorSelect v-model="queryParams.supplierId" />
|
||||
</el-form-item>
|
||||
@@ -16,13 +16,13 @@
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.dueDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择到期日">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" icon="Search" size="small" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" size="small" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
icon="Plus"
|
||||
size="small"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
@@ -40,8 +40,8 @@
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
icon="Edit"
|
||||
size="small"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
@@ -50,8 +50,8 @@
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
icon="Delete"
|
||||
size="small"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
@@ -60,21 +60,21 @@
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
icon="Download"
|
||||
size="small"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<KLPTable v-loading="loading" :data="payableList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="payableList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="应付ID" align="center" prop="payableId" v-if="false"/>
|
||||
<el-table-column label="供应商" align="center" prop="supplierName" />
|
||||
<el-table-column label="订单ID" align="center" prop="orderId" />
|
||||
<el-table-column label="到期日" align="center" prop="dueDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.dueDate, '{y}-{m}-{d}') }}</span>
|
||||
<el-tag v-if="new Date(scope.row.dueDate) < new Date()" type="danger">过期</el-tag>
|
||||
<el-tag v-else-if="new Date(scope.row.dueDate) > new Date()" type="success">还剩{{ parseInt((new Date(scope.row.dueDate) - new Date()) / (1000 * 60 * 60 * 24)) }}天</el-tag>
|
||||
@@ -86,28 +86,28 @@
|
||||
<el-table-column label="状态" align="center" prop="status" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
size="small"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
size="small"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
size="small"
|
||||
type="text"
|
||||
icon="el-icon-money"
|
||||
icon="Money"
|
||||
@click="handlePay(scope.row)"
|
||||
>付款</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</KLPTable>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
@@ -118,7 +118,7 @@
|
||||
/>
|
||||
|
||||
<!-- 添加或修改应付款管理(宽松版)对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="供应商ID" prop="supplierId">
|
||||
<VendorSelect v-model="form.supplierId" />
|
||||
@@ -130,7 +130,7 @@
|
||||
<el-date-picker clearable
|
||||
v-model="form.dueDate"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="请选择到期日">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
@@ -153,7 +153,7 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="付款" :visible.sync="payOpen" width="500px" append-to-body>
|
||||
<el-dialog title="付款" v-model="payOpen" width="500px" append-to-body>
|
||||
<el-form ref="payForm" :model="payForm" :rules="rules" label-width="80px">
|
||||
<el-form-item label="付款金额" prop="amount">
|
||||
<el-input-number :controls=false controls-position="right" v-model="payForm.amount" :step="1.00" :precision="2" placeholder="请输入付款金额" :min="0" :max="payForm.balanceAmount" style="width: 100%;"/>
|
||||
@@ -169,7 +169,7 @@
|
||||
|
||||
<script>
|
||||
import { listPayable, getPayable, delPayable, addPayable, updatePayable, updatePaidAmount } from "@/api/finance/payable";
|
||||
import VendorSelect from '@/components/KLPService/VendorSelect/index.vue';
|
||||
import VendorSelect from '@/components/VendorSelect/index.vue';
|
||||
|
||||
export default {
|
||||
name: "Payable",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="客户名称" prop="customerId">
|
||||
<CustomerSelect v-model="queryParams.customerId" />
|
||||
</el-form-item>
|
||||
@@ -16,13 +16,13 @@
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.dueDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择到期日">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" icon="Search" size="small" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" size="small" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
icon="Plus"
|
||||
size="small"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
@@ -40,8 +40,8 @@
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
icon="Edit"
|
||||
size="small"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
@@ -50,8 +50,8 @@
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
icon="Delete"
|
||||
size="small"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
@@ -60,21 +60,21 @@
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
icon="Download"
|
||||
size="small"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<KLPTable v-loading="loading" :data="receivableList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="receivableList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="应收ID" align="center" prop="receivableId" v-if="false"/>
|
||||
<el-table-column label="客户" align="center" prop="customerName" />
|
||||
<el-table-column label="订单ID" align="center" prop="orderId" />
|
||||
<el-table-column label="到期日" align="center" prop="dueDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.dueDate, '{y}-{m}-{d}') }}</span>
|
||||
<el-tag v-if="new Date(scope.row.dueDate) < new Date()" type="danger">过期</el-tag>
|
||||
<el-tag v-else-if="new Date(scope.row.dueDate) > new Date()" type="success">还剩{{ parseInt((new Date(scope.row.dueDate) - new Date()) / (1000 * 60 * 60 * 24)) }}天</el-tag>
|
||||
@@ -86,28 +86,28 @@
|
||||
<el-table-column label="状态" align="center" prop="status" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
size="small"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
size="small"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
size="small"
|
||||
type="text"
|
||||
icon="el-icon-money"
|
||||
icon="Money"
|
||||
@click="handleReceive(scope.row)"
|
||||
>收款</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</KLPTable>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
@@ -118,7 +118,7 @@
|
||||
/>
|
||||
|
||||
<!-- 添加或修改应收款管理(宽松版)对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="客户ID" prop="customerId">
|
||||
<CustomerSelect v-model="form.customerId" />
|
||||
@@ -130,7 +130,7 @@
|
||||
<el-date-picker clearable
|
||||
v-model="form.dueDate"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="请选择到期日">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
@@ -153,7 +153,7 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="收款" :visible.sync="receiveOpen" width="500px" append-to-body>
|
||||
<el-dialog title="收款" v-model="receiveOpen" width="500px" append-to-body>
|
||||
<el-form ref="receiveForm" :model="receiveForm" :rules="rules" label-width="80px">
|
||||
<el-form-item label="收款金额" prop="amount">
|
||||
<el-input-number :controls=false controls-position="right" v-model="receiveForm.amount" :step="1.00" :precision="2" placeholder="请输入收款金额" :min="0" :max="receiveForm.balanceAmount" style="width: 100%;"/>
|
||||
@@ -169,7 +169,7 @@
|
||||
|
||||
<script>
|
||||
import { listReceivable, getReceivable, delReceivable, addReceivable, updateReceivable, updatePaidAmount } from "@/api/finance/receivable";
|
||||
import CustomerSelect from '@/components/KLPService/CustomerSelect/index.vue';
|
||||
import CustomerSelect from '@/components/CustomerSelect/index.vue';
|
||||
|
||||
export default {
|
||||
name: "Receivable",
|
||||
|
||||
280
gear-ui3/src/views/oms/returnExchange/index.vue
Normal file
280
gear-ui3/src/views/oms/returnExchange/index.vue
Normal file
@@ -0,0 +1,280 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="客户" prop="customerId">
|
||||
<CustomerSelect v-model="queryParams.customerId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="原因" prop="reason">
|
||||
<el-input
|
||||
v-model="queryParams.reason"
|
||||
placeholder="请输入原因"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-input v-model="queryParams.type" placeholder="请输入类型" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="returnExchangeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="退换货ID" align="center" prop="returnExchangeId" v-if="false"/>
|
||||
<el-table-column label="关联订单明细ID" align="center" prop="orderDetailId" />
|
||||
<el-table-column label="产品" align="center" prop="productName" />
|
||||
<el-table-column label="客户" align="center" prop="customerName" />
|
||||
<el-table-column label="类型" align="center" prop="type" />
|
||||
<el-table-column label="原因" align="center" prop="reason" />
|
||||
<el-table-column label="状态" align="center" prop="status" />
|
||||
<el-table-column label="涉及金额" align="center" prop="amount" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改退换货管理对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="returnExchangeRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="关联订单明细ID" prop="orderDetailId">
|
||||
<el-input v-model="form.orderDetailId" placeholder="请输入关联订单明细ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户ID" prop="customerId">
|
||||
<CustomerSelect v-model="form.customerId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="原因" prop="reason">
|
||||
<el-input v-model="form.reason" placeholder="请输入原因" />
|
||||
</el-form-item>
|
||||
<el-form-item label="涉及金额" prop="amount">
|
||||
<el-input v-model="form.amount" placeholder="请输入涉及金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-input v-model="form.type" placeholder="请输入类型" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="ReturnExchange">
|
||||
import { listReturnExchange, getReturnExchange, delReturnExchange, addReturnExchange, updateReturnExchange } from "@/api/oa/returnExchange";
|
||||
import CustomerSelect from '@/components/CustomerSelect/index.vue';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const returnExchangeList = ref([]);
|
||||
const open = ref(false);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const formatterTime = (time) => {
|
||||
return proxy.parseTime(time, '{y}-{m}-{d}')
|
||||
}
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orderDetailId: undefined,
|
||||
customerId: undefined,
|
||||
type: undefined,
|
||||
reason: undefined,
|
||||
status: undefined,
|
||||
amount: undefined,
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询退换货管理列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listReturnExchange(queryParams.value).then(response => {
|
||||
returnExchangeList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
returnExchangeId: null,
|
||||
orderDetailId: null,
|
||||
customerId: null,
|
||||
type: null,
|
||||
reason: null,
|
||||
status: null,
|
||||
amount: null,
|
||||
delFlag: null,
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
updateTime: null,
|
||||
updateBy: null
|
||||
};
|
||||
proxy.resetForm("returnExchangeRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.returnExchangeId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加退换货管理";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
loading.value = true
|
||||
reset();
|
||||
const _returnExchangeId = row.returnExchangeId || ids.value
|
||||
getReturnExchange(_returnExchangeId).then(response => {
|
||||
loading.value = false;
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改退换货管理";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["returnExchangeRef"].validate(valid => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.returnExchangeId != null) {
|
||||
updateReturnExchange(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
}).finally(() => {
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
} else {
|
||||
addReturnExchange(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
}).finally(() => {
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _returnExchangeIds = row.returnExchangeId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除退换货管理编号为"' + _returnExchangeIds + '"的数据项?').then(function() {
|
||||
loading.value = true;
|
||||
return delReturnExchange(_returnExchangeIds);
|
||||
}).then(() => {
|
||||
loading.value = true;
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('oa/returnExchange/export', {
|
||||
...queryParams.value
|
||||
}, `returnExchange_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
Reference in New Issue
Block a user