磅单采购查询翻页修改

product
mhsnet 2 years ago
parent 143dac0e40
commit 505d144e62

@ -1307,12 +1307,13 @@ export default {
}); });
}, },
search() { search() {
this.listQuery = { this.listQuery.currentPage = 1;
currentPage: 1, // this.listQuery = {
pageSize: 20, // currentPage: 1,
sort: "desc", // pageSize: 20,
sidx: "", // sort: "desc",
}; // sidx: "",
// };
this.initData(); this.initData();
}, },
refresh(isrRefresh) { refresh(isrRefresh) {

@ -1,18 +1,25 @@
<template> <template>
<div class="JNPF-common-layout"> <div class="JNPF-common-layout">
<div class="JNPF-common-layout-center"> <div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16"> <el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent> <el-form @submit.native.prevent>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="单据编号"> <el-form-item label="单据编号">
<el-input v-model="query.documentNo" placeholder="请输入" clearable></el-input> <el-input
v-model="query.documentNo"
placeholder="请输入"
clearable
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button> <el-button type="primary" icon="el-icon-search" @click="search()"
<el-button icon="el-icon-refresh-right" @click="resetAll()"></el-button> >查询</el-button
>
<el-button icon="el-icon-refresh-right" @click="resetAll()"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
@ -26,99 +33,208 @@
</el-button> </el-button>
<el-button type="text" icon="el-icon-download" @click="" v-has="'btn_edit1'"> <el-button type="text" icon="el-icon-download" @click="" v-has="'btn_edit1'">
</el-button> --> </el-button> -->
<el-button type="text" icon="el-icon-download" @click="exportData()" v-has="'btn_download'"> <el-button
type="text"
icon="el-icon-download"
@click="exportData()"
v-has="'btn_download'"
>导出
</el-button> </el-button>
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" v-has="'btn_batchRemove'"> <el-button
type="text"
icon="el-icon-delete"
@click="handleBatchRemoveDel()"
v-has="'btn_batchRemove'"
>批量删除
</el-button> </el-button>
</div> </div>
<div class="JNPF-common-head-right"> <div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top"> <el-tooltip effect="dark" content="刷新" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" <el-link
@click="reset()"/> icon="icon-ym icon-ym-Refresh JNPF-common-head-icon"
:underline="false"
@click="reset()"
/>
</el-tooltip> </el-tooltip>
<screenfull isContainer/> <screenfull isContainer />
</div> </div>
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c <JNPF-table
@selection-change="handleSelectionChange" custom-column border> v-loading="listLoading"
<el-table-column prop="documentNo" label="单据编号" width="200" align="center"sortable /> :data="list"
<el-table-column prop="purchaseorderdocumentno" label="来源单号" width="200" align="center"sortable/> @sort-change="sortChange"
<el-table-column prop="contractName" label="合同名称" width="200" align="center"sortable/> has-c
<el-table-column prop="supplierName" label="供应商名称" width="200" align="center"sortable/> @selection-change="handleSelectionChange"
<el-table-column prop="refundAmount" label="退货金额" width="120" align="center"sortable/> custom-column
<el-table-column prop="actualAmount" label="实退金额" width="120" align="center"sortable/> border
>
<el-table-column
prop="documentNo"
label="单据编号"
width="200"
align="center"
sortable
/>
<el-table-column
prop="purchaseorderdocumentno"
label="来源单号"
width="200"
align="center"
sortable
/>
<el-table-column
prop="contractName"
label="合同名称"
width="200"
align="center"
sortable
/>
<el-table-column
prop="supplierName"
label="供应商名称"
width="200"
align="center"
sortable
/>
<el-table-column
prop="refundAmount"
label="退货金额"
width="120"
align="center"
sortable
/>
<el-table-column
prop="actualAmount"
label="实退金额"
width="120"
align="center"
sortable
/>
<el-table-column label="币别" width="120" sortable prop="currency" align="center"> <el-table-column
label="币别"
width="120"
sortable
prop="currency"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.currency | dynamicText(currencyOptions) }} {{ scope.row.currency | dynamicText(currencyOptions) }}
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="refundNum" label="退货数量" width="120" align="center"sortable/>--> <!-- <el-table-column prop="refundNum" label="退货数量" width="120" align="center"sortable/>-->
<!-- <el-table-column label="单据状态" width="120" sortable prop="status" align="center">--> <!-- <el-table-column label="单据状态" width="120" sortable prop="status" align="center">-->
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
<!-- {{ scope.row.status | dynamicText(statusOptions) }}--> <!-- {{ scope.row.status | dynamicText(statusOptions) }}-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column prop="status" label="单据状态" sortable width="120" align="center"> <el-table-column
prop="status"
label="单据状态"
sortable
width="120"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag type="success" v-if="scope.row.status==0"></el-tag> <el-tag type="success" v-if="scope.row.status == 0"
<el-tag type="info" v-else-if="scope.row.status==1">审批中</el-tag> >已保存</el-tag
<el-tag type="warning" v-else-if="scope.row.status==2">已审批</el-tag> >
<el-tag type="info" v-else-if="scope.row.status == 1"
>审批中</el-tag
>
<el-tag type="warning" v-else-if="scope.row.status == 2"
>已审批</el-tag
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="creatorTime" label="创建时间" width="120" align="center"sortable/> <el-table-column
<el-table-column prop="creatorUserName" label="创建人" width="120" align="center"sortable/> prop="creatorTime"
<el-table-column prop="remark" label="备注" width="0" align="center"sortable/> label="创建时间"
width="120"
align="center"
sortable
/>
<el-table-column
prop="creatorUserName"
label="创建人"
width="120"
align="center"
sortable
/>
<el-table-column
prop="remark"
label="备注"
width="0"
align="center"
sortable
/>
<el-table-column label="操作" fixed="right" width="150"> <el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)" v-has="'btn_edit'"> <el-button
type="text"
@click="addOrUpdateHandle(scope.row.id)"
v-has="'btn_edit'"
>编辑
</el-button> </el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)" v-has="'btn_remove'"> <el-button
type="text"
class="JNPF-table-delBtn"
@click="handleDel(scope.row.id)"
v-has="'btn_remove'"
>删除
</el-button> </el-button>
<el-button type="text" @click="goDetail(scope.row.id)" v-has="'btn_detail'"> <el-button
type="text"
@click="goDetail(scope.row.id)"
v-has="'btn_detail'"
>详情
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</JNPF-table> </JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" <pagination
@pagination="initData"/> :total="total"
:page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize"
@pagination="initData"
/>
</div> </div>
</div> </div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/> <JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/> <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/> <Detail
v-if="detailVisible"
ref="Detail"
@refresh="detailVisible = false"
/>
</div> </div>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from "@/utils/request";
import { import { getDictionaryDataSelector } from "@/api/systemData/dictionary";
getDictionaryDataSelector import JNPFForm from "./Form";
} from '@/api/systemData/dictionary' import ExportBox from "./ExportBox";
import JNPFForm from './Form' import { getDataInterfaceRes } from "@/api/systemData/dataInterface";
import ExportBox from './ExportBox' import Detail from "./Detail";
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import Detail from './Detail'
export default { export default {
components: { components: {
JNPFForm, JNPFForm,
ExportBox, ExportBox,
Detail Detail,
}, },
data() { data() {
return { return {
detailVisible: false, detailVisible: false,
query: { query: {
documentNo: undefined documentNo: undefined,
}, },
treeProps: { treeProps: {
children: 'children', children: "children",
label: 'fullName', label: "fullName",
value: 'id' value: "id",
}, },
list: [], list: [],
listLoading: true, listLoading: true,
@ -127,246 +243,284 @@
listQuery: { listQuery: {
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
sort: 'desc', sort: "desc",
sidx: '' sidx: "",
}, },
formVisible: false, formVisible: false,
exportBoxVisible: false, exportBoxVisible: false,
columnList: [{ columnList: [
prop: 'documentNo', {
label: '单据编号' prop: "documentNo",
label: "单据编号",
}, },
{ {
prop: 'purchaseorderdocumentno', prop: "purchaseorderdocumentno",
label: '来源单号' label: "来源单号",
}, },
{ {
prop: 'contractName', prop: "contractName",
label: '合同名称' label: "合同名称",
}, },
{ {
prop: 'supplierName', prop: "supplierName",
label: '供应商名称' label: "供应商名称",
}, },
{ {
prop: 'refundAmount', prop: "refundAmount",
label: '退货金额' label: "退货金额",
}, },
{ {
prop: 'actualAmount', prop: "actualAmount",
label: '实退金额' label: "实退金额",
}, },
{ {
prop: 'currency', prop: "currency",
label: '币别 ' label: "币别 ",
}, },
{ {
prop: 'refundNum', prop: "refundNum",
label: '退货数量' label: "退货数量",
}, },
{ {
prop: 'status', prop: "status",
label: '单据状态 ' label: "单据状态 ",
}, },
{ {
prop: 'creatorTime', prop: "creatorTime",
label: '创建时间' label: "创建时间",
}, },
{ {
prop: 'creatorUserName', prop: "creatorUserName",
label: '创建人' label: "创建人",
}, },
{ {
prop: 'remark', prop: "remark",
label: '备注' label: "备注",
} },
],
currencyOptions: [
{
fullName: "人民币",
id: "0",
},
{
fullName: "美元",
id: "1",
},
{
fullName: "英镑",
id: "2",
},
], ],
currencyOptions: [{
'fullName': '人民币',
'id': '0'
}, {
'fullName': '美元',
'id': '1'
}, {
'fullName': '英镑',
'id': '2'
}],
currencyProps: { currencyProps: {
'label': 'fullName', label: "fullName",
'value': 'id' value: "id",
}, },
statusOptions: [{ statusOptions: [
'fullName': '已保存', {
'id': '0' fullName: "已保存",
}, { id: "0",
'fullName': '审批中', },
'id': '1' {
}, { fullName: "审批中",
'fullName': '已审批', id: "1",
'id': '2' },
}], {
fullName: "已审批",
id: "2",
},
],
statusProps: { statusProps: {
'label': 'fullName', label: "fullName",
'value': 'id' value: "id",
} },
} };
}, },
computed: { computed: {
menuId() { menuId() {
return this.$route.meta.modelId || '' return this.$route.meta.modelId || "";
} },
}, },
created() { created() {
this.initData() if (
sessionStorage.getItem("scm-basicInformation-purchaseback-pageSize") !==
null
) {
this.listQuery.pageSize = parseInt(
sessionStorage.getItem("scm-basicInformation-purchaseback-pageSize")
);
}
if (
sessionStorage.getItem("scm-basicInformation-purchaseback-query") !==
null
) {
let json_query = sessionStorage.getItem(
"scm-basicInformation-purchaseback-query"
);
let obj_query = JSON.parse(json_query);
this.query = obj_query;
}
this.initData();
},
beforeDestroy() {
sessionStorage.setItem(
"scm-basicInformation-purchaseback-pageSize",
this.listQuery.pageSize
);
let json_query = JSON.stringify(this.query);
sessionStorage.setItem(
"scm-basicInformation-purchaseback-query",
json_query
);
}, },
methods: { methods: {
goDetail(id) { goDetail(id) {
this.detailVisible = true this.detailVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.Detail.init(id) this.$refs.Detail.init(id);
}) });
}, },
sortChange({ sortChange({ column, prop, order }) {
column, this.listQuery.sort = order == "ascending" ? "asc" : "desc";
prop, this.listQuery.sidx = !order ? "" : prop;
order this.initData();
}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
}, },
initData() { initData() {
this.listLoading = true this.listLoading = true;
let _query = { let _query = {
...this.listQuery, ...this.listQuery,
...this.query, ...this.query,
menuId: this.menuId menuId: this.menuId,
} };
request({ request({
url: `/api/purchaseback/Purchaseback/getList`, url: `/api/purchaseback/Purchaseback/getList`,
method: 'post', method: "post",
data: _query data: _query,
}).then(res => { }).then((res) => {
var _list = [] var _list = [];
for (let i = 0; i < res.data.list.length; i++) { for (let i = 0; i < res.data.list.length; i++) {
res.data.list[i].creatorTime = res.data.list[i].creatorTime ? res.data.list[i].creatorTime.substring(0, res.data.list[i].creatorTime = res.data.list[i].creatorTime
10) : ''; ? res.data.list[i].creatorTime.substring(0, 10)
: "";
let _data = res.data.list[i] let _data = res.data.list[i];
_list.push(_data) _list.push(_data);
} }
this.list = _list this.list = _list;
this.total = res.data.pagination.total this.total = res.data.pagination.total;
this.listLoading = false this.listLoading = false;
}) });
}, },
handleDel(id) { handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
type: 'warning' type: "warning",
}).then(() => { })
.then(() => {
request({ request({
url: `/api/purchaseback/Purchaseback/${id}`, url: `/api/purchaseback/Purchaseback/${id}`,
method: 'DELETE' method: "DELETE",
}).then(res => { }).then((res) => {
this.$message({ this.$message({
type: 'success', type: "success",
message: res.msg, message: res.msg,
onClose: () => { onClose: () => {
this.initData() this.initData();
} },
}) });
}) });
}).catch(() => {
}) })
.catch(() => {});
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
const res = val.map(item => item.id) const res = val.map((item) => item.id);
this.multipleSelection = res this.multipleSelection = res;
}, },
handleBatchRemoveDel() { handleBatchRemoveDel() {
if (!this.multipleSelection.length) { if (!this.multipleSelection.length) {
this.$message({ this.$message({
type: 'error', type: "error",
message: '请选择一条数据', message: "请选择一条数据",
duration: 2500 duration: 2500,
}) });
return return;
} }
const ids = this.multipleSelection.join() const ids = this.multipleSelection.join();
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', { this.$confirm("您确定要删除这些数据吗, 是否继续?", "提示", {
type: 'warning' type: "warning",
}).then(() => { })
.then(() => {
request({ request({
url: `/api/purchaseback/Purchaseback/batchRemove/${ids}`, url: `/api/purchaseback/Purchaseback/batchRemove/${ids}`,
method: 'DELETE' method: "DELETE",
}).then(res => { }).then((res) => {
this.$message({ this.$message({
type: 'success', type: "success",
message: res.msg, message: res.msg,
onClose: () => { onClose: () => {
this.initData() this.initData();
} },
}) });
}) });
}).catch(() => {
}) })
.catch(() => {});
}, },
addOrUpdateHandle(id, isDetail) { addOrUpdateHandle(id, isDetail) {
this.formVisible = true this.formVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail) this.$refs.JNPFForm.init(id, isDetail);
}) });
}, },
exportData() { exportData() {
this.exportBoxVisible = true this.exportBoxVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ExportBox.init(this.columnList) this.$refs.ExportBox.init(this.columnList);
}) });
}, },
download(data) { download(data) {
let query = { let query = {
...data, ...data,
...this.listQuery, ...this.listQuery,
...this.query, ...this.query,
menuId: this.menuId menuId: this.menuId,
} };
request({ request({
url: `/api/purchaseback/Purchaseback/Actions/Export`, url: `/api/purchaseback/Purchaseback/Actions/Export`,
method: 'GET', method: "GET",
data: query data: query,
}).then(res => { }).then((res) => {
if (!res.data.url) return if (!res.data.url) return;
this.jnpf.downloadFile(res.data.url) this.jnpf.downloadFile(res.data.url);
this.$refs.ExportBox.visible = false this.$refs.ExportBox.visible = false;
this.exportBoxVisible = false this.exportBoxVisible = false;
}) });
}, },
search() { search() {
this.listQuery = { this.listQuery.currentPage = 1;
currentPage: 1, // this.listQuery = {
pageSize: 20, // currentPage: 1,
sort: 'desc', // pageSize: 20,
sidx: '' // sort: 'desc',
} // sidx: ''
this.initData() // }
this.initData();
}, },
refresh(isrRefresh) { refresh(isrRefresh) {
this.formVisible = false this.formVisible = false;
if (isrRefresh) this.reset() if (isrRefresh) this.reset();
}, },
reset() { reset() {
// for (let key in this.query) { // for (let key in this.query) {
// this.query[key] = undefined // this.query[key] = undefined
// } // }
this.search() this.search();
}, },
resetAll() { resetAll() {
for (let key in this.query) { for (let key in this.query) {
this.query[key] = undefined this.query[key] = undefined;
}
this.search()
}
}
} }
this.search();
},
},
};
</script> </script>

@ -674,12 +674,13 @@ export default {
}); });
}, },
search() { search() {
this.listQuery = { this.listQuery.currentPage = 1;
currentPage: 1, // this.listQuery = {
pageSize: 20, // currentPage: 1,
sort: "desc", // pageSize: 20,
sidx: "", // sort: "desc",
}; // sidx: "",
// };
this.initData(); this.initData();
}, },
refresh(isrRefresh) { refresh(isrRefresh) {

Loading…
Cancel
Save