emis-frontend/src/views/emis/emisElectronicPagApply/recoveryQueryList.vue

525 lines
18 KiB
Vue
Raw Normal View History

2024-05-27 16:51:04 +00:00
<template>
<div class="app-container">
<search-form :model="queryParams" ref="queryForm" size="small" :maxShow="6" label-width="68px" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
<el-form-item :label="$t('流水号')" prop="applySeq">
<el-input
v-model="queryParams.applySeq"
:placeholder="$t('多个流水号逗号或换行隔开')"
clearable
type="textarea"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('申购时间范围(31天)')" prop="applyDate" label-width="140px">
<elDateSimplePicker clearable v-model="dateTimeRange" :placeholder="$t('申购时间')" style="z-index:9999" ></elDateSimplePicker>
</el-form-item>
<el-form-item :label="$t('发放状态')" prop="blSend">
<el-select clearable v-model="queryParams.blSend" placeholder="请选择">
<el-option
v-for="dict in dict.type.emis_proc_send_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<!-- emis_proc_send_status -->
<el-form-item label="取消状态" prop="blCancel">
<el-select clearable v-model="queryParams.blCancel" placeholder="请选择">
<el-option
v-for="dict in dict.type.emis_cancel_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="申购类型" prop="materialCode">
<el-select clearable v-model="queryParams.materialCode" placeholder="请选择">
<el-option
v-for="dict in dict.type.emis_material_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</search-form>
<XdTable v-loading="loading"
2024-06-24 01:22:55 +00:00
border
2024-05-27 16:51:04 +00:00
size="small"
:data="emisElectronicPagApplyList"
:showSearch.sync="showSearch"
:queryParams="queryParams"
:total="total"
@queryTable="getList"
@selection-change="handleSelectionChange"
@sort-change="handleSortChange"
>
<div slot="toolbar">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
@click="handleSend"
v-hasPermi="['emis:emisElectronicPagApply:add']"
>发放</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
@click="handleCancel"
v-hasPermi="['emis:emisElectronicPagApply:add']"
>取消</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['emis:emisElectronicPagApply:export']"
>导出</el-button>
</el-col>
</el-row>
</div>
<el-table-column type="selection" width="55" align="center" />
<!--
<el-table-column label="序号" align="center" min-width="60">
<template slot-scope="scope">
<span v-text="getIndex(scope.$index)"> </span>
</template>
</el-table-column>
<el-table-column label="xxx" align="left" prop="xxx" min-width="180">
<template slot-scope="scope">
<div class="link-type" @click="handleView(scope.row)">{{scope.row.orderSn}}</div>
</template>
</el-table-column>
<el-table-column label="结算状态" align="center" prop="settleStatus" :sort-orders="['descending','ascending']" sortable="custom" min-width="80">
<template slot-scope="scope">
<div v-if="scope.row.settleStatus == 0" style="color:red;">
<span class="el-tag el-tag--info">未结算</span>
</div>
<div v-if="scope.row.settleStatus == 10" style="color:red;">
<span class="el-tag">待确认</span>
</div>
<div v-if="scope.row.settleStatus == 11" style="color:green;">
<span class="el-tag el-tag--success el-tag--light">已确认</span>
</div>
<div v-if="scope.row.settleStatus == 20" >
<span class="el-tag el-tag--warning el-tag--light">待打款</span>
</div>
<div v-if="scope.row.settleStatus == 21" style="color:green;">
<span class="el-tag el-tag--success el-tag--light">已打款</span>
</div>
<div v-if="scope.row.settleStatus == 40" style="color:red;">
<span class="el-tag el-tag--danger">已拒绝</span>
</div>
</template>
</el-table-column>
-->
<el-table-column :label="$t('流水号')" align="center" prop="applySeq" min-width="100" />
<el-table-column :label="$t('申购网点')" align="center" prop="applySiteName" min-width="100" />
<el-table-column :label="$t('申购时间')" align="center" prop="applyDate" min-width="170" />
<el-table-column :label="$t('申购类型')" align="center" prop="materialCode" min-width="100" >
<template slot-scope="scope">
<dict-tag :options="dict.type.emis_material_type" :value="scope.row.materialCode"/>
</template>
</el-table-column>
<el-table-column :label="$t('单价')" align="center" prop="unitMoney" min-width="100" />
<el-table-column :label="$t('申购数量')" align="center" prop="applyCount" min-width="100" />
<el-table-column :label="$t('总金额')" align="center" prop="sumMoney" min-width="100" />
<el-table-column :label="$t('申购备注')" align="center" prop="remark" min-width="100" />
<el-table-column :label="$t('是否已发放')" align="center" prop="blSend" min-width="100" >
<template slot-scope="scope">
<span v-if="scope.row.blSend == '1'">是</span>
<span v-else>否</span>
</template>
</el-table-column>
、
<el-table-column :label="$t('发放时间')" align="center" prop="sendDate" min-width="100" />
<el-table-column :label="$t('发放人')" align="center" prop="sendManName" min-width="100" />
<el-table-column :label="$t('是否取消')" align="center" prop="blCancel" min-width="100" >
<template slot-scope="scope">
<span v-if="scope.row.blCancel == '1'">是</span>
<span v-else>否</span>
</template>
</el-table-column>
<el-table-column :label="$t('取消人')" align="center" prop="cancelManName" min-width="100" />
<el-table-column :label="$t('取消时间')" align="center" prop="cancelDate" min-width="100" />
<el-table-column :label="$t('取消站点代码')" align="center" prop="cancelSiteName" min-width="100" />
<el-table-column :label="$t('发放人')" align="center" prop="sendManName" min-width="100" />
<el-table-column :label="$t('发放中心')" align="center" prop="sendSiteName" min-width="100" />
<el-table-column :label="$t('申购人')" align="center" prop="applyManName" min-width="100" />
<el-table-column label="创建人" align="center" prop="createByName" width="80" :show-overflow-tooltip="true"/>
<el-table-column label="创建网点" align="center" prop="createSiteName" width="80" :show-overflow-tooltip="true"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="170"/>
<el-table-column label="修改人" align="center" prop="updateByName" width="80" :show-overflow-tooltip="true"/>
<el-table-column label="修改网点" align="center" prop="updateSiteName" width="80" :show-overflow-tooltip="true"/>
<el-table-column label="修改时间" align="center" prop="updateTime" width="170"/>
</XdTable>
</div>
</template>
<script>
import { listEmisElectronicPagApply, getEmisElectronicPagApply, delEmisElectronicPagApply, addEmisElectronicPagApply, updateEmisElectronicPagApply } from "@/api/emis/emisElectronicPagApply";
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
import { getDateTimeToString } from '@/utils/payutils'
import {dateToStr} from '@/utils/custom'
export default {
name: "emisElectronicPagApply",
2024-05-28 04:15:10 +00:00
components: { elDateSimplePicker, },
2024-05-27 16:51:04 +00:00
dicts: ['emis_material_type','emis_cancel_status','emis_proc_send_status'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 创建时间搜索
dateTimeRange:[],
// 总条数
total: 0,
// 网点电子面单申请表格数据
emisElectronicPagApplyList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
openForm: false,
titleForm: "",
titleEmisElectronicPagApply: "",
openEmisElectronicPagApply: false,
// 显示编辑框更多
moreInputVisible: false,
// 弹出展示层
currentId:null,
id:null,
titleView:"",
openView: false,
// 备注时间范围
daterangeApplyDate: [],
// 备注时间范围
daterangeCreateTime: [],
// 备注时间范围
daterangeUpdateTime: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
applySeq: null,
applyDate: null,
provideType: null,
applyName: null,
applyMan: null,
applyManCode: null,
applySite: null,
applySiteCode: null,
unitMoney: null,
applyCount: null,
sumMoney: null,
blSend: null,
sendDate: null,
sendMan: null,
sendManCode: null,
sendSite: null,
sendSiteCode: null,
blCancel: null,
cancelMan: null,
cancelManCode: null,
cancelDate: null,
cancelSite: null,
cancelSiteCode: null,
userSite: null,
userSiteCode: null,
startNo: null,
endNo: null,
curStartNo: null,
hasBillCount: null,
blAllowAllocate: null,
createSiteCode: null,
modifySiteCode: null,
remark: null
},
// 表单参数
form: {},
// 表单校验
rules: {
id: [
{ required: true, message: "id不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询网点电子面单申请列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if(this.dateTimeRange&&this.dateTimeRange.length==2){
let startDate = new Date(this.dateTimeRange[0]);
let endDate= new Date(this.dateTimeRange[1]);
startDate=dateToStr(startDate);
endDate=dateToStr(endDate)
this.queryParams.params["beginApplyDate"] = startDate;
this.queryParams.params["endApplyDate"] = endDate;
}
listEmisElectronicPagApply(this.queryParams).then(response => {
this.emisElectronicPagApplyList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
applySeq: null,
applyDate: getDateTimeToString(new Date()),
provideType: null,
applyName: null,
applyMan: null,
applyManCode: null,
applySite: null,
applySiteCode: null,
unitMoney: null,
applyCount: null,
sumMoney: null,
blSend: null,
sendDate: null,
sendMan: null,
sendManCode: null,
sendSite: null,
sendSiteCode: null,
blCancel: null,
cancelMan: null,
cancelManCode: null,
cancelDate: null,
cancelSite: null,
cancelSiteCode: null,
userSite: null,
userSiteCode: null,
startNo: null,
endNo: null,
curStartNo: null,
hasBillCount: null,
blAllowAllocate: null,
createSiteCode: null,
modifySiteCode: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: 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.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
// 排序 查询字段是表格中字段名字 动态取值排序顺序
handleSortChange(column) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
},
/** 新增按钮操作 */
handleAdd(row) {
this.reset();
this.openForm = true;
this.titleForm = "新增申购";
},
handleShowMoreInput(){
this.moreInputVisible = !this.moreInputVisible;
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getEmisElectronicPagApply(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改";
});
// 子组件打开模式
// this.currentId= row.id || this.ids;
// this.openEmisElectronicPagApply = true;
// this.titleEmisElectronicPagApply = "修改";
},
handleView(row) {
this.id=row.id;
this.titleView="查看";
this.openView=true;
// this.router.push({ path: '/emis/emisElectronicPagApply/viewDetail', query: { id: row.id }})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateEmisElectronicPagApply(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addEmisElectronicPagApply(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
handleFormChanged(){
this.openForm = false;
this.getList();
},
cancelForm(){
this.openForm = false;
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除').then(function() {
return delEmisElectronicPagApply(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
// this.download('emis/emisElectronicPagApply/export', {
// ...this.queryParams
// }, `emisElectronicPagApply_${new Date().getTime()}.xlsx`)
const loadingInstance = this.$loading({
text: '正在导出...'
})
var qParam = {...this.queryParams};
qParam.pageNum=1;
qParam.pageSize=5000;
listEmisElectronicPagApply(this.addDateRange(qParam, this.dateTimeRange)).then(response => {
this.downloadLoading = false
if (response.code === 200) {
const curList = response.rows
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['id','申购序号','申购时间','申购类型:网点','物料名称:电子面单','申购人','申购人编号','申购站点','申购站点编号','单价','申请数量','总金额','是否已发放','发放时间','发放人','发放人编号','发放站点','发放站点代码','是否取消','取消人','取消人代码','取消时间','取消站点','取消站点代码','面单用户站点','面单用户站点代码','分配开始编号','分配结束编号','已使用当前编号','剩余数量','是否允许自动分配单号','创建站点代码','修改站点代码','删除标志(0代表存在','创建者','创建时间','更新者','更新时间','备注',];
const filterVal = ['id','applySeq','applyDate','provideType','applyName','applyMan','applyManCode','applySite','applySiteCode','unitMoney','applyCount','sumMoney','blSend','sendDate','sendMan','sendManCode','sendSite','sendSiteCode','blCancel','cancelMan','cancelManCode','cancelDate','cancelSite','cancelSiteCode','userSite','userSiteCode','startNo','endNo','curStartNo','hasBillCount','blAllowAllocate','createSiteCode','modifySiteCode','delFlag','createBy','createTime','updateBy','updateTime','remark',];
const data = this.formatJson(filterVal, curList, response.rows)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '网点电子面单申请',
autoWidth: true
})
loadingInstance.close()
})
}
});
},
formatJson(filterVal, jsonData, resData) {
let index = 0
return jsonData.map(v => filterVal.map(j => {
if (j === 'index') {
return ++index
}
if (j === 'status') {
var statusStr='xxx'
if(v[j] == 10){
statusStr='xxx'
}
return statusStr;
}
return v[j]
}))
},
/** 列索引函数 */
getIndex($index) {
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
},
/** 时间搜索响应函数 */
dateTimeChange(value){
this.dateTimeRange=value;
},
}
};
</script>
<style scoped>
.el-divider{
margin-top: 0px;
background: 0 0;
border-top: 1px solid #E6EBF5;
}
.el-divider__text {
color: #0955ee;
cursor: pointer;
}
</style>