患者信息下载修改,自定义汇总统计
parent
37b4d97b99
commit
defd93e0ac
@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card style="margin-top: -15px">
|
||||
<el-form :model="formData" :rules="formRules" ref="dataForm" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="记录号:" prop="name">
|
||||
<el-input
|
||||
v-model="formData.name"
|
||||
auto-complete="off"
|
||||
:disabled="true"
|
||||
style="width: 90%"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="20">
|
||||
<el-form-item label="汇总仓库:" prop="invCode">
|
||||
<el-select v-model="formData.invCode" style="width: 90%" clearable
|
||||
placeholder="请选择所属仓库">
|
||||
<el-option
|
||||
v-for="item in invList"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.code">
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="汇总方式:" prop="statType">
|
||||
<el-select
|
||||
v-model="formData.statType"
|
||||
style="width: 90%"
|
||||
>
|
||||
<el-option label="按产品汇总" :value="1"></el-option>
|
||||
<el-option label="按批次号汇总" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="20">
|
||||
<el-form-item label="汇总区间:" prop="actDateRange">
|
||||
<el-date-picker
|
||||
:picker-options="pickerOptions"
|
||||
v-model="formData.actDateRange"
|
||||
type="daterange"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
style="width: 90%"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="20">
|
||||
<el-form-item label="备注:" prop="name">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
auto-complete="off"
|
||||
type="textarea"
|
||||
style="width: 90%"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
<div style="display: flex;float: right;padding-bottom: 15px">
|
||||
<el-button type="primary" @click.native="formSubmit()" :loading="formLoading"
|
||||
>提交
|
||||
</el-button>
|
||||
<el-button @click.native="hideForm">取消</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {filterAll, getInvListByUser} from "@/api/system/invWarehouse";
|
||||
import {systemParamConfigSave} from "@/api/system/param/systemParamConfig";
|
||||
import {createCustom} from "@/api/inout/statData";
|
||||
|
||||
export default {
|
||||
name: "DialogCreateCustom",
|
||||
props: {
|
||||
closeDialog: {
|
||||
type: Function,
|
||||
required: true,
|
||||
},
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
name: null,
|
||||
invCode: null,
|
||||
statType: null,
|
||||
actDateRange: [],
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
},
|
||||
formRules: {
|
||||
invCode: [{required: true, message: "请选择仓库", trigger: "change"}]
|
||||
,
|
||||
actDateRange: [
|
||||
{type: 'array', required: true, message: "请选择汇总区间", trigger: "change"}
|
||||
],
|
||||
statType: [
|
||||
{required: true, message: "请选择汇总方式", trigger: "change"}
|
||||
],
|
||||
|
||||
},
|
||||
deptList: [],
|
||||
invList: [],
|
||||
pickerOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
text: "最近一周",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近一个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近三个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
formLoading: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getInvList() {
|
||||
getInvListByUser().then((res) => {
|
||||
this.invList = res.data || [];
|
||||
})
|
||||
},
|
||||
getDeptList() {
|
||||
filterAll().then((res) => {
|
||||
this.deptList = res.data || [];
|
||||
this.getInvList();
|
||||
});
|
||||
},
|
||||
hideForm() {
|
||||
this.closeDialog();
|
||||
return true;
|
||||
},
|
||||
formSubmit() {
|
||||
debugger
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.formLoading = true;
|
||||
this.formData.startDate = this.formData.actDateRange[0];
|
||||
this.formData.endDate = this.formData.actDateRange[1];
|
||||
let data = Object.assign({}, this.formData);
|
||||
createCustom(data)
|
||||
.then((response) => {
|
||||
this.formLoading = false;
|
||||
if (response.code != 20000) {
|
||||
this.$message.error(response.message);
|
||||
return false;
|
||||
}
|
||||
this.$message.success("操作成功");
|
||||
this.closeDialog();
|
||||
})
|
||||
.catch(() => {
|
||||
this.formLoading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
created() {
|
||||
|
||||
this.getInvList();
|
||||
this.getDeptList();
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,434 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="el-card">
|
||||
<el-form :model="filterQuery" class="query-form" size="mini" :inline="true">
|
||||
<el-form-item class="query-form-item" label="汇总记录号:">
|
||||
<el-input v-model="filterQuery.recordKey" placeholder="请输入汇总记录号"
|
||||
clearable="true"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item class="query-form-item" label="汇总日期:">
|
||||
<el-date-picker
|
||||
:picker-options="pickerOptions"
|
||||
v-model="actDateRange"
|
||||
type="daterange"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-refresh"
|
||||
@click="onReset"
|
||||
>重置
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-search" @click="onSubmit"
|
||||
>查询
|
||||
</el-button
|
||||
>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="createStat"
|
||||
>创建汇总
|
||||
</el-button
|
||||
>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="list" style="width: 100%;" highlight-current-row class="table-fixed"
|
||||
border
|
||||
@current-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column label="序号" type="index"></el-table-column>
|
||||
<el-table-column label="仓库" prop="invName"></el-table-column>
|
||||
<el-table-column label="记录号" prop="recordKey"></el-table-column>
|
||||
<!-- <el-table-column label="名称" prop="title"></el-table-column>-->
|
||||
<el-table-column label="起始时间" prop="startDate"></el-table-column>
|
||||
<el-table-column label="结束时间" prop="endDate"></el-table-column>
|
||||
<el-table-column label="汇总方式" prop="statType">
|
||||
<template slot-scope="scope">
|
||||
<el-tag>{{ statusType[scope.row.statType] }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="汇总状态" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusFilterType(scope.row.status)">{{ status[scope.row.status] }}</el-tag>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="备注" prop="remark"></el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:limit.sync="filterQuery.limit"
|
||||
:page.sync="filterQuery.page"
|
||||
@pagination="getList"
|
||||
></pagination>
|
||||
</el-card>
|
||||
|
||||
<el-tabs type="border-card" style="margin: 15px">
|
||||
<!--单据业务详情-->
|
||||
<el-tab-pane>
|
||||
<span slot="label">{{ currentRow.title }}-详情</span>
|
||||
<el-form :inline="true" :model="detailQuery" class="query-form" size="mini">
|
||||
<el-form-item class="query-form-item" label="产品名称:">
|
||||
<el-input
|
||||
v-model="detailQuery.productName"
|
||||
placeholder="请输入产品名称"
|
||||
clearable
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item class="query-form-item" label="批次号:">
|
||||
<el-input
|
||||
v-model="detailQuery.batchNo"
|
||||
placeholder="请输入批次号"
|
||||
clearable
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item class="query-form-item" label="规格型号:">
|
||||
<el-input
|
||||
v-model="detailQuery.ggxh"
|
||||
placeholder="请输入规格型号"
|
||||
clearable
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-refresh"
|
||||
@click="resetDetailQuery"
|
||||
>重置
|
||||
</el-button>
|
||||
<el-button type="primary" @click="searchDetail"
|
||||
icon="el-icon-search"
|
||||
>查询
|
||||
</el-button>
|
||||
<el-button type="primary" @click="excel"
|
||||
icon="el-icon-upload2"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="detailLoading" :data="detailList" style="width: 100%" border
|
||||
row-key="id"
|
||||
>
|
||||
<el-table-column label="序号" type="index"></el-table-column>
|
||||
<el-table-column label="产品名称" prop="productName" width="150" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="批次号" prop="batchNo" width="120" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="规格型号" prop="ggxh" width="160" show-overflow-tooltip></el-table-column>
|
||||
<!-- <el-table-column label="仓库" prop="invName" width="160" show-overflow-tooltip></el-table-column>-->
|
||||
<el-table-column label="入库" header-align="center">
|
||||
<el-table-column label="数量" prop="inCount" width="80"></el-table-column>
|
||||
<el-table-column label="价格" prop="inPrice" width="100"></el-table-column>
|
||||
<el-table-column label="金额" prop="inAmount" width="100"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="出库" header-align="center">
|
||||
<el-table-column label="数量" prop="outCount" width="80"></el-table-column>
|
||||
<el-table-column label="价格" prop="outPrice" width="100"></el-table-column>
|
||||
<el-table-column label="金额" prop="outAmount" width="100"></el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="结余" header-align="center">
|
||||
<el-table-column label="数量" prop="balanceCount" width="80"></el-table-column>
|
||||
<el-table-column label="价格" prop="balancePrice" width="100"></el-table-column>
|
||||
<el-table-column label="金额" prop="balanceAmount" width="100"></el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="detailTotal>0"
|
||||
:total="detailTotal"
|
||||
:page.sync="detailQuery.page"
|
||||
:limit.sync="detailQuery.limit"
|
||||
@pagination="getDetailList"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
</el-tabs>
|
||||
|
||||
|
||||
<el-dialog
|
||||
title="创建出入库汇总"
|
||||
:visible.sync="dialogTableVisible"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
v-if="dialogTableVisible"
|
||||
width="45%"
|
||||
append-to-body
|
||||
>
|
||||
<DialogCreateCustom
|
||||
:closeDialog="cancelDialog"
|
||||
></DialogCreateCustom>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getStatOrderList, filterDayList, excelImport, filterCusDetailList} from "@/api/inout/statData";
|
||||
import {isBlank} from "@/utils/strUtil";
|
||||
import DialogCreateCustom from "./DialogCreateCustom";
|
||||
|
||||
export default {
|
||||
name: "IoStatCustomSearch",
|
||||
data() {
|
||||
return {
|
||||
showSearch: true,
|
||||
filterQuery: {
|
||||
recordKey: null,
|
||||
type: 4,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
page: 1,
|
||||
limit: 10,
|
||||
},
|
||||
loading: false,
|
||||
list: [],
|
||||
total: 0,
|
||||
detailQuery: {
|
||||
recordKey: null,
|
||||
productName: null,
|
||||
batchNo: null,
|
||||
ggxh: null,
|
||||
page: 1,
|
||||
limit: 10
|
||||
},
|
||||
key: null,
|
||||
detailLoading: false,
|
||||
detailList: [],
|
||||
detailTotal: 0,
|
||||
currentRow: {
|
||||
title: "日汇总记录",
|
||||
recordKey: null
|
||||
},
|
||||
actDateRange: [],
|
||||
pickerOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
text: "最近一周",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近一个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近三个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
status: {
|
||||
1: "生成中",
|
||||
2: "已完成",
|
||||
3: "汇总失败",
|
||||
},
|
||||
|
||||
|
||||
statusType: {
|
||||
1: "产品",
|
||||
2: "批次号"
|
||||
},
|
||||
dialogTableVisible: false,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
DialogCreateCustom
|
||||
},
|
||||
methods: {
|
||||
onReset() {
|
||||
this.$router.push({
|
||||
path: "",
|
||||
});
|
||||
this.filterQuery = {
|
||||
recordKey: null,
|
||||
type: 4,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
page: 1,
|
||||
limit: 10,
|
||||
};
|
||||
this.actDateRange = [];
|
||||
this.getList();
|
||||
},
|
||||
onSubmit() {
|
||||
this.loading = true;
|
||||
if (this.actDateRange !== null && this.actDateRange.length > 0) {
|
||||
this.filterQuery.startTime = this.actDateRange[0];
|
||||
this.filterQuery.endTime = this.actDateRange[1];
|
||||
} else {
|
||||
this.filterQuery.startTime = null;
|
||||
this.filterQuery.endTime = null;
|
||||
}
|
||||
this.filterQuery.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
createStat() {
|
||||
this.dialogTableVisible = true;
|
||||
},
|
||||
hideSearch() {
|
||||
this.showSearch = !this.showSearch;
|
||||
},
|
||||
handleSelectionChange(row) {
|
||||
this.currentRow = row;
|
||||
this.getDetailList();
|
||||
},
|
||||
// 清空单据详情数据列表
|
||||
clearDetailList() {
|
||||
this.detailQuery = {
|
||||
recordKey: null,
|
||||
productName: null,
|
||||
batchNo: null,
|
||||
ggxh: null,
|
||||
page: 1,
|
||||
limit: 10
|
||||
}
|
||||
this.detailLoading = false;
|
||||
this.detailList = [];
|
||||
this.detailTotal = 0;
|
||||
},
|
||||
|
||||
excel() {
|
||||
if (isBlank(this.currentRow.recordKey)) {
|
||||
return this.$message.error("请选择要导出的数据!");
|
||||
}
|
||||
let params = {billNo: this.currentRow.recordKey, key: "custom"};
|
||||
excelImport(params).then(res => {
|
||||
let blob = new Blob([res], {type: "application/vnd.ms-excel"});
|
||||
let url = window.URL.createObjectURL(blob); // 创建一个临时的url指向blob对象
|
||||
let a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.click();
|
||||
this.$message("成功")
|
||||
})
|
||||
|
||||
},
|
||||
//获取订单列表
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.clearDetailList();
|
||||
this.currentRow = {
|
||||
title: "日汇总记录",
|
||||
recordKey: null
|
||||
};
|
||||
getStatOrderList(this.filterQuery).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.code === 20000) {
|
||||
this.list = res.data.list || [];
|
||||
this.total = res.data.total || 0;
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$message.error(error.message);
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
})
|
||||
},
|
||||
resetDetailQuery() {
|
||||
this.detailQuery = {
|
||||
recordKey: null,
|
||||
productName: null,
|
||||
batchNo: null,
|
||||
ggxh: null,
|
||||
page: 1,
|
||||
limit: 10
|
||||
}
|
||||
this.getDetailList();
|
||||
},
|
||||
searchDetail() {
|
||||
this.detailQuery.page = 1;
|
||||
this.getDetailList();
|
||||
},
|
||||
getDetailList() {
|
||||
this.detailLoading = true;
|
||||
this.detailQuery.recordKey = this.currentRow.recordKey;
|
||||
filterCusDetailList(this.detailQuery).then((res) => {
|
||||
if (res.code === 20000) {
|
||||
this.detailLoading = false;
|
||||
this.detailList = res.data.list || [];
|
||||
this.detailTotal = res.data.total || 0;
|
||||
} else {
|
||||
this.detailList = [];
|
||||
this.detailTotal = 0;
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$message.error(error.message);
|
||||
this.detailList = [];
|
||||
this.detailTotal = 0;
|
||||
})
|
||||
},
|
||||
cancelDialog() {
|
||||
this.dialogTableVisible = false;
|
||||
},
|
||||
|
||||
statusFilterType(status) {
|
||||
const statusMap = {
|
||||
1: "warning",
|
||||
3: "danger",
|
||||
2: "success",
|
||||
};
|
||||
return statusMap[status];
|
||||
},
|
||||
},
|
||||
filters: {
|
||||
statusFilterType(status) {
|
||||
const statusMap = {
|
||||
false: "success",
|
||||
true: "warning",
|
||||
};
|
||||
return statusMap[status];
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
document.body.ondrop = function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue