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

464 lines
16 KiB
Vue
Raw Normal View History

2024-05-27 16:51:04 +00:00
<template>
<div class="app-container">
2024-05-28 04:15:10 +00:00
<SearchForm slot="pageHeader" class="queryForm" :model="queryParams" ref="queryForm" size="mini" :maxShow="16" label-width="100px" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
<el-col :span="8">
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
<el-col :span="24">
<el-form-item :label="$t('流水号')" prop="applySeq">
<XdTextareaInput
v-model="queryParams.applySeq"
:placeholder="$t('多个流水号逗号或换行隔开')"
clearable
:rows="2"
/>
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="16">
<el-form-item :label="$t('发放状态')" prop="blSend">
2024-05-27 16:51:04 +00:00
<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>
2024-05-28 04:15:10 +00:00
</el-col>
</el-row>
<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>
</SearchForm>
2024-05-27 16:51:04 +00:00
<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="handleAdd"
v-hasPermi="['emis:emisElectronicPagApply:add']"
>新增申购</el-button>
</el-col>
</el-row>
</div>
<el-table-column type="selection" width="55" align="center" />
2024-05-28 04:15:10 +00:00
<el-table-column :label="$t('流水号')" align="center" prop="applySeq" min-width="180" />
2024-05-27 16:51:04 +00:00
<el-table-column :label="$t('申购网点')" align="center" prop="applySiteName" min-width="100" />
<el-table-column :label="$t('申购时间')" align="center" prop="applyDate" min-width="170" />
2024-05-28 04:15:10 +00:00
<el-table-column :label="$t('物料品名')" align="center" prop="materialCode" width="80" >
2024-05-27 16:51:04 +00:00
<template slot-scope="scope">
<dict-tag :options="dict.type.emis_material_type" :value="scope.row.materialCode"/>
</template>
</el-table-column>
2024-05-28 04:15:10 +00:00
<el-table-column :label="$t('单价')" align="center" prop="unitMoney" width="80" />
<el-table-column :label="$t('申购数量')" align="center" prop="applyCount" width="80" />
2024-05-27 16:51:04 +00:00
<el-table-column :label="$t('总金额')" align="center" prop="sumMoney" min-width="100" />
<el-table-column :label="$t('申购备注')" align="center" prop="remark" min-width="100" />
2024-05-28 04:15:10 +00:00
<el-table-column :label="$t('是否发放')" align="center" prop="blSend" width="100" >
2024-05-27 16:51:04 +00:00
<template slot-scope="scope">
2024-05-28 04:15:10 +00:00
<el-tag type="success" v-if="scope.row.blSend == '1'">是</el-tag>
2024-05-27 16:51:04 +00:00
<span v-else>否</span>
</template>
</el-table-column>
2024-05-28 04:15:10 +00:00
<el-table-column :label="$t('发放时间')" align="center" prop="sendDate" min-width="170" />
2024-05-27 16:51:04 +00:00
<el-table-column :label="$t('发放人')" align="center" prop="sendManName" min-width="100" />
2024-05-28 04:15:10 +00:00
<el-table-column :label="$t('发放网点')" align="center" prop="sendSiteName" min-width="100" />
2024-05-27 16:51:04 +00:00
2024-05-28 04:15:10 +00:00
<el-table-column :label="$t('是否取消')" align="center" prop="blCancel" width="100" >
2024-05-27 16:51:04 +00:00
<template slot-scope="scope">
2024-05-28 04:15:10 +00:00
<el-tag type="danger" v-if="scope.row.blCancel == '1'">是</el-tag>
2024-05-27 16:51:04 +00:00
<span v-else>否</span>
</template>
</el-table-column>
<el-table-column :label="$t('取消人')" align="center" prop="cancelManName" min-width="100" />
2024-05-28 04:15:10 +00:00
<el-table-column :label="$t('取消时间')" align="center" prop="cancelDate" min-width="170" />
<el-table-column :label="$t('取消网点')" align="center" prop="cancelSiteName" min-width="100" />
2024-05-27 16:51:04 +00:00
<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" />
</XdTable>
<el-dialog :title="titleForm" :visible.sync="openForm" width="50%" :destroy-on-close="true" v-dialogDrag append-to-body>
2024-05-28 04:15:10 +00:00
<applyForm :id="currentId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></applyForm>
2024-05-27 16:51:04 +00:00
</el-dialog>
</div>
</template>
<script>
import { listEmisElectronicPagApply, getEmisElectronicPagApply, delEmisElectronicPagApply, addEmisElectronicPagApply, updateEmisElectronicPagApply } from "@/api/emis/emisElectronicPagApply";
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
2024-05-28 04:15:10 +00:00
import applyForm from '@/views/emis/emisElectronicPagApply/applyForm';
2024-05-27 16:51:04 +00:00
import { getDateTimeToString } from '@/utils/payutils'
import {dateToStr} from '@/utils/custom'
export default {
name: "ApplyList",
2024-05-28 04:15:10 +00:00
components: { elDateSimplePicker,applyForm },
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,
2024-05-28 04:15:10 +00:00
prefix: null,
2024-05-27 16:51:04 +00:00
applySeq: null,
applyDate: null,
provideType: null,
2024-05-28 04:15:10 +00:00
materialCode: null,
materialName: null,
2024-05-27 16:51:04 +00:00
applyManCode: null,
applySiteCode: null,
applyCount: null,
2024-05-28 04:15:10 +00:00
unitMoney: null,
2024-05-27 16:51:04 +00:00
sumMoney: null,
blSend: null,
sendDate: null,
sendManCode: null,
sendSiteCode: null,
2024-05-28 04:15:10 +00:00
sendCenterManCode: null,
sendCenterSiteCode: null,
2024-05-27 16:51:04 +00:00
blCancel: null,
cancelManCode: null,
cancelDate: null,
cancelSiteCode: null,
userSiteCode: null,
2024-05-28 04:15:10 +00:00
provideFlag: null,
delFlag: null,
remark: null,
2024-05-27 16:51:04 +00:00
},
// 表单参数
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>