|
|
|
@ -1,225 +1,502 @@
|
|
|
|
|
<template> |
|
|
|
|
<basic-container> |
|
|
|
|
<avue-crud :option="option" |
|
|
|
|
v-model:search="search" |
|
|
|
|
v-model:page="page" |
|
|
|
|
v-model="form" |
|
|
|
|
:table-loading="loading" |
|
|
|
|
:data="data" |
|
|
|
|
:permission="permissionList" |
|
|
|
|
:before-open="beforeOpen" |
|
|
|
|
ref="crud" |
|
|
|
|
@row-update="rowUpdate" |
|
|
|
|
@row-save="rowSave" |
|
|
|
|
@row-del="rowDel" |
|
|
|
|
@search-change="searchChange" |
|
|
|
|
@search-reset="searchReset" |
|
|
|
|
@selection-change="selectionChange" |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" |
|
|
|
|
@on-load="onLoad"> |
|
|
|
|
<!-- <template #menu-left>--> |
|
|
|
|
<!-- <el-button type="danger"--> |
|
|
|
|
<!-- icon="el-icon-delete"--> |
|
|
|
|
<!-- plain--> |
|
|
|
|
<!-- v-if="permission.distributionStock_delete"--> |
|
|
|
|
<!-- @click="handleDelete">删 除--> |
|
|
|
|
<!-- </el-button>--> |
|
|
|
|
<!-- <el-button type="warning"--> |
|
|
|
|
<!-- plain--> |
|
|
|
|
<!-- icon="el-icon-download"--> |
|
|
|
|
<!-- @click="handleExport">导 出--> |
|
|
|
|
<!-- </el-button>--> |
|
|
|
|
<!-- </template>--> |
|
|
|
|
</avue-crud> |
|
|
|
|
<div class="avue-crud"> |
|
|
|
|
|
|
|
|
|
<el-row> |
|
|
|
|
<!-- 列表模块 --> |
|
|
|
|
<tablecmt |
|
|
|
|
:columnList="columnList" |
|
|
|
|
:tableData="data" |
|
|
|
|
:loading="loading" |
|
|
|
|
@inputTxt="inputsc" |
|
|
|
|
@timeCheck="timesc" |
|
|
|
|
@btnCheck="btnsc" |
|
|
|
|
@selectCheck="selectsc" |
|
|
|
|
@selection="selectionChange" |
|
|
|
|
> |
|
|
|
|
<!-- <template #default="slotProps">--> |
|
|
|
|
<!-- <el-button type="primary" text icon="el-icon-view" @click="handleView(slotProps.scope)">查看</el-button>--> |
|
|
|
|
<!-- <el-button type="primary" text icon="el-icon-edit" @click="handleCallDeliveryOwn(slotProps.scope)">修改客户信息</el-button>--> |
|
|
|
|
<!-- </template>--> |
|
|
|
|
</tablecmt> |
|
|
|
|
</el-row> |
|
|
|
|
<el-row> |
|
|
|
|
<div class="avue-crud__pagination" style="width:100%"> |
|
|
|
|
<!-- 分页模块 --> |
|
|
|
|
<el-pagination align="right" |
|
|
|
|
background |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
:current-page="page.currentPage" |
|
|
|
|
:page-sizes="[10, 20, 30, 40, 50, 100]" |
|
|
|
|
:page-size="page.pageSize" |
|
|
|
|
layout="total, sizes, prev, pager, next, jumper" |
|
|
|
|
:total="page.total"> |
|
|
|
|
</el-pagination> |
|
|
|
|
</div> |
|
|
|
|
</el-row> |
|
|
|
|
<!-- 表单模块 --> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
</basic-container> |
|
|
|
|
<edittablehead |
|
|
|
|
@setcolum="setnewcolum" |
|
|
|
|
@closce="showdrawer" |
|
|
|
|
:drawerShow="drawerShow" |
|
|
|
|
:columnList="columnList" |
|
|
|
|
></edittablehead> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import {getList, getDetail, add, update, remove} from "@/api/warehouse/warehouseStock"; |
|
|
|
|
import option from "@/option/warehouse/warehouseStock"; |
|
|
|
|
import {mapGetters} from "vuex"; |
|
|
|
|
import {exportBlob} from "@/api/common"; |
|
|
|
|
import {getToken} from '@/utils/auth'; |
|
|
|
|
import {downloadXls} from "@/utils/util"; |
|
|
|
|
import {dateNow} from "@/utils/date"; |
|
|
|
|
import NProgress from 'nprogress'; |
|
|
|
|
import 'nprogress/nprogress.css'; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
form: {}, |
|
|
|
|
query: {}, |
|
|
|
|
search: {}, |
|
|
|
|
loading: true, |
|
|
|
|
page: { |
|
|
|
|
pageSize: 10, |
|
|
|
|
currentPage: 1, |
|
|
|
|
total: 0 |
|
|
|
|
export default { |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
columnList: [ |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
prop: 'nodeName', |
|
|
|
|
label: '节点名称', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '150', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: true, |
|
|
|
|
sortable: false, |
|
|
|
|
head: false, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
prop: 'orderCode', |
|
|
|
|
label: '订单自编码', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '150', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
prop: 'orderPackageCode', |
|
|
|
|
label: '包件码', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '180', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
prop: 'serviceNumber', |
|
|
|
|
label: '服务号', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '180', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
prop: 'brandName', |
|
|
|
|
label: '品牌', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '180', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
prop: 'materialCode', |
|
|
|
|
label: '物料编号', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '180', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
prop: 'materialName', |
|
|
|
|
label: '物料名称', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '180', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
prop: 'firsts', |
|
|
|
|
label: '一级品', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '180', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
prop: 'second', |
|
|
|
|
label: '二级品', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '180', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
}, |
|
|
|
|
selectionList: [], |
|
|
|
|
option: option, |
|
|
|
|
data: [] |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
...mapGetters(["permission"]), |
|
|
|
|
permissionList() { |
|
|
|
|
return { |
|
|
|
|
addBtn: this.validData(this.permission.distributionStock_add, false), |
|
|
|
|
viewBtn: this.validData(this.permission.distributionStock_view, false), |
|
|
|
|
delBtn: this.validData(this.permission.distributionStock_delete, false), |
|
|
|
|
editBtn: this.validData(this.permission.distributionStock_edit, false) |
|
|
|
|
}; |
|
|
|
|
{ |
|
|
|
|
prop: 'thirdProduct', |
|
|
|
|
label: '三级品', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '180', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
prop: 'warehouseEntryTimeEnd', |
|
|
|
|
label: '入库时间', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '180', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
prop: 'waybillNumber', |
|
|
|
|
label: '运单号', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '180', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
prop: 'operatorName', |
|
|
|
|
label: '操作员', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '180', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: false, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
prop: 'createTime', |
|
|
|
|
label: '操作时间', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '180', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
}, |
|
|
|
|
// { |
|
|
|
|
// prop: '', |
|
|
|
|
// label: '操作', |
|
|
|
|
// type: 6, |
|
|
|
|
// values: '', |
|
|
|
|
// width: '230', |
|
|
|
|
// checkarr: [], |
|
|
|
|
// fixed: 'right', |
|
|
|
|
// hide: true, |
|
|
|
|
// }, |
|
|
|
|
// 更多列的配置... |
|
|
|
|
], |
|
|
|
|
height: 0, |
|
|
|
|
// 弹框标题 |
|
|
|
|
title: '', |
|
|
|
|
// 是否展示弹框 |
|
|
|
|
box: false, |
|
|
|
|
// 是否显示查询 |
|
|
|
|
search: true, |
|
|
|
|
// 加载中 |
|
|
|
|
loading: true, |
|
|
|
|
// 是否为查看模式 |
|
|
|
|
view: false, |
|
|
|
|
// 查询信息 |
|
|
|
|
query: {}, |
|
|
|
|
// 分页信息 |
|
|
|
|
page: { |
|
|
|
|
currentPage: 1, |
|
|
|
|
pageSize: 20, |
|
|
|
|
total: 40 |
|
|
|
|
}, |
|
|
|
|
ids() { |
|
|
|
|
let ids = []; |
|
|
|
|
this.selectionList.forEach(ele => { |
|
|
|
|
ids.push(ele.id); |
|
|
|
|
// 表单数据 |
|
|
|
|
form: {}, |
|
|
|
|
// 选择行 |
|
|
|
|
selectionList: [], |
|
|
|
|
// 表单配置 |
|
|
|
|
option: option, |
|
|
|
|
// 表单列表 |
|
|
|
|
data: [], |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
this.init(); |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
/** |
|
|
|
|
* 初始化获取本地缓存的编辑隐藏的列表 |
|
|
|
|
* 固定搭配,不能更改 |
|
|
|
|
*/ |
|
|
|
|
// let checkList=[] |
|
|
|
|
// this.columnList.map(item => { |
|
|
|
|
// item.head = false; |
|
|
|
|
// }); |
|
|
|
|
let checkListnewarr = this.$functions.getStorage(window.location.pathname + 'checkList'); |
|
|
|
|
let flexListnewarr = this.$functions.getStorage(window.location.pathname + 'flexList'); |
|
|
|
|
let sortlistnewarr = this.$functions.getStorage(window.location.pathname + 'sortlist'); |
|
|
|
|
if (checkListnewarr) { |
|
|
|
|
this.columnList.map(item => { |
|
|
|
|
item.head = false; |
|
|
|
|
}); |
|
|
|
|
checkListnewarr.map(ite => { |
|
|
|
|
this.columnList.map(item => { |
|
|
|
|
if (ite == item.label) { |
|
|
|
|
item.head = true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return ids.join(","); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
let arr = []; |
|
|
|
|
this.columnList.map(item => { |
|
|
|
|
if (item.head) { |
|
|
|
|
arr.push(item.label); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.$functions.setStorage(window.location.pathname + 'checkList', arr); |
|
|
|
|
} |
|
|
|
|
if (flexListnewarr) { |
|
|
|
|
this.columnList.map(item => { |
|
|
|
|
item.fixed = false; |
|
|
|
|
}); |
|
|
|
|
flexListnewarr.map(ite => { |
|
|
|
|
this.columnList.map(item => { |
|
|
|
|
if (ite == item.label) { |
|
|
|
|
if (item.type == 6) { |
|
|
|
|
item.fixed = 'right'; |
|
|
|
|
} else { |
|
|
|
|
item.fixed = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
let arr = []; |
|
|
|
|
this.columnList.map(item => { |
|
|
|
|
if (item.fixed) { |
|
|
|
|
arr.push(item.label); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.$functions.setStorage(window.location.pathname + 'flexList', arr); |
|
|
|
|
} |
|
|
|
|
if (sortlistnewarr) { |
|
|
|
|
this.columnList.map(item => { |
|
|
|
|
item.sortable = false; |
|
|
|
|
}); |
|
|
|
|
sortlistnewarr.map(ite => { |
|
|
|
|
this.columnList.map(item => { |
|
|
|
|
if (ite == item.label) { |
|
|
|
|
item.sortable = true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
let arr = []; |
|
|
|
|
this.columnList.map(item => { |
|
|
|
|
if (item.sortable) { |
|
|
|
|
arr.push(item.label); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.$functions.setStorage(window.location.pathname + 'sortlist', arr); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
...mapGetters(["permission"]), |
|
|
|
|
ids () { |
|
|
|
|
let ids = []; |
|
|
|
|
this.selectionList.forEach(ele => { |
|
|
|
|
ids.push(ele.id); |
|
|
|
|
}); |
|
|
|
|
return ids.join(","); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
showdrawer(value) { |
|
|
|
|
this.drawerShow = value; |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
* 弹窗的勾选回调,用于更改头部数组 |
|
|
|
|
* 固定搭配,只需要更换 columnList |
|
|
|
|
*/ |
|
|
|
|
setnewcolum(newarr, headarr, type) { |
|
|
|
|
// console.log(newarr,'+++++++++++') |
|
|
|
|
if (type == 1) { |
|
|
|
|
this.columnList = newarr; |
|
|
|
|
this.$functions.setStorage(window.location.pathname + 'checkList', headarr); |
|
|
|
|
} else if (type == 2) { |
|
|
|
|
this.columnList = newarr; |
|
|
|
|
this.$functions.setStorage(window.location.pathname + 'flexList', headarr); |
|
|
|
|
} else if (type == 3) { |
|
|
|
|
this.columnList = newarr; |
|
|
|
|
this.$functions.setStorage(window.location.pathname + 'sortlist', headarr); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
rowSave(row, done, loading) { |
|
|
|
|
add(row).then(() => { |
|
|
|
|
selectionsc(value) { |
|
|
|
|
console.log('11111', value); |
|
|
|
|
}, |
|
|
|
|
delectsolt(scope) { |
|
|
|
|
const { row } = scope; |
|
|
|
|
console.log('2222222', row); |
|
|
|
|
}, |
|
|
|
|
editsolt(scope) { |
|
|
|
|
const { row } = scope; |
|
|
|
|
console.log('33333', row); |
|
|
|
|
}, |
|
|
|
|
btnsc(index, row) { |
|
|
|
|
console.log('4444444', index, row); |
|
|
|
|
}, |
|
|
|
|
selectsc(index, row) { |
|
|
|
|
console.log(index, row); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
timesc(index, row) { |
|
|
|
|
console.log(index, row); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
inputsc(index, row) { |
|
|
|
|
console.log(index, row); |
|
|
|
|
}, |
|
|
|
|
init () { |
|
|
|
|
this.height = this.setPx(document.body.clientHeight - 340); |
|
|
|
|
}, |
|
|
|
|
searchHide () { |
|
|
|
|
this.search = !this.search; |
|
|
|
|
}, |
|
|
|
|
searchChange () { |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
}, |
|
|
|
|
searchReset () { |
|
|
|
|
this.query = {}; |
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
}, |
|
|
|
|
handleSubmit () { |
|
|
|
|
if (!this.form.id) { |
|
|
|
|
add(this.form).then(() => { |
|
|
|
|
this.box = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
done(); |
|
|
|
|
}, error => { |
|
|
|
|
loading(); |
|
|
|
|
window.console.log(error); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
rowUpdate(row, index, done, loading) { |
|
|
|
|
update(row).then(() => { |
|
|
|
|
} else { |
|
|
|
|
update(this.form).then(() => { |
|
|
|
|
this.box = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
done(); |
|
|
|
|
}, error => { |
|
|
|
|
loading(); |
|
|
|
|
console.log(error); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
rowDel(row) { |
|
|
|
|
this.$confirm("确定将选择数据删除?", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning" |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
return remove(row.id); |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleDelete() { |
|
|
|
|
if (this.selectionList.length === 0) { |
|
|
|
|
this.$message.warning("请选择至少一条数据"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.$confirm("确定将选择数据删除?", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning" |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleAdd () { |
|
|
|
|
this.title = '新增' |
|
|
|
|
this.form = {} |
|
|
|
|
this.box = true |
|
|
|
|
}, |
|
|
|
|
handleEdit (row) { |
|
|
|
|
this.title = '编辑' |
|
|
|
|
this.box = true |
|
|
|
|
getDetail(row.id).then(res => { |
|
|
|
|
this.form = res.data.data; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleView (row) { |
|
|
|
|
this.title = '查看' |
|
|
|
|
this.view = true; |
|
|
|
|
this.box = true; |
|
|
|
|
getDetail(row.id).then(res => { |
|
|
|
|
this.form = res.data.data; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleDelete () { |
|
|
|
|
if (this.selectionList.length === 0) { |
|
|
|
|
this.$message.warning("请选择至少一条数据"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.$confirm("确定将选择数据删除?", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning" |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
return remove(this.ids); |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
return remove(this.ids); |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
.then(() => { |
|
|
|
|
this.selectionClear(); |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleExport() { |
|
|
|
|
let downloadUrl = `/distributionStock/distributionStock/export-distributionStock?${this.website.tokenHeader}=${getToken()}`; |
|
|
|
|
const { |
|
|
|
|
} = this.query; |
|
|
|
|
let values = { |
|
|
|
|
}; |
|
|
|
|
this.$confirm("是否导出数据?", "提示", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
NProgress.start(); |
|
|
|
|
exportBlob(downloadUrl, values).then(res => { |
|
|
|
|
downloadXls(res.data, `备货扫描记录${dateNow()}.xlsx`); |
|
|
|
|
NProgress.done(); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
beforeOpen(done, type) { |
|
|
|
|
if (["edit", "view"].includes(type)) { |
|
|
|
|
getDetail(this.form.id).then(res => { |
|
|
|
|
this.form = res.data.data; |
|
|
|
|
}, |
|
|
|
|
rowDel (row) { |
|
|
|
|
this.$confirm("确定将选择数据删除?", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning" |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
return remove(row.id); |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
searchReset() { |
|
|
|
|
this.query = {}; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
}, |
|
|
|
|
searchChange(params, done) { |
|
|
|
|
this.query = params; |
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
this.onLoad(this.page, params); |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
selectionChange(list) { |
|
|
|
|
this.selectionList = list; |
|
|
|
|
}, |
|
|
|
|
selectionClear() { |
|
|
|
|
this.selectionList = []; |
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
}, |
|
|
|
|
currentChange(currentPage){ |
|
|
|
|
this.page.currentPage = currentPage; |
|
|
|
|
}, |
|
|
|
|
sizeChange(pageSize){ |
|
|
|
|
this.page.pageSize = pageSize; |
|
|
|
|
}, |
|
|
|
|
refreshChange() { |
|
|
|
|
this.onLoad(this.page, this.query); |
|
|
|
|
}, |
|
|
|
|
onLoad(page, params = {}) { |
|
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
|
|
const { |
|
|
|
|
} = this.query; |
|
|
|
|
|
|
|
|
|
let values = { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
getList(page.currentPage, page.pageSize, values).then(res => { |
|
|
|
|
const data = res.data.data; |
|
|
|
|
this.page.total = data.total; |
|
|
|
|
this.data = data.records; |
|
|
|
|
this.loading = false; |
|
|
|
|
this.selectionClear(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
beforeClose (done) { |
|
|
|
|
done() |
|
|
|
|
this.form = {}; |
|
|
|
|
this.view = false; |
|
|
|
|
}, |
|
|
|
|
selectionChange (list) { |
|
|
|
|
this.selectionList = list; |
|
|
|
|
}, |
|
|
|
|
selectionClear () { |
|
|
|
|
this.selectionList = []; |
|
|
|
|
// this.$refs.table.clearSelection(); |
|
|
|
|
}, |
|
|
|
|
currentChange (currentPage) { |
|
|
|
|
this.page.currentPage = currentPage; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
}, |
|
|
|
|
sizeChange (pageSize) { |
|
|
|
|
this.page.pageSize = pageSize; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
}, |
|
|
|
|
onLoad (page, params = {}) { |
|
|
|
|
this.loading = true; |
|
|
|
|
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
|
|
|
|
const data = res.data.data; |
|
|
|
|
this.page.total = data.total; |
|
|
|
|
this.data = data.records; |
|
|
|
|
this.loading = false; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style> |
|
|
|
|
</style> |
|
|
|
|