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.
spms-vue/src/views/warehouse/stockOrderNewSelectProduct.vue

362 lines
13 KiB
Vue

3 years ago
<template>
<div>
<el-card class="el-card">
<div>
<el-form :inline="true" :model="listQuery" size="mini">
<el-row style="margin-top: 15px;width: 1000px">
<el-form-item class="query-form-item">
<el-input v-model="listQuery.udiCode"
style="width: 600px"
placeholder="请扫描或输入UDI码"
clearable="true"
@keyup.enter.native="keyup_submit($event)"></el-input>
</el-form-item>
</el-row>
<el-row>
<el-form-item class="query-form-item">
<el-input v-model="listQuery.unionCode" placeholder="DI/医保编码/商品条码"
clearable="true"></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input v-model="listQuery.cpmctymc" placeholder="产品通用名" clearable="true"></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input v-model="listQuery.ggxh" placeholder="规格型号" clearable="true"></el-input>
</el-form-item>
</el-row>
<el-row>
<el-form-item class="query-form-item">
<el-input v-model="listQuery.ylqxzcrbarmc" placeholder="生产企业/注册备案人"
clearable="true"></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input v-model="listQuery.thrPiId" placeholder="第三方产品编码" clearable="true"></el-input>
</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="search" @click="search"></el-button>
3 years ago
<el-button type="primary" icon="search" @click="combine"></el-button>
</el-button-group>
</el-form-item>
</el-row>
</el-form>
<el-table
:data="dataList"
style="width: 100%"
highlight-current-row="false"
v-loading="loading"
:row-class-name="tableRowClassName"
@current-change="handleChange"
ref="multipleTable"
>
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="最小销售产品标识"
prop="nameCode"
width="140"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="产品编码"
prop="thirdId"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="生产企业"
prop="ylqxzcrbarmc"
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="zczbhhzbapzbh"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="器械类别"
prop="qxlb"
show-overflow-tooltip
></el-table-column>
3 years ago
<el-table-column label="操作" fixed="right" width="160">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="handleDetailClick(scope.row)"
>详情
</el-button
>
</template>
</el-table-column>
3 years ago
</el-table>
<el-pagination
:page-size="listQuery.limit"
@current-change="handleErpPageChange"
layout="prev, pager, next"
:total="pageTotal"
:current-page="listQuery.page"
3 years ago
></el-pagination>
</div>
</el-card>
3 years ago
<el-dialog
title="耗材字典详情"
:visible.sync="udiRlDetailVisible"
width="85%"
:close-on-click-modal="false"
:close-on-press-escape="false"
append-to-body
v-if="udiRlDetailVisible"
>
3 years ago
<udiRlDetailDialog :editQuery="currentRow"></udiRlDetailDialog>
3 years ago
</el-dialog>
3 years ago
</div>
</template>
<script>
import {
getStockOrderDetailInstrumentById,
stockOrderDetailFilterProduct
} from "../../api/warehouse/stockOrder";
import store from "../../store";
3 years ago
import udiRlDetailDialog from "./../basic/UdiRlDetailDialog";
3 years ago
export default {
3 years ago
name: "stockOrderNewSelectProduct",
props: {
data: {
type: Object,
required: true,
},
closeDialog: {
type: Function,
required: true,
3 years ago
},
},
3 years ago
data() {
return {
listQuery: {
billNo: "",
page: 1,
limit: 10,
},
combineQuery: {
thirdId: "",
relId: "",
erpName: "",
keys: [],
},
dataList: [],
pageTotal: 1,
total: 1,
currentRow: null,
loading: false,
3 years ago
udiRlDetailVisible: false,
multipleUdiSelection: [],
thirdSys: [],
thirdSysFk: null,
busTypes: [],
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]);
3 years ago
},
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
3 years ago
},
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
3 years ago
},
},
],
},
orderEditor: false,
orderId: "",
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.listQuery = {
unionCode: null,
udiCode: null,
ylqxzcrbarmc: "",
3 years ago
cpmctymc: "",
thrPiId: null,
nameCode: "",
ggxh: null,
page: 1,
limit: 20,
addType: 1,
3 years ago
billType: this.data.formData.billType,
corpId: this.data.formData.corpId,
3 years ago
};
this.getList();
3 years ago
},
tableRowClassName({row}) {
if (row.checked) return "warning-row";
return "";
},
checkSelectable(row) {
return !row.check;
},
handleCurrentChange(val) {
this.unionQuery.page = val;
this.getList();
},
handleChange(val) {
this.currentRow = val;
},
3 years ago
handleDetailClick(row) {
this.currentRow = row;
this.udiRlDetailVisible = true;
},
handleErpPageChange(val) {
this.listQuery.page = val;
this.getList();
},
keyup_submit(event) {
this.listQuery.page = 1;
this.getList();
event.target.select();
},
search() {
this.listQuery.page = 1;
this.getList();
},
getList() {
this.loading = true;
this.listQuery.customerId = store.getters.customerId;
stockOrderDetailFilterProduct(this.listQuery)
.then((response) => {
3 years ago
this.loading = false;
if (response.code === 20000) {
this.dataList = response.data.list || [];
this.pageTotal = response.data.total || 0;
3 years ago
} else {
this.$message.error(response.message);
this.dataList = [];
this.pageTotal = 0;
3 years ago
}
})
.catch(() => {
3 years ago
this.loading = false;
this.dataList = [];
this.pageTotal = 0;
3 years ago
});
},
intentBack() {
this.closeDialog();
},
3 years ago
combine() {
let selection = this.$refs.multipleTable.selection;
if (selection.length < 1) {
this.$message.error('未选择产品');
return;
3 years ago
}
let ids = [];
selection.forEach((obj, index) => {
let data = {
relId: obj.rlId,
}
ids.push(data);
});
this.loading = true;
let tQuery = {
datas: ids,
stockOrderLists: this.data.stockOrderLists,
};
getStockOrderDetailInstrumentById(tQuery).then((response) => {
this.loading = false;
if (response.code === 20000) {
3 years ago
this.closeDialog(response.data);
} else {
this.$message.error(response.message);
}
}).catch(() => {
this.loading = false;
});
},
handleSelectionUdiChange(val) {
this.multipleUdiSelection = val;
3 years ago
},
},
3 years ago
components: {udiRlDetailDialog},
created() {
if (this.$isNotBlank(this.data)) {
this.listQuery.nameCode = this.data.udi;
if (this.data.billType != null) {
this.listQuery.billType = this.data.billType;
} else
this.listQuery.billType = this.data.formData.billType;
3 years ago
if (this.data.formData != null) {
this.listQuery.corpId = this.data.formData.corpId;
}
this.orderEditor = this.data.orderEditor;
this.orderId = this.data.orderId;
}
3 years ago
this.getList();
},
};
3 years ago
</script>
<style scoped>
.query-form-item {
display: block !important;
margin-right: 10px;
margin-bottom: 5px;
}
3 years ago
div /deep/ .el-table .warning-row {
background: #bebebe;
}
3 years ago
div /deep/ .el-table .success-row {
background: #ffffff;
}
3 years ago
</style>