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/src/views/inventory/sickerUdiTraceOrder.vue

521 lines
16 KiB
Vue

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<div>
<el-card class="el-card">
<el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
<el-form-item class="query-form-item" label-width="100px">
<el-input
id="inputer"
v-model="filterQuery.sickAd"
placeholder="请输入病人住院号"
clearable
ref='inputRef'
style="width: 500px"
@keypress.enter.native="enterKey($event)"
></el-input>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" icon="search" @click="getList"
>查询
</el-button>
</el-button-group>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="list"
style="width: 100%"
@row-click="getOrderDetail"
highlight-current-row
@selection-change="handleSelectionChange"
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="扫码单据类型" prop="action">
<template slot-scope="scope">
<span>{{ getActionName(scope.row.action) }}</span>
</template>
</el-table-column>
<el-table-column
label="订单号"
prop="id"
show-overflow-tooltip="true"
></el-table-column>
<el-table-column label="来源" prop="fromType">
<template slot-scope="scope">
<span>{{ fromTypeMap[scope.row.fromType] }}</span>
</template>
</el-table-column>
<el-table-column label="往来单位" prop="fromCorp" width="250">
</el-table-column>
<el-table-column
label="创建时间"
prop="actDate"
width="150"
show-overflow-tooltip="true"
>
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span>{{ scope.row.actDate }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="操作" fixed="right" width="120">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- type="text"-->
<!-- size="small"-->
<!-- @click.native.stop="intentDetail(scope.row)"-->
<!-- >详情-->
<!-- </el-button-->
<!-- >-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<el-pagination
:page-size="filterQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:current-page="filterQuery.page"
:total="total"
></el-pagination>
</el-card>
<el-card class="el-card" v-if="true" id="printJS-form">
<el-table
v-loading="loading"
:row-class-name="tableRowClassName"
:data="detailList"
style="width: 100%"
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="UDI码"
prop="code"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="产品通用名"
prop="coName"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="包装规格"
prop="packSpec"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
width="100"
label="批次号"
prop="batchNo"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="生产日期"
prop="productDate"
width="100"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="失效日期"
prop="expireDate"
width="100"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="生产企业"
prop="productCompany"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="注册/备案凭证号"
prop="authCode"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column label="操作" fixed="right" width="120">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="intentDetail(scope.row)"
>流向详情
</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog
title="单号详情"
:visible.sync="codeDetailVisible"
width="80%"
v-if="codeDetailVisible"
>
<codeDetail
:idQuery="idQuery"
v-on:closeDetailDialog="closeDetailDialog"
></codeDetail>
</el-dialog>
<el-dialog
title="UDI码流向"
:visible.sync="udiCodeTraceVisible"
width="80%"
v-if="udiCodeTraceVisible"
>
<udiCodeTrace
:udiCode="udiCode"
:diloadTrue="false"
v-on:closeDetailDialog="closeDetailDialog"
></udiCodeTrace>
</el-dialog>
<el-dialog title="校验信息" :visible.sync="errDialogVisible" width="30%">
<span>{{ errorDetail }}</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="errDialogVisible = false"
> </el-button
>
</span>
</el-dialog>
</div>
</template>
<script>
import {
orderDetail,
} from "../../api/warehouse/order";
import {repeatCheck} from "../../api/erp/erpOrder";
import draggable from "vuedraggable";
import codeDetail from "../warehouse/code";
import udiCodeTrace from "./invUdiTraceOrder"
import {getBussinessType} from "../../api/basic/bussinessType";
import {filterSickTrace} from "@/api/inventory/invSickTrace";
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
import A from "@/plugin/KeyScaner";
export default {
name: "sickerUdiTraceOrder",
data() {
return {
query: {
code: null,
batchNo: null,
productIdFk: null,
customerId: null,
page: 1,
limit: 20,
supId: null,
},
sitcomScan: false,
checkStatus: {
1: "校验异常",
0: "未校验",
2: "正常",
},
fromOptions: [],
erpCheckStatus: {
1: "校验异常",
0: "未校验",
2: "校验成功",
},
fromTypeMap: {
"1": "UDIMS平台",
"2": "网页新增",
"3": "pda即时校验",
"4": "pda未校验",
"5": "pc端扫码精灵",
"6": "缺量补录单据",
"7": "UDI供应商平台",
"8": "平衡补录单据",
"10": "手动补单"
},
//往来单位
list: [],
detailList: [],
filterQuery: {
sickAd: null,
page: 1,
limit: 20,
},
detailQuery: {
orderId: "",
},
deleteData: {
id: "",
},
idQuery: {
id: "",
},
curIndex: "",
adListNoDataText: "无数据",
codeDetailVisible: false,
udiCodeTraceVisible: false,
udiCode: null,
total: 0,
loading: false,
index: null,
formName: null,
orderId: "",
formMap: {
add: "新增",
edit: "编辑",
},
exportQuery: {
orderId: "",
exportStatus: "",
},
uploadQuery: {
orderId: "",
},
busTypes: [],
multipleSelection: [],
dialogTableVisible: false,
formLoading: false,
formVisible: false,
deleteLoading: false,
addDialogVisible: false,
errDialogVisible: false,
};
},
components: {
draggable,
codeDetail,
udiCodeTrace,
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
code: null,
batchNo: null,
productIdFk: null,
customerId: null,
page: 1,
limit: 20,
supId: null,
};
this.actDateRange = [];
this.getList();
},
enterKey(event) {
this.$refs.inputRef.select();
this.onSubmit();
},
onSubmit() {
this.getList();
},
handleSizeChange(val) {
this.filterQuery.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleErrorDetail(poistion) {
var mOrder = this.list[poistion];
this.errorDetail = mOrder.remark;
this.errDialogVisible = true;
},
findMethod(query) {
this.fromOptions = [];
let cQuery = {
key: query,
};
getBasicUnitMaintains(cQuery)
.then((response) => {
this.loading = false;
this.fromOptions = response.data.page.list || [];
})
.catch(() => {
this.loading = false;
});
},
//获取订单列表
getList() {
this.loading = true;
if (!this.$isBlank(this.filterQuery.sickAd)) {
let code = this.filterQuery.sickAd;
this.filterQuery.sickAd = code.replace("\r", "")
}
filterSickTrace(this.filterQuery)
.then((response) => {
if (response.code == 20000) {
this.loading = false;
this.list = response.data.list || [];
this.detailList = [];
this.total = response.data.total || 0;
} else {
this.loading = false;
this.list = [];
this.detailList = [];
this.total = 0;
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
//业务明细表
getOrderDetail(row) {
this.loading = true;
this.detailQuery = {
orderId: row.id,
showType: 1,
};
this.refresgOrderDetail();
},
refresgOrderDetail() {
orderDetail(this.detailQuery)
.then((response) => {
this.loading = false;
this.detailList = response.data || [];
})
.catch(() => {
this.loading = false;
this.detailList = [];
});
},
intentDetail(row) {
// this.codeDetailVisible = true;
this.udiCode = row.code;
this.udiCodeTraceVisible = true;
this.idQuery.id = row.id;
},
tableRowClassName({row, rowIndex}) {
if (row.reCount === row.count) {
return "success-row";
} else {
return "warning-row";
}
},
closeDetailDialog(val) {
this.codeDetailVisible = false;
this.udiCodeTraceVisible = false;
},
cancelDialog() {
this.addDialogVisible = false;
},
importOrder(row) {
this.orderId = row.id;
this.addDialogVisible = true;
},
getBusType() {
let query = {
enabled: true,
};
getBussinessType(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.filterQuery.billAction = this.busTypes[0].action;
})
.catch(() => {
});
},
getActionName(action) {
for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].action === action) {
return this.busTypes[i].name;
}
}
},
},
filters: {
statusFilterType(status) {
const statusMap = {
false: "success",
true: "danger",
};
return statusMap[status];
},
},
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
var that = this;
var inputer = document.getElementById("inputer");
window.sc = new A.KeyScaner(inputer);
sc.onInput = function (text) {
if (text.includes("delete")) {
that.filterQuery.sickAd = "";
return;
}
if (that.sitcomScan) {
that.filterQuery.sickAd = that.filterQuery.sickAd;
} else {
that.filterQuery.sickAd = text;
}
};
inputer.focus();//别忘了给要监听的节点放置焦点如果是div一类默认不具备焦点的节点需要给它加上“tabindex”属性。不建议传入document、Body等全局节点可能会影响其它输入控件的流畅性。
},
created() {
this.getBusType();
let query = this.$route.query;
this.query = Object.assign(this.query, query);
this.query.limit = parseInt(this.query.limit);
// 加载表格数据
// this.getList();
},
};
</script>
<style scoped>
#inputer {
width: 100%;
min-height: 30px;
background-color: white;
border: #d0d0d0;
border-style: solid;
border-width: 0.1px;
color: #4a4a4a;
}
#inputer:focus {
width: 100%;
min-height: 30px;
background-color: white;
border: #0080FF;
border-style: solid;
border-width: 0.1px;
color: #4a4a4a;
}
.el-table .warning-row {
background: #ffb5b5;
}
.el-table .success-row {
background: #ffffff;
}
</style>