feat: web端初步完成
This commit is contained in:
@@ -0,0 +1,314 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="供应商">
|
||||
<el-select clearable filterable placeholder="请选择供应商" style="width: 100%" v-model="pageForm.supplierId">
|
||||
<el-option :key="item.supplierId" :label="item.supplierName" :value="item.supplierId" v-for="item in supplierList"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="订单号">
|
||||
<el-input clearable placeholder="请输入订单号" v-model="pageForm.orderId"></el-input>
|
||||
</search-item>
|
||||
<search-item label="工号">
|
||||
<el-input clearable placeholder="请输入工号" v-model="pageForm.userId"></el-input>
|
||||
</search-item>
|
||||
<search-item label="订单状态">
|
||||
<el-select clearable placeholder="请选择订单状态" style="width: 100%" v-model="pageForm.orderState">
|
||||
<el-option :key="item.value" :label="item.label" :value="item.value" v-for="item in orderStateOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="物流单号">
|
||||
<el-input clearable placeholder="请输入物流单号" v-model="pageForm.logisticsOrderId"></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool label="积分商城订单列表"></table-tool>
|
||||
<el-table :data="tableData" border class="vi-table" size="small" style="width: 100%" v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" label="序号" type="index" width="70"></el-table-column>
|
||||
<el-table-column align="center" label="订单号" min-width="160" prop="orderId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="订单编码" min-width="150" prop="orderNumberId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="工号" min-width="120" prop="userId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="供应商" min-width="140" prop="supplierName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="应用名称" min-width="120" prop="aplName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="创建时间" min-width="160" prop="orderCreateTime" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="订单状态" min-width="110">
|
||||
<template slot-scope="{row}">
|
||||
<el-tag :type="orderStatusType(row.orderState)" size="mini">{{ orderStateName(row.orderState) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="订单总金额" min-width="110" prop="totalPrice"></el-table-column>
|
||||
<el-table-column align="center" label="现金金额" min-width="110">
|
||||
<template slot-scope="{row}">{{ row.wPayOrAPay || "-" }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="消费积分" min-width="110" prop="pointsPrice"></el-table-column>
|
||||
<el-table-column align="center" label="现金支付" min-width="120">
|
||||
<template slot-scope="{row}">{{ cashPaidName(row.cashPaid) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="100">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openSubOrders(row)" size="mini" type="primary">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-size="pageForm.pageSize"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:total="pageForm.totalCount"
|
||||
@current-change="pageChange"
|
||||
@size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
style="margin-top: 16px; text-align: right"
|
||||
></el-pagination>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="'子订单详情 - ' + currentMainOrderId" :visible.sync="subDialogVisible" top="5vh" width="88%">
|
||||
<el-table :data="subOrderList" border size="small" style="width: 100%" v-loading="subLoading">
|
||||
<el-table-column align="center" label="子订单号" min-width="170" prop="orderId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="订单编码" min-width="150" prop="orderNumberId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="供应商" min-width="130" prop="supplierName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="工号" min-width="110" prop="userId"></el-table-column>
|
||||
<el-table-column align="center" label="创建时间" min-width="160" prop="orderCreateTime"></el-table-column>
|
||||
<el-table-column align="center" label="订单状态" min-width="100">
|
||||
<template slot-scope="{row}">
|
||||
<el-tag :type="orderStatusType(row.orderState)" size="mini">{{ orderStateName(row.orderState) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="消费积分" min-width="100" prop="pointsPrice"></el-table-column>
|
||||
<el-table-column align="center" label="物流单号" min-width="140" prop="logisticsOrderId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="发票代码" min-width="120" prop="invoiceCode" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="180">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openProducts(row, false)" size="mini">商品</el-button>
|
||||
<el-button @click="openExchange(row)" size="mini" type="warning">售后</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:current-page="subPageForm.pageNumber"
|
||||
:page-size="subPageForm.pageSize"
|
||||
:total="subPageForm.totalCount"
|
||||
@current-change="subPageChange"
|
||||
layout="total, prev, pager, next"
|
||||
style="margin-top: 16px; text-align: right"
|
||||
></el-pagination>
|
||||
<span slot="footer">
|
||||
<el-button @click="subDialogVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="productDialogTitle" :visible.sync="productDialogVisible" width="72%">
|
||||
<el-table :data="productList" border size="small" v-loading="productLoading">
|
||||
<el-table-column align="center" label="商品名称" min-width="220" prop="name" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="SKU" min-width="140" prop="sku" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="数量" width="90" prop="number"></el-table-column>
|
||||
<el-table-column align="center" label="单价" width="110" prop="price"></el-table-column>
|
||||
<el-table-column align="center" label="税率" width="110" prop="taxRate"></el-table-column>
|
||||
<el-table-column align="center" label="图片信息" min-width="180" prop="picInfo" show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer">
|
||||
<el-button @click="productDialogVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="'售后单 - ' + currentSubOrderId" :visible.sync="exchangeDialogVisible" width="82%">
|
||||
<el-table :data="exchangeList" border size="small" v-loading="exchangeLoading">
|
||||
<el-table-column align="center" label="售后订单号" min-width="170" prop="orderId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="供应商" min-width="130" prop="supplierName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="工号" min-width="110" prop="userId"></el-table-column>
|
||||
<el-table-column align="center" label="创建时间" min-width="160" prop="orderCreateTime"></el-table-column>
|
||||
<el-table-column align="center" label="状态" min-width="100">
|
||||
<template slot-scope="{row}">
|
||||
<el-tag :type="orderStatusType(row.orderState)" size="mini">{{ orderStateName(row.orderState) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="退款" width="100" prop="refund"></el-table-column>
|
||||
<el-table-column align="center" label="消费积分" width="110" prop="pointsPrice"></el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="100">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openProducts(row, true)" size="mini">商品</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer">
|
||||
<el-button @click="exchangeDialogVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
supplierList: [],
|
||||
tableData: [],
|
||||
tableLoading: false,
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
supplierId: null,
|
||||
orderId: null,
|
||||
userId: null,
|
||||
orderState: null,
|
||||
logisticsOrderId: null
|
||||
},
|
||||
subDialogVisible: false,
|
||||
subLoading: false,
|
||||
currentMainOrderId: null,
|
||||
subOrderList: [],
|
||||
subPageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0
|
||||
},
|
||||
productDialogVisible: false,
|
||||
productDialogTitle: "商品明细",
|
||||
productLoading: false,
|
||||
productList: [],
|
||||
exchangeDialogVisible: false,
|
||||
exchangeLoading: false,
|
||||
currentSubOrderId: null,
|
||||
exchangeList: [],
|
||||
orderStateOptions: [
|
||||
{ value: "0", label: "待付款" },
|
||||
{ value: "1", label: "已支付" },
|
||||
{ value: "2", label: "进行中" },
|
||||
{ value: "3", label: "已取消" },
|
||||
{ value: "4", label: "已签收" },
|
||||
{ value: "5", label: "已完成" },
|
||||
{ value: "6", label: "换货" },
|
||||
{ value: "7", label: "退货" },
|
||||
{ value: "8", label: "已废除" }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
indexMethod(index) {
|
||||
return index + 1 + (this.pageForm.pageNumber - 1) * this.pageForm.pageSize
|
||||
},
|
||||
doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
async pageData() {
|
||||
this.tableLoading = true
|
||||
const resp = await this.$axios.post(loc() + "/pageData", this.pageForm)
|
||||
this.tableLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data.list || []
|
||||
this.pageForm.totalCount = resp.data.totalCount || 0
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
pageChange(val) {
|
||||
this.pageForm.pageNumber = val
|
||||
this.pageData()
|
||||
},
|
||||
sizeChange(val) {
|
||||
this.pageForm.pageSize = val
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
async loadSuppliers() {
|
||||
const resp = await this.$axios.post(loc() + "/supplierList")
|
||||
if (resp.code === 0) {
|
||||
this.supplierList = resp.data || []
|
||||
}
|
||||
},
|
||||
openSubOrders(row) {
|
||||
this.currentMainOrderId = row.orderId
|
||||
this.subPageForm.pageNumber = 1
|
||||
this.subDialogVisible = true
|
||||
this.subPageData()
|
||||
},
|
||||
async subPageData() {
|
||||
this.subLoading = true
|
||||
const resp = await this.$axios.post(loc() + "/subPageData", {
|
||||
pageNumber: this.subPageForm.pageNumber,
|
||||
pageSize: this.subPageForm.pageSize,
|
||||
mainOrderId: this.currentMainOrderId
|
||||
})
|
||||
this.subLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.subOrderList = resp.data.list || []
|
||||
this.subPageForm.totalCount = resp.data.totalCount || 0
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
subPageChange(val) {
|
||||
this.subPageForm.pageNumber = val
|
||||
this.subPageData()
|
||||
},
|
||||
async openProducts(row, exchange) {
|
||||
this.productDialogTitle = (exchange ? "售后单商品明细 - " : "子订单商品明细 - ") + row.orderId
|
||||
this.productDialogVisible = true
|
||||
this.productLoading = true
|
||||
const resp = await this.$axios.post(loc() + (exchange ? "/exchangeProductList" : "/productList"), { orderId: row.orderId })
|
||||
this.productLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.productList = resp.data || []
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
async openExchange(row) {
|
||||
this.currentSubOrderId = row.orderId
|
||||
this.exchangeDialogVisible = true
|
||||
this.exchangeLoading = true
|
||||
const resp = await this.$axios.post(loc() + "/exchangeList", { mainOrderId: row.orderId })
|
||||
this.exchangeLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.exchangeList = resp.data || []
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
orderStateName(value) {
|
||||
const item = this.orderStateOptions.find((v) => String(v.value) === String(value))
|
||||
return item ? item.label : "-"
|
||||
},
|
||||
orderStatusType(value) {
|
||||
const map = {
|
||||
0: "info",
|
||||
1: "primary",
|
||||
2: "warning",
|
||||
3: "danger",
|
||||
4: "primary",
|
||||
5: "success",
|
||||
6: "warning",
|
||||
7: "danger",
|
||||
8: "info"
|
||||
}
|
||||
return map[value] || "info"
|
||||
},
|
||||
cashPaidName(value) {
|
||||
const map = {
|
||||
0: "不涉及",
|
||||
1: "待现金支付",
|
||||
2: "已现金支付",
|
||||
3: "取消现金支付"
|
||||
}
|
||||
return map[value] || "-"
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadSuppliers()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,323 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="供应商名称">
|
||||
<el-input clearable placeholder="请输入供应商名称" v-model="pageForm.supplierName"></el-input>
|
||||
</search-item>
|
||||
<search-item label="商城类型">
|
||||
<el-select clearable placeholder="请选择商城类型" style="width: 100%" v-model="pageForm.mallType">
|
||||
<el-option :value="1" label="积分商城"></el-option>
|
||||
<el-option :value="2" label="观影商城"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool label="供应商列表">
|
||||
<el-button @click="openAdd" icon="el-icon-plus" size="small" type="primary">新建</el-button>
|
||||
<el-button @click="deleteSelected" icon="el-icon-delete" size="small" type="danger">删除</el-button>
|
||||
</table-tool>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
@selection-change="handleSelectionChange"
|
||||
border
|
||||
class="vi-table"
|
||||
ref="multipleTable"
|
||||
size="small"
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading"
|
||||
>
|
||||
<el-table-column type="selection" width="50"></el-table-column>
|
||||
<el-table-column :index="indexMethod" align="center" label="序号" type="index" width="70"></el-table-column>
|
||||
<el-table-column align="center" label="供应商ID" min-width="110" prop="supplierId" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="供应商名称" min-width="140" prop="supplierName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="商城类型" min-width="100">
|
||||
<template slot-scope="{row}">
|
||||
<el-tag size="mini" :type="row.mallType === 1 ? 'success' : 'warning'">{{ mallTypeName(row.mallType) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="首页链接" min-width="180" prop="supplierUrl" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="订单链接" min-width="180" prop="supplierOrderUrl" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="售后订单链接" min-width="180" prop="supplierReturnOrderUrl" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="API链接" min-width="180" prop="supplierApiUrl" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="场景号" min-width="110" prop="sroNo" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="合作到期" min-width="160" prop="cooperationExpTime" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="排序" width="80" prop="sortCode"></el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="150">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openEdit(row)" size="mini" type="primary">修改</el-button>
|
||||
<el-button @click="deleteRows([row])" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-size="pageForm.pageSize"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:total="pageForm.totalCount"
|
||||
@current-change="pageChange"
|
||||
@size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
style="margin-top: 16px; text-align: right"
|
||||
></el-pagination>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="formData.id ? '修改供应商' : '新增供应商'" :visible.sync="editDialogVisible" width="760px">
|
||||
<el-form :model="formData" :rules="rules" label-width="130px" ref="form">
|
||||
<el-row :gutter="18">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商ID" prop="supplierId">
|
||||
<el-input maxlength="64" placeholder="请输入供应商ID" v-model="formData.supplierId"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商名称" prop="supplierName">
|
||||
<el-input maxlength="100" placeholder="请输入供应商名称" v-model="formData.supplierName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="商城类型" prop="mallType">
|
||||
<el-select placeholder="请选择商城类型" style="width: 100%" v-model="formData.mallType">
|
||||
<el-option :value="1" label="积分商城"></el-option>
|
||||
<el-option :value="2" label="观影商城"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="排序" prop="sortCode">
|
||||
<el-input-number :min="0" controls-position="right" style="width: 100%" v-model="formData.sortCode"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="首页链接" prop="supplierUrl">
|
||||
<el-input maxlength="1000" placeholder="请输入首页链接" v-model="formData.supplierUrl"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="订单链接" prop="supplierOrderUrl">
|
||||
<el-input maxlength="1000" placeholder="请输入订单详情链接" v-model="formData.supplierOrderUrl"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="售后订单链接" prop="supplierReturnOrderUrl">
|
||||
<el-input maxlength="1000" placeholder="请输入售后订单链接" v-model="formData.supplierReturnOrderUrl"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="API链接" prop="supplierApiUrl">
|
||||
<el-input maxlength="1000" placeholder="请输入供应商API地址" v-model="formData.supplierApiUrl"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="场景号" prop="sroNo">
|
||||
<el-input maxlength="100" placeholder="请输入场景号" v-model="formData.sroNo"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合作到期时间" prop="cooperationExpTime">
|
||||
<el-date-picker
|
||||
placeholder="请选择合作到期时间"
|
||||
style="width: 100%"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
v-model="formData.cooperationExpTime"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户端ID" prop="clientId">
|
||||
<el-input maxlength="128" placeholder="请输入客户端ID" v-model="formData.clientId"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户端密钥" prop="clientSecret">
|
||||
<el-input maxlength="256" placeholder="请输入客户端密钥" show-password v-model="formData.clientSecret"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="图片地址" prop="supplierPic">
|
||||
<el-input maxlength="1000" placeholder="请输入供应商图片地址" v-model="formData.supplierPic"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="图片文件路径" prop="supplierPicPath">
|
||||
<el-input maxlength="1000" placeholder="请输入供应商图片文件路径" v-model="formData.supplierPicPath"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="联系信息" prop="contactInfo">
|
||||
<el-input maxlength="500" placeholder="请输入联系信息" v-model="formData.contactInfo"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<span slot="footer">
|
||||
<el-button @click="editDialogVisible = false">取消</el-button>
|
||||
<el-button :loading="submitLoading" @click="submitForm" type="primary">保存</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
tableLoading: false,
|
||||
submitLoading: false,
|
||||
multipleSelection: [],
|
||||
editDialogVisible: false,
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
supplierName: null,
|
||||
mallType: null
|
||||
},
|
||||
formData: this.defaultForm(),
|
||||
rules: {
|
||||
supplierId: [{ required: true, message: "请输入供应商ID", trigger: ["change", "blur"] }],
|
||||
supplierName: [{ required: true, message: "请输入供应商名称", trigger: ["change", "blur"] }],
|
||||
mallType: [{ required: true, message: "请选择商城类型", trigger: ["change", "blur"] }],
|
||||
sortCode: [{ required: true, message: "请输入排序", trigger: ["change", "blur"] }]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
defaultForm() {
|
||||
return {
|
||||
id: null,
|
||||
supplierId: null,
|
||||
supplierName: null,
|
||||
supplierUrl: null,
|
||||
supplierOrderUrl: null,
|
||||
supplierReturnOrderUrl: null,
|
||||
supplierApiUrl: null,
|
||||
supplierPic: null,
|
||||
supplierPicPath: null,
|
||||
contactInfo: null,
|
||||
sroNo: null,
|
||||
cooperationExpTime: null,
|
||||
clientId: null,
|
||||
clientSecret: null,
|
||||
sortCode: 99,
|
||||
mallType: 1
|
||||
}
|
||||
},
|
||||
indexMethod(index) {
|
||||
return index + 1 + (this.pageForm.pageNumber - 1) * this.pageForm.pageSize
|
||||
},
|
||||
doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
async pageData() {
|
||||
this.tableLoading = true
|
||||
const resp = await this.$axios.post(loc() + "/pageData", this.pageForm)
|
||||
this.tableLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data.list || []
|
||||
this.pageForm.totalCount = resp.data.totalCount || 0
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
pageChange(val) {
|
||||
this.pageForm.pageNumber = val
|
||||
this.pageData()
|
||||
},
|
||||
sizeChange(val) {
|
||||
this.pageForm.pageSize = val
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val
|
||||
},
|
||||
openAdd() {
|
||||
this.formData = this.defaultForm()
|
||||
this.editDialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form && this.$refs.form.clearValidate()
|
||||
})
|
||||
},
|
||||
openEdit(row) {
|
||||
this.formData = Object.assign(this.defaultForm(), row)
|
||||
this.editDialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form && this.$refs.form.clearValidate()
|
||||
})
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs.form.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return
|
||||
}
|
||||
this.submitLoading = true
|
||||
const url = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
const resp = await this.$axios.post(loc() + url, this.formData)
|
||||
this.submitLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.editDialogVisible = false
|
||||
this.pageData()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteSelected() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message.warning("请至少选择一条数据")
|
||||
return
|
||||
}
|
||||
this.deleteRows(this.multipleSelection)
|
||||
},
|
||||
deleteRows(rows) {
|
||||
const names = rows.map((row) => row.supplierName).join("、")
|
||||
this.$confirm("确定删除供应商“" + names + "”吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
callback: async (action) => {
|
||||
if (action !== "confirm") {
|
||||
return
|
||||
}
|
||||
const resp = await this.$axios.post(loc() + "/doDelete", {
|
||||
ids: rows.map((row) => row.id).join(",")
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.pageData()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
mallTypeName(type) {
|
||||
if (type === 1) {
|
||||
return "积分商城"
|
||||
}
|
||||
if (type === 2) {
|
||||
return "观影商城"
|
||||
}
|
||||
return "-"
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user