预验收功能

prod
anthonywj 2 years ago
parent c794bbdad4
commit 1d6fcd8a40

@ -0,0 +1,24 @@
import axios from '@/utils/request'
export function filterTrace(query) {
return axios({
url: "/spms/inv/products/trace",
method: "get",
params: query
});
}
export function filterOrderTrace(query) {
return axios({
url: "/spms/inv/products/order/trace",
method: "get",
params: query
});
}

@ -0,0 +1,29 @@
import axios from '@/utils/request'
import request from "@/utils/request";
export function filterPrein(query) {
return axios({
url: "/udiwms/inv/prein/filter",
method: "get",
params: query
});
}
export function filterDetail(query) {
return axios({
url: "/udiwms/inv/prein/detail",
method: "get",
params: query
});
}
export function deleterPrein(data) {
return request({
url: "/udiwms/inv/prein/delete",
method: "post",
data: data
});
}

@ -5,7 +5,7 @@
<span>单据设置</span>
<el-row type="flex">
<el-col :span="24">
<div class="check-box-group" style="margin-top: 12px;">
<div class="check-box-group" style="margin-top: 12px">
<el-checkbox v-model="inputQuery.enable" style="width: 200px"
border>启用单据类型
</el-checkbox>
@ -18,14 +18,15 @@
border>允许科室多次使用出库
</el-checkbox>
<el-checkbox v-model="inputQuery.outToSpms" style="width: 200px;margin-left: -1px;margin-top: 15px" border>手持终端提交单据至自助平台
<el-checkbox v-model="inputQuery.outToSpms" style="width: 200px;" border>
手持终端提交单据至自助平台
</el-checkbox>
</div>
</el-col>
</el-row>
<el-row type="flex">
<el-row type=" flex">
<el-col :span="24">
<div class="check-box-group">
<el-checkbox v-model="inputQuery.entrutSpms" style="width: 200px" border>允许验收自助平台单据
@ -37,23 +38,24 @@
<el-checkbox v-model="inputQuery.preIn" style="width: 200px" border>预验收
</el-checkbox>
<el-checkbox v-model="inputQuery.spUse" style="width: 200px;margin-left: -1px;margin-top: 15px" border>允许供应商使用
<el-checkbox v-model="inputQuery.spUse" style="width: 200px;" border>
允许供应商使用
</el-checkbox>
</div>
</el-col>
</el-row>
<el-row>
<div class="check-box-group">
<el-checkbox v-model="inputQuery.preInBack" style="width: 200px" border>预验收是否带回
</el-checkbox>
</div>
</el-row>
<el-divider></el-divider>
<span>单据默认选项</span>
<el-row type="flex">
<el-col :span="24">
<div class="check-box-group" style="margin-top: 12px">
<el-checkbox v-model="inputQuery.ullageFill" :disabled="!inputQuery.changeEnable" style="width: 200px"
border>单据默认自动补单
</el-checkbox>
<el-checkbox v-model="inputQuery.scanPreIn" :disabled="inputQuery.corpType!='1'" style="width: 200px"
border>出库时必须校验预验收库存
</el-checkbox>
@ -62,7 +64,7 @@
style="width: 200px" border>是否只允许有库存产品出库
</el-checkbox>
<el-checkbox v-model="inputQuery.codeFillCheck" style="width: 200px;margin-left: -1px;margin-top: 15px" border>采集UDI码时进行三期校验
<el-checkbox v-model="inputQuery.codeFillCheck" style="width: 200px;" border>采集UDI码时进行三期校验
</el-checkbox>
</div>
</el-col>
@ -94,7 +96,7 @@
</el-checkbox>
<el-checkbox v-model="inputQuery.checkUdims" :disabled="!inputQuery.checkEnable"
style="width: 200px;margin-left: -1px;margin-top: 15px" border>UDIMS平台
style="width: 200px;" border>UDIMS平台
</el-checkbox>
</div>
@ -116,7 +118,7 @@
border>自动补单
</el-checkbox>
<el-checkbox v-model="inputQuery.checkBalance" :disabled="!inputQuery.checkEnable" style="width: 200px;margin-left: -1px;margin-top: 15px"
<el-checkbox v-model="inputQuery.checkBalance" :disabled="!inputQuery.checkEnable" style="width: 200px;"
border>平衡补单
</el-checkbox>
@ -161,7 +163,7 @@
border>手持终端已校验单据
</el-checkbox>
<el-checkbox v-model="inputQuery.secCheckUdims" :disabled="!inputQuery.secCheckEnable" style="width: 200px;margin-left: -1px;margin-top: 15px"
<el-checkbox v-model="inputQuery.secCheckUdims" :disabled="!inputQuery.secCheckEnable" style="width: 200px;"
border>UDIMS平台
</el-checkbox>
</div>
@ -184,7 +186,7 @@
</el-checkbox>
<el-checkbox v-model="inputQuery.secCheckBalance" :disabled="!inputQuery.secCheckEnable"
style="width: 200px;margin-left: -1px;margin-top: 15px" border>平衡补单
style="width: 200px;" border>平衡补单
</el-checkbox>
</div>
</el-col>
@ -226,8 +228,8 @@ export default {
<style scoped>
.check-box-group {
margin-bottom: 18px;
margin-left: 25px;
margin-bottom: 12px;
}
</style>

@ -217,7 +217,8 @@ export default {
preIn: null,
originAction: null,
checkBalance: null,
secCheckBalance: null
secCheckBalance: null,
preInBack:null,
},
enableMap: {
true: "是",
@ -408,7 +409,8 @@ export default {
orderVisibleType: null,
advanceType: null,
preIn: null,
originAction: null
originAction: null,
preInBack:null,
}
this.addDialogVisible = true;
},

@ -0,0 +1,404 @@
<template>
<div>
<el-card class="el-card">
<div>
<el-form :model="unionQuery" size="mini" label-width="125px" v-show="showSearch">
<el-row>
<el-col :span="18">
<el-form-item class="query-form-item" label="UDI码:">
<el-input v-model="unionQuery.udiCode"
placeholder="请扫描或输入UDI码"
clearable="true"
@keyup.enter.native="keyup_submit($event)"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item class="query-form-item" label="销售单元产品标识">
<el-input
v-model="unionQuery.nameCode" clearable="true"
size="mini"
placeholder="请输入完整DI"
@keyup.enter.native="keyup_submit($event)"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="医疗器械注册人:">
<el-select
v-model="unionQuery.ylqxzcrbarmc"
filterable
remote
style="width: 100%"
clearable="true"
reserve-keyword
placeholder="医疗器械注册人"
:remote-method="findMethod"
:loading="loading"
>
<el-option
v-for="item in fromOptions"
:key="item.ylqxzcrbarmc"
:label="item.ylqxzcrbarmc"
:value="item.ylqxzcrbarmc"
>
<span style="float: left">{{ item.ylqxzcrbarmc }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="器械通用名称:">
<el-input
:disabled="unionQuery.ylqxzcrbarmc==null || unionQuery.ylqxzcrbarmc==''"
v-model="unionQuery.cpmctymc" clearable="true"
size="mini"
placeholder="器械通用名称"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="规格型号:" class="query-form-item">
<el-input
v-model="unionQuery.ggxh" clearable="true"
:disabled="(unionQuery.cpmctymc=='' && unionQuery.nameCode=='' && unionQuery.ylqxzcrbarmc==null)"
placeholder="规格型号"
size="mini"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="注册证/备案号:" class="query-form-item">
<el-input
v-model="unionQuery.zczbhhzbapzbh" clearable="true"
:disabled="(unionQuery.cpmctymc=='' && unionQuery.nameCode=='' && unionQuery.ylqxzcrbarmc==null)"
placeholder="注册证/备案号"
size="mini"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="top-right-btn" style="display:flex;">
<el-button-group>
<el-button icon="el-icon-view" type="primary" @click="hideSearch">/
</el-button>
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="searchList" size="mini"
>查询
</el-button
>
</el-button-group>
<el-upload
:action="uploadFileUrl"
multiple
:limit="1"
:data="uploadData"
:show-file-list="false"
:on-success="handleChange"
:on-exceed="handleExceed"
:before-upload="handleBefore"
icon="el-icon-search"
:file-list="fileList"
>
<el-button type="primary" icon="el-icon-bottom-right" style="margin-left: 15px">导入器械信息</el-button>
</el-upload>
</div>
<el-table
:data="udidlList"
style="width: 100%"
@row-click="intentDetail"
v-loading="loading"
border
highlight-current-row="true"
:row-class-name="tableRowClassName"
@current-change="handleErpChange"
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="产品标识"
prop="nameCode"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="产品名称"
prop="cpmctymc"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="规格型号"
prop="ggxh"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="医疗器械注册人"
prop="ylqxzcrbarmc"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="注册证编号"
prop="zczbhhzbapzbh"
show-overflow-tooltip
></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="diDetail(scope.row)"
>详情
</el-button
>
</template>
</el-table-column>
</el-table>
<el-pagination
:page-size="unionQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
:current-page="unionQuery.page"
></el-pagination>
</div>
</el-card>
<el-dialog
title="器械信息详情"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="selectDialog"
width="65%"
append-to-body
v-if="selectDialog"
>
<selectDiDetail :editQuery="diDetails"
></selectDiDetail>
</el-dialog>
</div>
</template>
<script>
import {getUdiInfos, filterCompany} from "@/api/basic/udiInfo";
import axios from "axios";
import selectDiDetail from "../product/SelectDIDetailDialog";
export default {
name: "UdiInfoDb",
data() {
return {
unionQuery: {
page: 1,
limit: 10,
udiCode: null,
nameCode: "",
cpmctymc: "",
ylqxzcrbarmc: null,
ggxh: "",
zczbhhzbapzbh: "",
isCheck: 1
},
combineLoading: false,
combineQuery: {
thirdId: "",
relId: "",
erpName: "",
keys: [],
},
checked: true,
udidlList: [],
erpList: [],
pageTotal: 1,
total: 1,
currentRow: null,
fromOptions: [],
loading: false,
erpLloading: false,
multipleUdiSelection: [],
data: {},
uploadFileUrl: null,
uploadData: {
thirdSys: "thirdId",
},
selectDialog: false,
diDetails: null,
showSearch: true,
};
},
methods: {
hideSearch() {
this.showSearch = !this.showSearch;
},
onReset() {
this.unionQuery = {
page: 1,
limit: 10,
udiCode: null,
nameCode: "",
cpmctymc: "",
ylqxzcrbarmc: null,
ggxh: "",
zczbhhzbapzbh: "",
isCheck: 1
};
},
searchList() {
this.unionQuery.page = 1;
this.getList();
},
getList() {
if (
this.unionQuery.udiCode == "" &&
this.unionQuery.nameCode == "" &&
this.unionQuery.cpmctymc == "" &&
this.unionQuery.ylqxzcrbarmc == "" &&
this.unionQuery.ggxh == "" &&
this.unionQuery.zczbhhzbapzbh == ""
) {
this.$message.warning("请输入查询条件");
return;
}
this.loading = true;
// this.unionQuery.page = 1;
getUdiInfos(this.unionQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.udidlList = response.data.list || [];
this.total = response.data.total || 0;
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.udidlList = [];
this.total = 0;
});
},
keyup_submit(event) {
this.unionQuery.page = 1;
this.getList();
event.target.select();
},
checkSelectable(row) {
return !row.check;
},
handleCurrentChange(val) {
this.unionQuery.page = val;
this.getList();
},
tableRowClassName({row, rowIndex}) {
if (row.check) return "warning-row";
return "";
},
handleErpChange(val) {
this.currentRow = val;
},
intentBack() {
this.closeDialog();
},
handleSelectionUdiChange(val) {
this.multipleUdiSelection = val;
},
findMethod(query) {
let cQuery = {
ylqxzcrbarmc: query,
page: 1,
limit: 10,
};
filterCompany(cQuery)
.then((response) => {
this.loading = false;
this.fromOptions = response.data || [];
})
.catch(() => {
this.loading = false;
this.options = [];
});
},
handleExceed() {
this.$message.error("上传数量超出!");
},
handleBefore() {
this.loading = true;
},
handleChange(response, files, fileList) {
if (response.code != 20000) {
this.loading = false;
this.$message.error(response.message);
} else {
this.loading = false;
this.$message.success(response.data);
}
},
diDetail(row) {
this.diDetails = row;
this.selectDialog = true;
},
init() {
axios.get("./config.json").then(res => {
let response = res.data.UDI_SYNC_SERVER_IP + "";
this.uploadFileUrl = response + "udisync/udiInfo/upload";
});
},
},
created() {
this.init();
},
components: {
selectDiDetail,
},
};
</script>
<style scoped>
.checkitemTag {
float: left;
text-align: left;
margin-top: 5px;
width: 100%;
}
div /deep/ .el-table .warning-row {
background: #bebebe;
}
div /deep/ .el-table .success-row {
background: #ffffff;
}
.el-card {
margin-right: 20px;
/*transition: all .5s;*/
}
.query-form-item {
display: block !important;
margin-right: 10px;
margin-bottom: 5px;
}
</style>

@ -0,0 +1,181 @@
<template>
<div>
<el-form :model="query" class="query-form" size="mini">
<el-col :span="14">
<el-form-item class="query-form-item" label="UDI码" label-width="100px">
<el-input v-model="query.code" placeholder="条码查询"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item style="margin-left: 20px">
<el-button-group>
<el-button type="primary" icon="el-icon-search" @click="getCodeList"
>查询
</el-button
>
</el-button-group>
</el-form-item>
</el-col>
</el-form>
<el-table v-loading="loading" :data="codeArry" style="width: 100%" border>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="条码"
prop="code"
width="300"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="生产日期"
prop="produceDate"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="失效日期"
prop="expireDate"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="批次号"
prop="batchNo"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="序列号"
prop="serialNo"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="扫码数量"
prop="count"
width="180"
show-overflow-tooltip
></el-table-column>
</el-table>
<el-pagination
:page-size="query.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next,total"
:total="total"
:current-page="query.page"
>
</el-pagination>
<pagination
v-show="total>0"
:total="total"
:page.sync="query.page"
:limit.sync="query.limit"
@pagination="getList"
/>
</div>
</template>
<script>
import draggable from "vuedraggable";
import {findByOrderId} from "@/api/inout/code";
export default {
name: "idQuery",
props: {
idQuery: {
type: Object,
required: true,
},
},
data() {
return {
query: {
code: "",
corpOrderId: "",
page: 1,
limit: 20,
},
codeArry: [],
total: 0,
loading: true,
index: null,
formLoading: false,
formVisible: false,
deleteLoading: false,
orderNo: null,
};
},
components: {
draggable,
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.query = {
code: "",
corpOrderId: "",
page: 1,
limit: 20,
};
this.getCodeList();
},
onSubmit() {
this.$router.push({
path: "",
query: this.query,
});
this.getCodeList();
},
handleSizeChange(val) {
this.query.limit = val;
this.getCodeList();
},
handleCurrentChange(val) {
this.query.page = val;
this.getCodeList();
},
getCodeList() {
this.loading = true;
this.query.orderId = this.idQuery.billNo;
findByOrderId(this.query) //
.then((response) => {
this.loading = false;
this.codeArry = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
intentBack() {
// this.$router.push({path:'../readme/detail',query:{id:row.corpOrderId}});
this.$router.go(-1);
},
},
filters: {},
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
},
created() {
//
let query = this.$route.query;
this.orderNo = query.id;
this.query = Object.assign(this.query, query);
this.query.limit = parseInt(this.query.limit);
this.query.corpOrderId = query.id;
//
this.getCodeList();
},
};
</script>

@ -0,0 +1,488 @@
<template>
<div>
<el-card class="el-card">
<el-form :model="filterQuery" class="query-form" size="mini" label-width="100px" v-show="showSearch">
<el-row>
<el-col :span="8">
<el-form-item class="query-form-item" label="预验收单号:">
<el-input v-model="filterQuery.billNo" placeholder="单号"
clearable="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="供应商:">
<el-select
v-model="filterQuery.fromCorp"
style="width: 90%"
filterable
remote
clearable="true"
reserve-keyword
placeholder="请选择供应商"
:remote-method="findMethod"
:loading="loading"
>
<el-option
v-for="item in fromOptions"
:key="item.name"
:label="item.name"
:value="item.erpId"
>
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="top-right-btn">
<el-button-group>
<el-button icon="el-icon-view" type="primary" @click="hideSearch">/</el-button>
<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-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row
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="billNo" show-overflow-tooltip></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="fromCorpName" width="220">
</el-table-column>
<el-table-column label="当前部门" prop="deptName" width="120">
</el-table-column>
<el-table-column label="当前仓库" prop="invName" width="120">
</el-table-column>
<el-table-column label="创建时间" prop="createTime" show-overflow-tooltip>
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="deleteDialog(scope.row)"
>删除
</el-button
>
</template>
</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">预验收库存详情</span>
<el-form :model="codeQuery" class="query-form" size="mini" label-width="100px">
<el-row>
<el-col :span="11">
<el-form-item class="query-form-item" label="UDI码:">
<el-input
v-model="codeQuery.code"
placeholder="请输入UDI码"
clearable
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item>
<el-button-group>
<el-button
type="primary"
icon="el-icon-refresh"
@click="onCodeReset"
>重置
</el-button>
<el-button type="primary" @click="onCodeSubmit"
icon="el-icon-search"
>查询
</el-button
>
</el-button-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table v-loading="codeDetailLoading" :data="codeDetailList" style="width: 100%" border
row-key="id"
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="UDI码"
prop="code"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="产品名称"
prop="productName"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="生产日期"
prop="produceDate"
width="120"
></el-table-column>
<el-table-column
label="失效日期"
prop="expireDate"
width="120"
></el-table-column>
<el-table-column
label="批次号"
prop="batchNo"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="序列号"
prop="serialNo"
></el-table-column>
<el-table-column
label="扫码数量"
prop="reCount"
></el-table-column>
<el-table-column
label="实际数量"
prop="reCount"
></el-table-column>
</el-table>
<pagination
v-show="codeTotal>0"
:total="codeTotal"
:page.sync="codeQuery.page"
:limit.sync="codeQuery.limit"
@pagination="getCodeDetailList"
/>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import {
deleterPrein,
filterPrein, filterDetail
} from "@/api/inventory/invPreInSearch";
import {getLocalJoinByUser} from "@/api/basic/busType";
import {isBlank} from "@/utils/strUtil";
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
const formJson = {
site_id: "",
site_name: "",
describe: "",
ads: [],
};
export default {
name: "InvPreInSerach",
data() {
return {
showSearch: true,
filterQuery: {
id: "",
billNo: null,
page: 1,
limit: 10,
startTime: null,
endTime: null,
},
invList: [],
list: [],
total: 0,
loading: false,
index: null,
enableDept: false,
fromTypeMap: {
"1": "UDIMS平台",
"2": "网页新增",
"3": "pda即时校验",
"4": "pda未校验",
"5": "pc端扫码精灵",
"6": "缺量补录单据",
"7": "UDI供应商平台",
"8": "平衡补录单据",
"10": "手动补单",
"11": "仓库盘点"
},
deleteData: {
orderId: null,
},
dialogTableVisible: false,
formLoading: false,
dialogVisible: false,
formData: formJson,
deleteLoading: false,
busTypes: [],
currentRow: {},
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]);
},
},
],
},
codeQuery: {
orderId: null,
page: 1,
limit: 10
},
codeTotal: 0,
codeDetailLoading: false,
codeDetailList: [],
fromOptions: [],
};
},
components: {},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
id: "",
billNo: null,
page: 1,
limit: 10,
startTime: null,
endTime: null,
};
this.getList();
},
onSubmit() {
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;
}
this.filterQuery.page = 1;
this.getList();
},
hideSearch() {
this.showSearch = !this.showSearch;
},
getBusType() {
let query = {
code: this.filterQuery.invCode,
enabled: true,
};
getLocalJoinByUser(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.filterQuery.action = this.busTypes[0].action;
})
.catch(() => {
});
},
handleSelectionChange(val) {
this.currentRow = val;
this.getOrderDetails();
},
getOrderDetails() {
this.codeQuery.page = 1;
this.getCodeDetailList();
},
clearDetailList() {
this.codeDetailList = [];
this.codeTotal = 0;
},
//
getList() {
this.loading = true;
this.currentRow = {billNo: ""};
this.clearDetailList();
filterPrein(this.filterQuery)
.then((response) => {
this.loading = false;
if (response.code === 20000) {
this.list = response.data.list || [];
this.total = response.data.total || 0;
} else {
this.$message.error(response.message);
}
})
.catch((error) => {
this.$message.error(error.message)
this.loading = false;
this.list = [];
this.total = 0;
});
},
deleteOrders(data) {
this.loading = true;
let delQuery = {
billNo: data,
}
deleterPrein(delQuery)
.then((response) => {
if (response.code == 20000) {
this.getList();
this.$message({
type: "success",
message: "删除成功!",
});
} else if (response.code == 520) {
this.$message.error("新增扫码单据列表已不存在该扫码单据!");
this.getList();
}
})
.catch(() => {
});
},
deleteDialog(row) {
this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.deleteOrders(row.billNo);
})
.catch(() => {
});
},
onCodeReset() {
this.codeQuery = {
orderIdFk: null,
page: 1,
limit: 10
};
this.getCodeDetailList();
},
onCodeSubmit() {
this.codeQuery.page = 1;
this.getCodeDetailList();
},
getCodeDetailList() {
if (isBlank(this.currentRow.billNo)) {
this.$message.error("请先选择需要查询的单据!")
return;
}
this.codeQuery.orderId = this.currentRow.billNo;
this.codeDetailLoading = true;
filterDetail(this.codeQuery).then((res) => {
this.codeDetailLoading = false;
if (res.code === 20000) {
this.codeDetailList = res.data.list || [];
this.codeTotal = res.data.total || 0;
} else {
this.$message.error(res.message);
this.codeDetailList = [];
this.codeTotal = 0;
}
}).catch((error) => {
this.codeDetailLoading = true;
this.$message.error(error.message);
this.codeDetailList = [];
this.codeTotal = 0;
})
},
findMethod(query) {
this.fromOptions = [];
let cQuery = {
key: query,
corpType: 2,
page: 1,
limit: 10,
};
getBasicUnitMaintains(cQuery)
.then((response) => {
this.loading = false;
this.fromOptions = response.data.list || [];
})
.catch(() => {
this.loading = false;
this.fromOptions = [];
});
},
},
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 type="text/scss" lang="scss">
</style>

