You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
udiwms-vue-frame/src/views/collect/prescribe/prescribeDownloadDialog.vue

568 lines
18 KiB
Vue

11 months ago
<template>
11 months ago
<div>
<el-card>
10 months ago
<el-form v-if="queryList && queryList.length > 0 " :model="filterQuery" class="query-form"
@submit.native.prevent
11 months ago
size="mini" label-width="100px">
<el-row style=" display:flex; flex-wrap: wrap; ">
<template v-for="(item, index) in queryList">
10 months ago
<div v-if="showSearch || item.isImport">
11 months ago
<el-form-item v-if="item.columnType == 'input' && executeEval(row,item.expression,true)"
class="query-form-item"
:label="item.columnDesc+`:`" :key="item.id">
<el-input
v-model="filterQuery[item.columnName]"
10 months ago
:placeholder="item.columnDesc == '模糊查询' ? '单据号/单据日期/收货方/发货方' : item.columnDesc"
11 months ago
:disabled="executeEval(null,item.disabledFuc,false)"
@keyup.enter.native="executeFuc($event,'5',item.clickFuc)"
clearable
></el-input>
</el-form-item>
<el-form-item v-if="item.columnType == 'select' && executeEval(row,item.expression,true)"
class="query-form-item"
:label="item.columnDesc+`:`">
<el-select v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
clearable>
<el-option
v-for="dict in item.lableRuleObj"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item v-if="item.columnType == 'selectServer' && executeEval(row,item.expression,true)"
class="query-form-item"
:label="item.columnDesc+`:`">
<el-select
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
@change="executeFuc($event,'5',item.checkRules)"
:disabled="executeEval(null,item.disabledFuc,false)"
filterable
remote
:remote-method="(query) => executeFuc(query,'5',item.clickFuc)"
clearable>
<el-option
v-for="item in options[item.clickFuc]"
:key="item.code"
:label="item.label"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item v-if="item.columnType == 'datePicker' && executeEval(row,item.expression,true)"
class="query-form-item"
:label="item.columnDesc+`:`">
<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 v-if="item.columnType == 'date' && executeEval(row,item.expression,true)"
class="query-form-item"
:label="item.columnDesc+`:`">
<el-date-picker
v-model="filterQuery[item.columnName]"
:style="`width:${item.width+'px'}`"
value-format="yyyy-MM-dd"
:disabled="executeEval(null,item.disabledFuc,false)"
type="date"
:placeholder="item.columnDesc"
></el-date-picker>
</el-form-item>
10 months ago
</div>
11 months ago
</template>
</el-row>
</el-form>
<div class="top-right-btn">
<el-button-group>
10 months ago
<el-button icon="el-icon-view" type="primary" @click="hideSearch"></el-button>
11 months ago
<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-check" @click="downloadPrescription(2)"
11 months ago
>按查询结果下载
</el-button
>
<el-button type="primary" icon="el-icon-check" @click="downloadPrescription(1)"
11 months ago
>选中下载
</el-button
>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
11 months ago
11 months ago
<el-table v-loading="loading" :data="list" style="width: 100%;" border highlight-current-row
ref="multipleTable"
:default-sort="defaultSort"
:row-style="{ height: '32px' }" @selection-change="handleUserSelectionChange" @row-click="prescribeClick">
11 months ago
<el-table-column type="selection" width="55"></el-table-column>
<template v-for="(item, index) in tableHeader">
<el-table-column
v-if="item.columnType == 'id' && executeEval(row,item.expression,true)"
type="index" :label="item.columnDesc"></el-table-column>
<el-table-column
v-if="item.columnType == 'selection'"
type="selection"
:width="item.width"
:selectable="(row,number) => executeFuc(row,'3',item.clickFuc)"
></el-table-column>
11 months ago
11 months ago
<el-table-column
v-if="item.columnType == 'radio' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-radio :label="scope.row.id" v-model="radioCheck"><span></span></el-radio>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'laber' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
11 months ago
<span :style="{color: executeFuc(scope.row,'4',item.lableRuleObj[scope.row[item.columnName]])}">{{
item.lableRuleObj[scope.row[item.columnName]]
}}</span>
11 months ago
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'eltag' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-tag
:type="executeFuc(scope.row,'4',item,item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName])">
11 months ago
<span>{{
item.lableRuleObj ? item.lableRuleObj[scope.row[item.columnName]] : scope.row[item.columnName]
}}</span>
11 months ago
</el-tag>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- v-if="item.columnType == 'button' && executeEval(row,item.expression,true)"-->
<!-- :prop="item.columnName"-->
<!-- :label="item.columnDesc"-->
<!-- :width="item.width"-->
<!-- :key="item.columnName"-->
<!-- fixed="right"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <el-button v-for="(buttonItem, buttonIndex) in item.buttonRulObj"-->
<!-- :type="buttonItem.type"-->
<!-- :size="buttonItem.size"-->
<!-- :style="buttonItem.style"-->
<!-- :key="buttonItem"-->
<!-- v-if="executeEval(scope.row,buttonItem.hasPermi,true)"-->
<!-- :disabled="executeEval(scope.row,buttonItem.disabledFuc,false)"-->
<!-- @click.native.stop="executeFuc(scope.row,'1',buttonItem.clickFuc)"-->
<!-- >{{ buttonItem.name }}-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
v-if="item.columnType == 'text' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
11 months ago
<span :style="{color: executeFuc(scope.row,'4',item,scope.row[item.columnName])}">{{
scope.row[item.columnName]
}}</span>
11 months ago
</template>
</el-table-column>
</template>
</el-table>
11 months ago
11 months ago
<pagination
v-show="total>0"
:total="total"
:limit.sync="filterQuery.limit"
:page.sync="filterQuery.page"
@pagination="handleCurrentChange"
></pagination>
</el-card>
<el-tabs type="border-card" style="margin: 15px">
<el-tab-pane label="单据明细">
10 months ago
<CollectOrderBiz
v-if="panelALive"
:prescribeData="curRow"
10 months ago
:bizList="bizList"
></CollectOrderBiz>
</el-tab-pane>
</el-tabs>
11 months ago
</div>
11 months ago
</template>
<script>
11 months ago
import {prescribeOnline, prescribeSave} from "@/api/basic/sicker/skPersonApi";
11 months ago
import {executeFuc, getHead} from "@/utils/customConfig";
11 months ago
import {deleteDataByCode} from "@/api/basic/sicker/prescribeApi";
import {getThrOrderPage} from "@/api/collect/collectOrder";
import {getWorkBindBusTypes} from '@/api/basic/workPlace/sysWorkplaceDocuments'
10 months ago
import CollectOrderBiz from "../CollectOrderBiz"
11 months ago
11 months ago
export default {
11 months ago
name: "prescribeDownloadDialog",
props: {
closeDialog: {
type: Function,
required: true,
},
},
10 months ago
components:{CollectOrderBiz},
11 months ago
data() {
return {
actDateRange: [],
auditDateRange: [],
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]);
},
},
],
},
selectList: [],
//界面配置相关
//患者处方
tableHeader: [],
queryList: [],
tableObj: [],
fromList: [],
//处方明细
tableHeader1: [],
queryList1: [],
tableObj1: [],
fromList1: [],
10 months ago
showSearch: false,
11 months ago
filterQuery: {
busType: null,
11 months ago
billNo: null,
page: 1,
limit: 10,
},
busQuery: {
busKey: '',
workplaceCode: null,
page: 1,
limit: 100
},
options: {
getInvList: [],
getDeptList: [],
getBusType: [],
getWorkPlaceList: [],
findWorkPlace: [],
},
11 months ago
defaultSort: {prop: 'createTime', order: 'desc'},
loading: false,
list: [],
total: 0,
11 months ago
downloadPrescriptionVisible: false,
deleteData: {},
11 months ago
preLoading: false,
preDetailList: [],
preTotal: 0,
preQuery: {
prescribeCode: null,
page: 1,
limit: 10,
},
panelALive:false,
curRow: null,
10 months ago
bizList: [],
11 months ago
}
},
methods: {
//界面配置相关------------
executeFuc(row, type, clickFuc, value) {
return executeFuc(this, row, type, clickFuc, value);
},
executeEval(row, expression, defaultRet) {
if (expression) {
return eval(expression);
}
return defaultRet;
},
handleSortChange(column, prop, order) {
if (column.order === 'descending') {
this.query.sort = 'desc'
} else {
this.query.sort = 'asc'
}
this.query.orderBy = column.prop;
this.getList();
},
///界面配置相关------------end
hideSearch() {
this.showSearch = !this.showSearch;
10 months ago
this.$nextTick(() => {
console.log('组件已刷新');
});
11 months ago
},
onReset() {
this.filterQuery = {
busType: null,
billNo: null,
page: 1,
limit: 10,};
11 months ago
this.actDateRange = [];
10 months ago
// this.getList();
11 months ago
},
downloadPrescription(status) {
if(status == 1){
if (this.selectList.length == 0) {
this.$message.error("请选择下载处方")
return
}
}
let post = {
stauts: status,
billNo: this.filterQuery.billNo,
busType: this.filterQuery.busType,
endTime: this.filterQuery.endTime,
startTime: this.filterQuery.startTime,
list: this.selectList,
}
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
11 months ago
//请求后端 进行 保存 处方
prescribeSave(post).then(res => {
11 months ago
if (res.code == 20000) {
11 months ago
this.closeDialog()
this.$message.success("操作成功")
loading.close();
11 months ago
} else {
11 months ago
this.$message.error(res.message)
}
}).catch(() => {
this.$message.error(res.message)
})
},
handleUserSelectionChange(val) {
11 months ago
this.selectList = val.map(i => i)
11 months ago
},
onSubmit() {
this.filterQuery.page = 1;
this.getList();
},
getList() {
this.loading = true;
if (this.actDateRange !== null) {
this.filterQuery.startTime = this.actDateRange[0];
this.filterQuery.endTime = this.actDateRange[1];
} else {
this.filterQuery.startTime = null;
this.filterQuery.endTime = null;
}
getThrOrderPage(this.filterQuery).then(res => {
10 months ago
11 months ago
this.loading = false
10 months ago
if (res.code == 20000){
this.list = res.data.list || []
this.total = res.data.total || 0
}else {
this.$message.error(res.message)
}
11 months ago
}).catch(() => {
this.loading = false
this.list = []
this.total = 0
})
},
handleCurrentChange(val) {
this.filterQuery.page = val.page;
this.getList();
},
// prescribeClick(_this, row) {
// this.getPrescribeDetail(_this, row)
// this.getCodeDetail(_this, row)
// _this.curRow = row;
// _this.refreshCodesPanel(_this);
// },
prescribeClick(row) {
this.curRow = row;
10 months ago
this.bizList = row.bizList
this.refreshCodesPanel();
11 months ago
},
getPrescribeDetail(_this, row) {
if (row != null) {
_this.preQuery.page = 1
_this.preQuery.prescribeCode = row.code
}
_this.preLoading = true;
detail(_this.preQuery).then(res => {
_this.preLoading = false
if (res.code != 20000) {
_this.$message.error(res.message)
return
}
_this.preDetailList = res.data.items
_this.preLoading = false
}).catch(() => {
_this.preLoading = false
_this.$message.error("数据加载失败")
})
},
preHandleCurrentChange(val) {
this.filterQuery.page = val.page;
this.getPrescribeDetail(this, null);
},
11 months ago
deleteDialog(_this, row) {
11 months ago
_this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
_this.deleteOrders(row.code);
})
.catch(() => {
});
},
deleteOrders(data) {
this.loading = true;
this.deleteData.code = data;
deleteDataByCode(this.deleteData)
.then((response) => {
if (response.code == 20000) {
this.getList();
this.$message({
type: "success",
message: "删除成功!",
});
} else if (response.code == 520) {
this.$message.error(response.message);
this.getList();
} else {
this.$message.error(response.message);
this.getList();
}
})
.catch(() => {
});
},
getWorkBindBusTypes(_this) {
getWorkBindBusTypes(this.busQuery).then(res => {
if (res.code == 20000) {
let busTypes = res.data.list || [];
// _this.options.getWorkPlace = res.data.list || [];
let getWorkPlace = busTypes.map(busType => {
return {
code: busType.documentTypeCode,
label: busType.thrBusName
};
});
_this.options.getBusType = getWorkPlace
}
return
})
},
refreshCodesPanel() {
this.panelALive = false;
this.$nextTick(() => {
this.panelALive = true;
});
}
11 months ago
},
created() {
11 months ago
getHead("prescribePanel-online", "1").then((re) => {
11 months ago
// 处理返回的数据
this.tableObj = re.data;
this.tableHeader = re.data.tableList;
this.queryList = re.data.queryList;
this.fromList = re.data.fromList;
this.getWorkBindBusTypes(this)
10 months ago
// this.getList();
11 months ago
});
}
11 months ago
}
</script>
<style scoped>
11 months ago
.query-form {
display: flex;
flex-wrap: wrap;
width: 100%;
}
11 months ago
11 months ago
.query-form-item {
margin-right: 5px;
margin-bottom: 6px;
}
11 months ago
</style>