This commit is contained in:
PQZ 2024-09-18 08:46:28 +08:00
commit b68b9de81a
15 changed files with 690 additions and 89 deletions

View File

@ -6,6 +6,8 @@ VUE_APP_TITLE = "车联通"后台管理系统
# 芋道管理系统/开发环境
VUE_APP_BASE_API = 'http://localhost:48080'
# 附件请求地址前缀
VUE_APP_FILE_API = 'http://122.51.230.86:9000/'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -9,6 +9,8 @@ VUE_APP_BASE_API = '/prod-api'
# 根据服务器或域名修改
PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/'
# 附件请求地址前缀
VUE_APP_FILE_API = 'http://122.51.230.86:9000/'
# 二级部署路径
VUE_APP_APP_NAME ='yudao-admin'

View File

@ -1 +1,20 @@
import request from '@/utils/request'
const preUrl = "/repair/so"
// 采购单\领料单 新增
export function createRepairSo(data){
return request({
url: preUrl + "/create",
method: "post",
data
})
}
export function getRepairSoPage(params){
return request({
url: preUrl + "/page",
method: "get",
params
})
}

View File

@ -72,6 +72,7 @@ export default {
return {
number: 0,
uploadList: [],
viewFileUrl: process.env.VUE_APP_FILE_API,
baseUrl: process.env.VUE_APP_BASE_API,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", //
headers: { Authorization: "Bearer " + getAccessToken() }, //
@ -88,7 +89,7 @@ export default {
//
this.fileList = list.map(item => {
if (typeof item === "string") {
item = { name: item, url: item };
item = { name: item, url: this.viewFileUrl+item };
}
item.uid = item.uid || new Date().getTime() + temp++;
return item;

View File

@ -88,6 +88,7 @@ export default {
number: 0,
uploadList: [],
baseUrl: "",
viewFileUrl: process.env.VUE_APP_FILE_API,
headers: { Authorization: "Bearer " + getAccessToken() }, //
fileList: [],
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/uploadDetail", //
@ -110,7 +111,7 @@ export default {
const list = Array.isArray(val)? val : this.value.split(",");
this.fileList = list.map((item) => {
if (typeof item === "string") {
item = { name: item, url: item };
item = { name: item, url: this.viewFileUrl+item };
}
item.uid = item.uid || new Date().getTime() + temp++;
return item;
@ -134,7 +135,7 @@ export default {
const list = Array.isArray(this.value)? this.value : this.value.split(",");
this.fileList = list.map((item) => {
if (typeof item === "string") {
item = { name: item, url: item };
item = { name: item, url: this.viewFileUrl+item };
}
item.uid = item.uid || new Date().getTime() + temp++;
return item;

View File

@ -76,6 +76,7 @@ export default {
dialogImageUrl: "",
dialogVisible: false,
hideUpload: false,
viewFileUrl: process.env.VUE_APP_FILE_API,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", //
headers: { Authorization: "Bearer " + getAccessToken() }, //
fileList: []
@ -91,7 +92,7 @@ export default {
this.fileList = list.map(item => {
if (typeof item === "string") {
// edit by
item = { name: item, url: item };
item = { name: item, url: this.viewFileUrl+item };
}
return item;
});

View File

@ -2,17 +2,17 @@
<el-select v-model="partSelected" ref="selectTable" clearable style="width: 45rem">
<el-option style="display: none" v-for="part in partList" :key="part.id" :label="part.name" :value="part.id"/>
<el-table :data="partList" style="width: 100%" @row-click="handleSelectionChange">
<el-table-column label="序号" align="center">
<el-table-column label="序号" align="center" width="80">
<template scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="商品名称" prop="name" />
<el-table-column label="规格" prop="name" />
<el-table-column label="商品编码" prop="name" />
<el-table-column label="可用库存" prop="name" />
<el-table-column label="成本" prop="name" />
<el-table-column label="仓库" prop="name" />
<el-table-column label="商品名称" prop="name" width="120"/>
<el-table-column label="规格" prop="model" width="120"/>
<el-table-column label="商品编码" prop="code" width="120"/>
<el-table-column label="可用库存" prop="stock" width="80"/>
<el-table-column label="成本" prop="price" width="80"/>
<el-table-column label="仓库" prop="warehouse" width="80"/>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
/>
@ -26,8 +26,48 @@ export default {
return{
partSelected: null,
partList: [
{id: 1, name: '张胜男', age:20, gender: 1},
{id: 2, name: '张胜妇', age:20, gender: 1}
{
id: 1,
tenantId: 1,
barCode: "12344564632463",
code: "12312312",
name: "测试1",
model: "12321",
price: "100",
type: "不知道",
unit: "个",
warehouse: "d1",
miniStock: 100,
maxStock: 100,
stock: 20,
img: '',
attribute: "123213123",
corpId: 1,
coverImage: '',
carModel: "大车",
remark: "没有",
},
{
id: 2,
tenantId: 1,
barCode: "12344564632463",
code: "12312312",
name: "测试2",
model: "12321",
price: "10",
type: "不知道",
unit: "个",
warehouse: "d2",
miniStock: 10,
maxStock: 10,
stock: 5,
img: '',
attribute: "123213123",
corpId: 1,
coverImage: '',
carModel: "大车",
remark: "没有",
}
],
queryParams:{
pageNo: 1,

View File

@ -10,6 +10,12 @@ import {getStaffList} from "@/api/company/staff";
export default {
name: "StaffChoose",
props:{
value: {
type: Object,
defaultValue: null
}
},
data() {
return {
staffList: [],
@ -19,7 +25,14 @@ export default {
watch:{
staffSelected(val) {
const staff = this.staffList.find(item => item.id === val);
this.$emit("selected", staff);
this.$emit("input", staff);
},
value(newVal){
if (newVal){
this.staffSelected = newVal.id
}else {
this.staffSelected = null
}
}
},
mounted() {

View File

@ -11,6 +11,12 @@ import {getBaseSupplierList} from "@/api/repair/supplier";
export default {
name: "SupplierChoose",
props: {
value: {
type: Object,
defaultValue: null
}
},
data() {
return {
supplierSelected: undefined,
@ -19,8 +25,15 @@ export default {
},
watch: {
supplierSelected(val) {
const supplier = this.supplierList.find(item => item.id === val);
this.$emit("selected", supplier);
const supplier = this.supplierList.find(item => item.id === val)
this.$emit("input", supplier);
},
value(newVal) {
if (newVal) {
this.supplierSelected = newVal.id
} else {
this.supplierSelected = null
}
}
},
mounted() {

View File

@ -51,7 +51,8 @@ export default {
return JSON.parse(JSON.stringify(result))
},
handleNodeClick(node){
this.$emit("selected", node)
this.$emit("input", node.name)
this.$emit("change")
this.warehouseSelected = node.name
this.$refs.selectTree.blur()
}

View File

@ -117,6 +117,7 @@ import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
import {DICT_TYPE} from "@/utils/dict";
import {getRepairSoPage} from "@/api/repair/stockOperate/stockOperate";
export default {
name: "SoIndex",
@ -155,7 +156,8 @@ export default {
soStatus: null,
corpId: null,
userId: null,
userName: null
userName: null,
soType: this.soByType ? "01" : "02"
},
showSearch: true,
list: [],
@ -163,9 +165,24 @@ export default {
total: 0
}
},
mounted() {
this.pageSo();
},
methods: {
//
async pageSo() {
try {
this.loading = true
const res = await getRepairSoPage(this.queryParams)
this.list = res.data.records
this.total = res.data.total
}finally {
this.loading = false
}
},
//
handleQuery(){},
handleQuery() {
},
//
resetQuery() {
this.resetForm('queryForm')

View File

@ -4,8 +4,8 @@
<el-row :gutter="20">
<el-col :span="24">
<!-- 供应商 组件 -->
<el-form-item v-if="soByType" label="供应商" prop="supplierId">
<SupplierChoose @selected="getSupplier"/>
<el-form-item v-if="soByType" label="供应商" prop="supplier">
<SupplierChoose v-model="formData.supplier"/>
</el-form-item>
<!-- 日期 内嵌 -->
<el-form-item label="日期" prop="soTime">
@ -20,8 +20,8 @@
<el-input disabled v-model="formData.soNo" style="width: 20rem"/>
</el-form-item>
<!-- 采购员/领料人 组件 -->
<el-form-item :label="staffRole" prop="userId">
<StaffChoose @selected="getStaff"/>
<el-form-item :label="staffRole" prop="user">
<StaffChoose v-model="formData.user"/>
</el-form-item>
</el-col>
</el-row>
@ -36,20 +36,25 @@
<!-- 商品表格 组件 -->
<el-row :gutter="20">
<el-col :span="24">
<SoTable :part-list="partList" :so-by-type="soByType" @deleteItem="deleteItem"/>
<SoTable @tableData="tableData" :part-list="partList" :so-by-type="soByType" @deleteItem="deleteItem"/>
</el-col>
</el-row>
<el-row :gutter="2" style="margin-top: 1rem">
<el-row :gutter="4" style="margin-top: 1rem">
<el-col :span="6">
<el-form-item label="应付金额" prop="totalPrice">
<el-input disabled v-model="formData.totalPrice"/>
</el-form-item>
</el-col>
<!-- 备注 -->
<el-col :span="12">
<el-form-item label="备注">
<el-input style="width: 45rem"/>
<el-form-item label="备注" prop="remark">
<el-input style="width: 40rem" v-model="formData.remark"/>
</el-form-item>
</el-col>
<!-- 按钮操作 -->
<el-col :span="12" style="text-align: right">
<el-button v-if="soByType" type="danger">结算</el-button>
<el-button v-else type="primary">确定</el-button>
<el-col :span="6" style="text-align: right">
<el-button v-if="soByType" type="danger" @click="handleSubmit">结算</el-button>
<el-button v-else type="primary" @click="handleSubmit">确定</el-button>
</el-col>
</el-row>
</el-form>
@ -63,6 +68,7 @@ import PartChoose from "@/views/repair/Components/PartChoose.vue";
import SoTable from "@/views/repair/stockOperate/Components/SoTable.vue";
import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
import {createUniqueCodeByHead} from "@/utils/createUniqueCode";
import {createRepairSo} from "@/api/repair/stockOperate/stockOperate";
export default {
name: "SoInfo",
@ -77,26 +83,29 @@ export default {
type: Boolean,
defaultValue: true,
required: true
}
},
},
data() {
return {
formData: {
soNo: null,
supplierId: null,
supplierName: null,
supplier: null,
soTime: Date.now(),
userId: null,
userName: null,
partList: []
user: null,
goodsList: [],
totalPrice: null,
soType: this.soByType ? "01" : "02",
purchaseType: "01",
itemCount: 0,
soStatus: this.soByType ? "01" : "04",
remark: null,
},
staffRole: "采购员",
partList: [],
}
},
mounted() {
this.formData.soNo = createUniqueCodeByHead(this.soByType ? "CG" : "LL")
this.staffRole = this.soByType ? this.staffRole : "领料人"
this.init()
},
methods: {
//
@ -106,7 +115,8 @@ export default {
},
//
getSupplier(data) {
console.log(data)
this.formData.supplierId = data.id
this.formData.supplierName = data.name
},
//
async getPart(data) {
@ -124,6 +134,66 @@ export default {
//
deleteItem(index) {
this.partList.splice(index, 1)
},
//
tableData(data){
this.formData.totalPrice = data.reduce((x, y) => {return x + y.totalPrice}, 0)
this.formData.itemCount = data.reduce((x, y) => {return x + y.count}, 0)
this.formData.goodsList = data.map(item => {
return {
goodsId: item.id,
goodsType: "0",
wareId: "0",
goodsCount: item.count,
goodsPrice: item.newPrice,
remark: item.remark
}
})
},
//
async handleSubmit(){
try {
this.createInit()
await createRepairSo(this.formData)
this.$modal.msgSuccess("新增成功")
this.init()
}catch{
}
},
//
init(){
this.formData = {
soNo: null,
supplier: null,
soTime: Date.now(),
user: null,
goodsList: [],
totalPrice: null,
soType: this.soByType ? "01" : "02",
purchaseType: "01",
itemCount: 0,
soStatus: this.soByType ? "01" : "04",
remark: null,
}
this.formData.soNo = createUniqueCodeByHead(this.soByType ? "CG" : "LL")
this.staffRole = this.soByType ? this.staffRole : "领料人"
this.partList = []
},
//
createInit(){
const data = this.formData
this.formData = {
...data,
userId: data.user.id,
userName: data.user.name,
}
if (this.soByType){
this.formData = {
...data,
supplierId: data.supplier.id,
supplierName: data.supplier.name
}
}
}
}
}

View File

@ -1,21 +1,62 @@
<template>
<el-table v-loading="loading" :data="partList" :stripe="true" :show-overflow-tooltip="true">
<el-table v-loading="loading"
:data="list"
:stripe="true"
:show-overflow-tooltip="true"
show-summary
:summary-method="getSummaries"
:key="randomKey"
@cell-dblclick="editData"
>
<el-table-column label="序号" align="center">
<template scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="商品名称" align="center" prop="name" width="200"/>
<el-table-column label="规格" align="center" width="180"/>
<el-table-column label="商品编码" align="center" width="180"/>
<el-table-column label="仓库" align="center" width="150"/>
<el-table-column label="库存" align="center" width="150" />
<el-table-column label="单位" align="center" width="150"/>
<el-table-column label="数量" align="center" width="150"/>
<el-table-column :label="soByType ? '上次进价' : '成本'" align="center" width="150"/>
<el-table-column v-if="soByType" label="采购进价" align="center" width="150"/>
<el-table-column :label="soByType ? '采购金额' : '合计'" align="center" width="150"/>
<el-table-column label="备注" align="center" width="180"/>
<el-table-column label="规格" align="center" width="180" prop="model"/>
<el-table-column label="商品编码" align="center" width="180" prop="code"/>
<el-table-column label="仓库" align="center" width="150" prop="warehouse">
<template slot-scope="scope">
<WarehouseChoose v-if="scope.row[scope.column.property + 'isShow'] && soByType"
:ref="scope.column.property"
v-model="scope.row.warehouse"
@change="alterData(scope.row,scope.column)"
/>
<span v-else>{{ scope.row.warehouse }}</span>
</template>
</el-table-column>
<el-table-column label="库存" align="center" width="150" prop="stock"/>
<el-table-column label="单位" align="center" width="150" prop="unit"/>
<el-table-column label="数量" align="center" width="150" prop="count">
<template slot-scope="scope">
<el-input v-if="scope.row[scope.column.property + 'isShow']"
:ref="scope.column.property"
v-model="scope.row.count"
@blur="alterData(scope.row,scope.column)"></el-input>
<span v-else>{{ scope.row.count }}</span>
</template>
</el-table-column>
<el-table-column :label="soByType ? '上次进价' : '成本'" align="center" width="150" prop="price"/>
<el-table-column v-if="soByType" label="采购单价" align="center" width="150" prop="newPrice">
<template slot-scope="scope">
<el-input v-if="scope.row[scope.column.property + 'isShow'] && soByType"
:ref="scope.column.property"
v-model="scope.row.newPrice"
@blur="alterData(scope.row,scope.column)"></el-input>
<span v-else>{{ scope.row.newPrice }}</span>
</template>
</el-table-column>
<el-table-column :label="soByType ? '采购金额' : '合计'" align="center" width="150" prop="totalPrice"/>
<el-table-column label="备注" align="center" width="180" prop="remark">
<template slot-scope="scope">
<el-input v-if="scope.row[scope.column.property + 'isShow']"
:ref="scope.column.property"
v-model="scope.row.remark"
@blur="alterData(scope.row,scope.column)"></el-input>
<span v-else>{{ scope.row.remark }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-delete" @click="deleteItem(scope.$index)"
@ -27,8 +68,11 @@
</template>
<script>
import WarehouseChoose from "@/views/repair/Components/WarehouseChoose.vue";
export default {
name: "SoTable",
components: {WarehouseChoose},
props: {
soByType: {
type: Boolean,
@ -45,13 +89,80 @@ export default {
return {
loading: false,
list: [],
includeColumn: ['count', 'totalPrice'],
randomKey: Math.random(),
}
},
watch: {
partList(val) {
if (val && val.length > 0) {
const data = val[val.length - 1]
const newData = {
...data,
count: 1,
totalPrice: data.price * 1,
remark: '',
newPrice: data.price,
}
this.list.push(newData)
}else {
this.list = []
this.refreshTable()
}
},
list: {
handler(newVal, oldVal) {
this.$emit("tableData", newVal)
},
deep: true
}
},
methods: {
//
deleteItem(index) {
this.$emit("deleteItem", index)
},
//
getSummaries(param) {
const {columns, data} = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (this.includeColumn.includes(column.property)) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index];
}
});
return sums
},
editData(row, column) {
row[column.property + "isShow"] = true
//refreshTabletabletable
this.refreshTable()
// this.$nextTick(() => {
// this.$refs[column.property] && this.$refs[column.property].focus()
// })
},
alterData(row, column) {
row[column.property + "isShow"] = false
const data = this.list.find(item => item.id === row.id)
data.totalPrice = data.newPrice * data.count
this.refreshTable()
},
refreshTable() {
this.randomKey = Math.random()
},
}
}
</script>

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询app轮播图列表
export function listSwiper(query) {
return request({
url: '/system/appSwiper/list',
method: 'get',
params: query
})
}
// 查询app轮播图详细
export function getSwiper(swiperId) {
return request({
url: '/system/appSwiper/' + swiperId,
method: 'get'
})
}
// 新增app轮播图
export function addSwiper(data) {
return request({
url: '/system/appSwiper/add',
method: 'post',
data: data
})
}
// 修改app轮播图
export function updateSwiper(data) {
return request({
url: '/system/appSwiper/edit',
method: 'post',
data: data
})
}
// 删除app轮播图
export function delSwiper(swiperId) {
return request({
url: '/system/appSwiper/del?idList=' + swiperId,
method: 'post'
})
}

View File

@ -0,0 +1,266 @@
<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="moudleName">
<el-select v-model="queryParams.moudleName" placeholder="请选择板块名称" clearable>
<el-option
v-for="dict in dict.type.app_module_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</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-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-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="swiperList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="板块名称" align="center" prop="moudleName">
<template slot-scope="scope">
<dict-tag :options="dict.type.app_module_type" :value="scope.row.moudleName"/>
</template>
</el-table-column>
<el-table-column label="轮播图照片" align="center" prop="swiperPicture" width="100">
<template slot-scope="scope">
<image-preview :src="scope.row.swiperPicture" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="排序" align="center" prop="listOrder" />
<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>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改app轮播图对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="板块名称" prop="moudleName">
<el-select v-model="form.moudleName" placeholder="请选择板块名称">
<el-option
v-for="dict in dict.type.app_module_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="轮播图名称" prop="swiperName">
<el-input v-model="form.swiperName" placeholder="请输入轮播图名称" />
</el-form-item>
<el-form-item label="轮播图照片" prop="swiperPicture">
<image-upload :limit="5" v-model="form.swiperPicture"/>
</el-form-item>
<el-form-item label="跳转地址" prop="jumpUrl">
<el-input v-model="form.jumpUrl" placeholder="请输入跳转地址" />
</el-form-item>
<el-form-item label="排序" prop="listOrder">
<el-input v-model="form.listOrder" placeholder="请输入排序" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listSwiper, getSwiper, delSwiper, addSwiper, updateSwiper } from "./api";
import request from "@/utils/request";
import DictTag from '@/components/DictTagOld/index.vue'
export default {
name: "Swiper",
components:{DictTag},
dicts: ['app_module_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// app
swiperList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
moudleName: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.dict = {type:{}}
for (let i = 0; i < this.$options.dicts.length; i++) {
request({
url: '/rescue/dict/data/type/'+this.$options.dicts[i],
method: 'get'
}).then(res=>{
this.$set(this.dict.type,this.$options.dicts[i],res.data)
})
}
this.getList();
},
methods: {
/** 查询app轮播图列表 */
getList() {
this.loading = true;
listSwiper(this.queryParams).then(response => {
this.swiperList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
swiperId: null,
moudleName: null,
swiperName: null,
swiperPicture: null,
jumpUrl: null,
listOrder: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.swiperId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加app轮播图";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const swiperId = row.swiperId || this.ids
getSwiper(swiperId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改app轮播图";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.swiperId != null) {
updateSwiper(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSwiper(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const swiperIds = row.swiperId || this.ids;
this.$modal.confirm('是否确认删除app轮播图编号为"' + swiperIds + '"的数据项?').then(function() {
return delSwiper(swiperIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/swiper/export', {
...this.queryParams
}, `swiper_${new Date().getTime()}.xlsx`)
}
}
};
</script>