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/basic/UdiInfoRelevance.vue

378 lines
14 KiB
Vue

4 years ago
<template>
<div>
<div style="display: flex">
<el-checkbox v-model="checked" class="checkitemTag"
>是否关联第三方产品信息
</el-checkbox
>
<el-button
style="margin-right: 20px"
type="primary"
size="mini"
icon="search"
@click="combine"
>选入
</el-button
>
</div>
4 years ago
<el-card class="el-card" v-if="checked">
<div>
<el-form :inline="true" :model="erpQuery" style="display: flex" size="mini">
<el-form-item class="query-form-item">
<el-input
v-model="erpQuery.code"
placeholder="存货编码"
@keyup.enter.native="keyupErp_submit($event)"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input v-model="erpQuery.name" placeholder="存货名称"></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="thirdSysFk" placeholder="请选择第三方系统">
<el-option
v-for="item in thirdSys"
:key="item.value"
:label="item.thirdName"
:value="item.thirdId">
<span style="float: left">{{ item.thirdName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.thirdId }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item style="display: flex">
<el-button type="primary" icon="search" @click="getErpList"></el-button>
</el-form-item>
</el-form>
4 years ago
<el-table
:data="erpList"
style="width: 100%"
highlight-current-row="true"
v-loading="erpLloading"
:row-class-name="tableRowClassName"
@current-change="handleErpChange"
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="第三方编码" prop="code"></el-table-column>
<el-table-column label="存货名称" prop="name"></el-table-column>
<el-table-column label="计量单位" prop="measname"></el-table-column>
<el-table-column label="规格型号" prop="spec"></el-table-column>
<!--<el-table-column label="注册证号" prop="registerNo"></el-table-column>-->
<!--<el-table-column label="生产厂家" prop="manufactory"></el-table-column>-->
</el-table>
<el-pagination
:page-size="erpQuery.limit"
@current-change="handleErpPageChange"
layout="prev, pager, next"
:total="pageTotal"
></el-pagination>
</div>
</el-card>
4 years ago
<el-card class="el-card">
<div>
<el-form :inline="true" :model="unionQuery" class="query-form" size="mini">
<el-row>
<el-form-item class="query-form-item">
<el-input
v-model="unionQuery.nameCode"
size="mini"
placeholder="最小单元销售标识"
@keyup.enter.native="keyup_submit($event)"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input
v-model="unionQuery.cpmctymc"
size="mini"
placeholder="产品通用名"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input
v-model="unionQuery.ylqxzcrbarmc"
size="mini"
placeholder="医疗器械注册人"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input
v-model="unionQuery.ggxh"
placeholder="规格型号"
size="mini"
></el-input>
</el-form-item>
4 years ago
<el-form-item class="query-form-item">
<el-button-group>
<el-button type="primary" icon="search" @click="getList" size="mini"
>查询
</el-button
>
</el-button-group>
</el-form-item>
</el-row>
</el-form>
4 years ago
<el-table
:data="udidlList"
style="width: 100%"
@row-click="intentDetail"
v-loading="loading"
:row-class-name="tableRowClassName"
@selection-change="handleSelectionUdiChange"
4 years ago
>
<el-table-column
type="selection"
width="55"
:selectable="checkSelectable"
></el-table-column>
<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>
<el-pagination
:page-size="unionQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
></el-pagination>
</div>
</el-card>
</div>
4 years ago
</template>
<script>
import {getUdiInfos} from "../../api/basic/udiInfo";
import {combineUdi} from "../../api/basic/udiRelevance";
import {getBasicThirdSys} from "../../api/basic/basicThirdSys";
import {getInvbasdoc} from "../../api/basic/getErps";
4 years ago
export default {
name: "closeDialog",
props: {
closeDialog: {
type: Function,
required: true,
},
},
4 years ago
data() {
return {
erpQuery: {
code: null,
name: "",
thirdSys:null,
page: 1,
limit: 10,
},
unionQuery: {
page: 1,
limit: 20,
nameCode: "",
cpmctymc: "",
ylqxzcrbarmc: "",
ggxh: "",
},
combineQuery: {
thirdId: "",
keys: [],
thirdSys: null,
},
checked: true,
udidlList: [],
erpList: [],
pageTotal: 1,
total: 1,
currentRow: null,
loading: false,
erpLloading: false,
multipleUdiSelection: [],
thirdSys: [],
thirdSysFk: null,
};
},
methods: {
getList() {
if (
this.unionQuery.nameCode == "" &&
this.unionQuery.cpmctymc == "" &&
this.unionQuery.ylqxzcrbarmc == "" &&
this.unionQuery.ggxh == ""
) {
this.$message.warning("请输入查询条件");
return;
}
this.loading = true;
getUdiInfos(this.unionQuery)
.then((response) => {
this.loading = false;
this.udidlList = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.udidlList = [];
this.total = 0;
});
},
checkSelectable(row) {
return !row.check;
},
handleCurrentChange(val) {
this.unionQuery.page = val;
this.getList();
},
tableRowClassName({row}) {
if (row.checked) return "warning-row";
return "";
},
handleErpChange(val) {
console.log(val);
if (val.checked) {
this.$message.warning("该产品已被选入");
return;
}
this.currentRow = val;
this.unionQuery.cpmctymc = this.currentRow.name;
},
handleErpPageChange(val) {
this.erpQuery.page = val;
this.getErpList();
},
getErpList() {
this.erplLoading = true;
this.erpQuery.thirdSys = this.thirdSysFk;
getInvbasdoc(this.erpQuery)
.then((response) => {
this.erplLoading = false;
if(response.code == 20000){
this.erpList = response.data.list || [];
this.pageTotal = response.data.total || 0;
}else
{
this.$message.error(response.message);
this.erpList = [];
this.pageTotal = 0;
}
4 years ago
})
.catch(() => {
this.erplLoading = false;
this.erpList = [];
this.pageTotal = 0;
});
},
keyupErp_submit(event) {
this.getErpList();
event.target.select();
},
intentBack() {
this.$router.go(-1);
},
combine() {
let selectData = this.multipleUdiSelection;
var ids = [];
selectData.forEach((obj) => {
ids.push(obj.uuid);
});
4 years ago
this.combineQuery.keys = ids;
this.combineQuery.thirdSys = this.thirdSysFk;
if (this.checked) {
this.combineQuery.thirdId = this.currentRow.code;
this.combineQuery.erpName = this.currentRow.name;
} else {
this.combineQuery.thirdId = "";
}
combineUdi(this.combineQuery)
.then((response) => {
if (response.code == 20000) {
this.$emit("closeUdi", true);
} else {
this.$emit("closeUdi", false);
}
})
.catch(() => {
this.$emit("closeUdi", false);
});
},
4 years ago
intentDetail(row) {
this.$emit("productInfo", row);
this.closeDialog();
},
4 years ago
handleSelectionUdiChange(val) {
this.multipleUdiSelection = val;
},
4 years ago
keyup_submit(event) {
this.getList();
event.target.select();
},
getBasicThirdSys() {
let query = {
enabled: true,
};
getBasicThirdSys(query)
.then((response) => {
this.thirdSys = response.data.list || [];
this.thirdSysFk = this.thirdSys[0].thirdId;
})
.catch(() => {
this.loading = false;
this.list = [];
});
},
},
created() {
this.getBasicThirdSys();
},
};
4 years ago
</script>
<style scoped>
.checkitemTag {
float: left;
text-align: left;
margin-top: 5px;
width: 100%;
}
div /deep/ .el-table .warning-row {
background: #bebebe;
}
4 years ago
div /deep/ .el-table .success-row {
background: #ffffff;
}
4 years ago
</style>