@ -0,0 +1,758 @@
<template>
<div>
<el-card class="el-card">
<el-form
:model="filterQuery"
size="mini"
v-if="searchVisible"
>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label-width="100px" label="UDI码:">
<el-input
id="inputer"
v-model="filterQuery.code"
placeholder="UDI码"
ref='inputRef'
@keypress.enter.native="enterKey($event)"
clearable
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="query-form-item" label="供应商:" label-width="100px">
<el-select
v-model="filterQuery.supId"
filterable
remote
clearable="true"
reserve-keyword
placeholder="请输入供应商名称"
:remote-method="findMethod"
size="mini"
style="width: 100%"
:loading="loading"
>
<el-option
v-for="item in fromOptions"
:key="item.name"
:label="item.name"
:value="item.erpId"
>
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item style="display: flex;margin-left: 20px">
<el-button type="primary" icon="search" @click="getList"
>查询
</el-button
>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table
v-loading="loading"
:data="list"
border
style="width: 100%"
@row-click="getOrderDetail"
highlight-current-row
>
<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="billNo"
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="fromName" 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.createTime }}</span>
</template>
</el-table-column>
<el-table-column label="操作" 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"
border
:row-class-name="tableRowClassName"
:data="detailList"
style="width: 100%"
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="产品通用名"
prop="coName"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="包装规格"
prop="spec"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="批次号"
prop="batchNo"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="生产日期"
prop="productDate"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="失效日期"
prop="expireDate"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="单据数量"
prop="count"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="实际数量"
prop="reCount"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="生产企业"
prop="manufacturer"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="注册/备案凭证号"
prop="certCode"
:show-overflow-tooltip="true"
></el-table-column>
</el-table>
</el-card>
<el-dialog
title="单号详情"
:visible.sync="codeDetailVisible"
width="80%"
append-to-body
v-if="codeDetailVisible"
>
<codeDetail
:idQuery="idQuery"
v-on:closeDetailDialog="closeDetailDialog"
></codeDetail>
</el-dialog>
</div>
</template>
<script>
import {
findAllByOrderId,
deleteByOrderId,
updateExportStatus,
uploadOrder,
orderDetail,
} from "../../api/inout/order";
import draggable from "vuedraggable";
import {saveAs} from "file-saver";
import codeDetail from "../inout/IOFinishCode";
import store from "../../store";
import {getBussinessType} from "../../api/basic/bussinessType";
import {filterOrderTrace} from "@/api/inventory/invCodeTrace";
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
import A from "../../plugins/KeyScaner"
const formJson = {
site_id: "",
site_name: "",
describe: "",
ads: [],
};
export default {
name: "invUdiTraceOrder",
props: {
isSelect: {
type: Boolean,
default: false,
},
diloadTrue: {
type: Boolean,
default: false,
},
udiCode: {
type: Object,
required: true,
},
},
data() {
return {
filterQuery: {
code: "",
batchNo: null,
productIdFk: null,
customerId: null,
page: 1,
limit: 20,
supId: null,
},
searchVisible: true,
sitcomScan: false,
checkStatus: {
1: "校验异常",
0: "未校验",
2: "正常",
},
fromOptions: [],
erpCheckStatus: {
// error: "",
// null: "",
// success: "",
1: "校验异常",
0: "未校验",
2: "校验成功",
},
fromTypeMap: {
"1": "UDIMS平台",
"2": "网页新增",
"3": "pda即时校验",
"4": "pda未校验",
"5": "pc端扫码精灵",
"6": "缺量补录单据",
"7": "UDI供应商平台",
"8": "平衡补录单据",
"10": "手动补单"
},
//
unitquery: {key: "", page: 1, limit: 20},
unitlist: [],
list: [],
detailList: [],
unitUpdateQuery: {
id: "",
fromCorpId: "",
fromCorp: "",
},
actDateRange: [],
detailQuery: {
orderId: "",
},
deleteData: {
id: "",
},
idQuery: {
id: "",
},
curIndex: "",
adListNoDataText: "无数据",
queryAdIdAsyncLoading: false,
codeDetailVisible: false,
successOrderExportPDFSettingVisible: false,
total: 0,
loading: false,
index: null,
formName: null,
orderId: "",
formMap: {
add: "新增",
edit: "编辑",
},
exportQuery: {
orderId: "",
exportStatus: "",
},
uploadQuery: {
orderId: "",
},
busTypes: [],
dialogTableVisible: false,
formLoading: false,
formVisible: false,
formData: formJson,
deleteLoading: false,
addDialogVisible: false,
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]);
},
},
],
},
};
},
components: {
draggable,
codeDetail,
},
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();
},
findMethod(query) {
console.log(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;
this.filterQuery.customerId = store.getters.customerId;
if (!this.$isBlank(this.filterQuery.code)) {
console.log(this.filterQuery.code)
let code = this.filterQuery.code;
this.filterQuery.code = code.replace("\r", "")
}
filterOrderTrace(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.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
//
getOrderDetail(row) {
this.loading = true;
this.detailQuery = {
orderIdFk: row.billNo,
};
this.refresgOrderDetail();
},
refresgOrderDetail() {
orderDetail(this.detailQuery)
.then((response) => {
console.log(response)
this.loading = false;
this.detailList = response.data || [];
})
.catch(() => {
this.loading = false;
this.detailList = [];
});
},
handleUnitClick(row) {
this.curIndex = row.id;
// this.dialogTableVisible = true;
},
intentDetail(row) {
this.codeDetailVisible = true;
this.idQuery.id = row.id;
},
closeDialog() {
this.successOrderExportPDFSettingVisible = false;
this.getList();
},
deleteOrders(data) {
this.loading = true;
this.deleteData.id = data;
deleteByOrderId(this.deleteData)
.then((response) => {
this.getList();
this.refresgOrderDetail();
this.$message({
type: "success",
message: "删除成功!",
});
})
.catch(() => {
});
},
tableRowClassName({row, rowIndex}) {
if (row.reCount === row.count) {
return "success-row";
} else {
return "warning-row";
}
},
exportDialog(value) {
var mOrder = value;
if (mOrder.exportStatus === "已上传") {
this.$confirm("该订单已修改, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.uploadOrderDialog(mOrder);
})
.catch(() => {
});
} else if (mOrder.contrastStatus === 0) {
this.$confirm("该订单校验异常, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.uploadOrderDialog(mOrder);
})
.catch(() => {
});
} else if (mOrder.contrastStatus === null) {
this.$confirm("该订单未校验, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.uploadOrderDialog(mOrder);
})
.catch(() => {
});
} else {
this.$confirm("是否确定修改ERP订单?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.uploadOrderDialog(mOrder);
})
.catch(() => {
});
}
},
exportXml(poistion) {
this.loading = true;
var mOrder = this.list[poistion];
var corpOrderId = mOrder.id;
var codeArry;
this.query = {
corpOrderId: corpOrderId,
page: 1,
limit: 20,
};
findAllByOrderId(this.query) //
.then((response) => {
this.loading = false;
codeArry = response.data.list || [];
var document =
'<?xml version="1.0" encoding="utf-8"?>\n' +
'<Document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="终端接口XML Schema-2.0.xsd" SN="" Version="3.0" License="123456">\n' +
"<Events>\n" +
'<Event Name="' +
mOrder.action +
'" MainAction="' +
mOrder.mainAction +
'">' +
"<ActionMaping>\n" +
'<Action Name="' +
mOrder.mainAction +
'">\n' +
"<ActionData>Code</ActionData>\n" +
"<ActionData>CorpOrderID</ActionData>\n" +
"<ActionData>Actor</ActionData>\n" +
"<ActionData>ActDate</ActionData>\n" +
"<ActionData>ToCorpID</ActionData>\n" +
"</Action>\n" +
" </ActionMaping>\n" +
"<DataMaping>\n" +
'<MetaData Name="Code" Type="string" />\n' +
'<MetaData Name="CorpOrderID" Type="string" />\n' +
'<MetaData Name="Actor" Type="string" />\n' +
'<MetaData Name="ActDate" Type="Date" />\n' +
'<MetaData Name="ToCorpID" Type="string" />\n' +
"</DataMaping>\n" +
"<DataField>\n";
for (var value of codeArry) {
if (value.fromCorpId === null) {
value.fromCorpId = "";
}
var tempdata =
' <Data Code="' +
value.code +
'" CorpOrderID="' +
value.corpOrderId +
'" Actor="' +
value.actor +
'" ActDate="' +
value.actDate +
'" ToCorpID="' +
value.fromCorpId +
'" />\n';
document = document + tempdata;
}
document =
document +
"</DataField>\n" +
"</Event>\n" +
"</Events>\n" +
"</Document>\n";
var blob = new Blob([document], {
type: "text/plain;charset=utf-8",
});
saveAs(blob, mOrder.action + mOrder.corpOrderId + ".xml");
this.exportQuery.orderId = corpOrderId;
this.exportQuery.exportStatus = "已上传";
updateExportStatus(this.exportQuery).then((response) => {
this.getList();
});
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
uploadOrderDialog(value) {
console.log(value.id + "---" + value.orderid);
this.uploadQuery = {
orderId: value.id,
};
uploadOrder(this.uploadQuery)
.then((response) => {
if (response.code === 20000) {
this.$message.success(response.data);
this.getList();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
});
},
deleteDialog(rowId) {
this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.deleteOrders(rowId);
})
.catch(() => {
});
},
closeDetailDialog(val) {
this.codeDetailVisible = false;
},
closeManuDialog(val) {
this.addDialogVisible = false;
if (val) {
this.$message.success("选入成功");
this.refresgOrderDetail();
this.getList();
} else {
this.$message.error("选入失败");
}
},
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;
// this.getList();
})
.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);//DOM
sc.onInput = function (text) {
//onInput500ms
if (text.includes("delete")) {
that.filterQuery.code = "";
return;
}
if (that.sitcomScan) {
that.filterQuery.code = that.filterQuery.code;
} else {
that.filterQuery.code = text;
}
};
inputer.focus();//divtabindexdocumentBody
},
created() {
if (this.$isNotBlank(this.udiCode)) {
if (!this.diloadTrue) {
this.searchVisible = false;
}
console.log(this.diloadTrue + "----" + this.searchVisible);
this.filterQuery.code = this.udiCode;
this.getList();
}
this.getBusType();
},
};
</script>
<style>
.el-table .warning-row {
background: #ffb5b5;
}
.el-table .success-row {
background: #ffffff;
}
</style>
Loading…
Cancel
Save