feat: 扫码明细粒度变小 优化

20240912_adapter
chenhc 3 weeks ago
parent 23751b81ca
commit a78b606191

@ -17,6 +17,13 @@ export function getCheckDetailCodes(query) {
params: query
});
}
export function findCheckCodeByBiz(query) {
return axios({
url: "/admin/warehouse/inout/findCheckCodeByBiz",
method: "get",
params: query
});
}
//获取业务明细
export function getDetailBizs(query) {

@ -435,17 +435,17 @@
v-if="isCodeDetailAlive"
></codeDetailPanel>
</el-tab-pane>
<el-tab-pane label="扫码明细" v-if="viewCodeDetailVisible">
<codesPanel
:idQuery="orderFormData"
:refreshPanel="refreshCodesPanel"
v-if="isCodeAlive"
:viewType="viewType"
:selectRlTitle="selectRlTitle"
:editTitle="editTitle"
:selectUnitTitle="selectUnitTitle"
></codesPanel>
</el-tab-pane>
<!-- <el-tab-pane label="扫码明细" v-if="viewCodeDetailVisible">-->
<!-- <codesPanel-->
<!-- :idQuery="orderFormData"-->
<!-- :refreshPanel="refreshCodesPanel"-->
<!-- v-if="isCodeAlive"-->
<!-- :viewType="viewType"-->
<!-- :selectRlTitle="selectRlTitle"-->
<!-- :editTitle="editTitle"-->
<!-- :selectUnitTitle="selectUnitTitle"-->
<!-- ></codesPanel>-->
<!-- </el-tab-pane>-->
<el-tab-pane label="处方使用耗材" v-if="viewSickVisible">
<diSkPrescribePanel
:perscribeData="orderFormData"

@ -0,0 +1,476 @@
<template>
<div>
<el-table v-loading="loading" :data="codeArray" style="width: 100%;" max-height="350" height="350"
:row-style="rowStyle"
border
ref="multipleTable">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column label="序号" type="index" width="55"></el-table-column>
<el-table-column
label="药品追溯码"
prop="code"
width="280"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="药品通用名"
prop="productName"
width="160"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="批次号"
prop="batchNo"
width="120"
show-overflow-tooltip
></el-table-column>
<!--<el-table-column-->
<!-- label="规格型号"-->
<!-- prop="ggxh"-->
<!-- width="140"-->
<!-- show-overflow-tooltip-->
<!--&gt;</el-table-column>-->
<el-table-column
label="包装规格"
prop="bzgg"
width="140"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="制剂规格"
prop="prepnSpec"
width="140"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="扫码数量"
prop="count"
width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="实际数量"
prop="reCount"
width="80"
show-overflow-tooltip
></el-table-column>
<!-- <el-table-column-->
<!-- label="制剂单位"-->
<!-- prop="prepnUnit"-->
<!-- width="140"-->
<!-- show-overflow-tooltip-->
<!-- ></el-table-column>-->
<el-table-column
label="生产日期"
prop="produceDate"
width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="失效日期"
prop="expireDate"
width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="序列号"
prop="serialNo"
width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="价格"
prop="price"
width="120"
show-overflow-tooltip
></el-table-column>
<!-- <el-table-column-->
<!-- label="供应商"-->
<!-- prop="supName"-->
<!-- width="180"-->
<!-- show-overflow-tooltip-->
<!-- ></el-table-column>-->
<el-table-column label="操作" width="280" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="deleteCode(scope.$index, scope.row)"
>减一
</el-button
>
<el-button
type="text"
size="small"
:disabled="scope.row.relId!=null"
@click.native.stop="bindRl(scope.row)"
>绑定产品
</el-button
>
<el-button
type="text"
size="small"
:disabled="scope.row.supId!=null"
@click.native.stop="handleUnitClick(scope.row)"
>绑定供应商
</el-button
>
<el-button
type="text"
size="small"
@click.native.stop="editCode(scope.row)"
>编辑
</el-button
>
<el-button
type="text"
size="small"
:disabled="scope.row.drugLink == 1"
@click.native.stop="association(scope.row)"
>关联
</el-button
>
</template>
</el-table-column>
</el-table>
<el-row v-if="viewType==7">
<el-col span="10">
<div style="float: left">
<td>
<div style="background-color: #FC4A45;width: 10px;height: 10px"></div>
</td>
<td><span>红色:多余条码</span></td>
<td>
<div style="background-color: #F4BD25;width: 10px;height: 10px;margin-left: 15px"></div>
</td>
<td>
<span>黄色:包含多余条码</span>
</td>
</div>
</el-col>
</el-row>
<div class="block">
<pagination
v-show="total>0"
:total="total"
:page.sync="query.page"
:limit.sync="query.limit"
@pagination="getCodeList"
/>
</div>
<el-dialog
:title="editTitle"
:visible.sync="associationCodeVisible"
append-to-body width="70%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="associationCodeVisible"
>
<operateRelCodeSpell
:closeCodeDialog="closeCodeDialog"
:orderQuery="orderQuery">
</operateRelCodeSpell>
</el-dialog>
<!-- 绑定产品-->
<el-dialog
:title="selectRlTitle"
:visible.sync="selectRlVisible"
width="80%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="selectRlVisible"
append-to-body
>
<selectRlDialog
:curRow="curRow"
:fromCorp="fromCorp"
v-on:selectBindRl="selectBindRl"
v-on:closeBindDialog="closeBindDialog"
></selectRlDialog>
</el-dialog>
<!-- 绑定供应商-->
<el-dialog
:title="selectUnitTitle"
:visible.sync="dialogTableVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="dialogTableVisible"
width="80%"
append-to-body
>
<DialogSelectUnit
:codeId="curRow"
:fromCorp="fromCorp"
v-on:selectSupUnit="selectSupUnit"
v-on:closeBindDialog="closeBindDialog"
></DialogSelectUnit>
</el-dialog>
<el-dialog
:title="editTitle"
:visible.sync="editCodeVisible"
append-to-body width="70%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="editCodeVisible"
>
<editCodeDialog
editType="2"
:closeCodeDialog="closeCodeDialog"
:codeDetail="codeDetail">
</editCodeDialog>
</el-dialog>
</div>
</template>
<script>
import {deleteCodesTempById, errorCodeList, updateCodeBindSup} from "@/api/inout/order";
import selectRlDialog from "../inout/DialogSelectRl";
import DialogSelectUnit from "../inout/DialogSelectUnit";
import editCodeDialog from "../inout/DialogEditCode";
import {parseTime} from "@/utils/coTools";
import {findCheckCodeByBiz} from "@/api/inout/orderDetailCode";
import operateRelCodeSpell from "@/views/collect/relCode/operateRelCodeSpell";
import {updateIoCodeTempEntity} from "@/api/collect/relCode";
export default {
name: "PanelCreateOrderCodesDrug",
props: {
idQuery: {
type: Object,
required: true,
},
bizId: {
type: Object,
required: true,
},
billNo: {
type: Object,
required: true,
},
// refreshPanel: {
// type: Function,
// required: true,
// },
selectRlTitle: {
type: Object,
required: true,
},
selectUnitTitle: {
type: Object,
required: true,
},
editTitle: {
type: Object,
required: true,
},
viewType: {
type: Object,
required: true,
}
},
data() {
return {
orderQuery: null,
editTitle: "",
associationCodeVisible: false,
loading: false,
query: {
code: "",
corpOrderId: "",
},
codeDetail: null,
codeArray: [],
total: 0,
curRow: null,
selectRlVisible: false,
dialogTableVisible: false,
editCodeVisible: false,
editOriginCodeVisible: false,
fromCorp: null,
}
},
methods: {
getCodeList() {
this.loading = true;
this.query.bizId = this.bizId;
this.query.orderId = this.billNo;
//
findCheckCodeByBiz(this.query) //
.then((response) => {
this.codeArray = response.data.list || [];
this.total = response.data.total || 0;
this.loading = false;
})
.catch(() => {
this.loading = false;
this.detailList = [];
this.total = 0;
});
},
deleteCode(index, row) {
this.$confirm("是否确定移除一个条码?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.loading = true;
let tQuery = {
id: row.id
}
deleteCodesTempById(tQuery)
.then((response) => {
if (response.code === 20000) {
this.getCodeList();
} else {
this.$message.error(response.message);
}
this.loading = false;
});
}).catch(() => {
});
},
bindRl(val) {
this.curRow = val;
this.fromCorp = this.idQuery.fromCorp;
this.selectRlVisible = true;
},
handleUnitClick(row) {
this.curRow = row;
this.dialogTableVisible = true;
},
editCode(row) {
this.editTitle = "编辑条码";
this.codeDetail = row;
this.editCodeVisible = true;
},
rowStyle({row, rowIndex}) {
let rowBackground = {};
if (!this.$isNotBlank(row.supId) || !this.$isNotBlank(row.relId)) {
rowBackground.color = '#f60303';
}
if (row.checkStatus == 2) {
rowBackground.color = '#F7BB29';
} else if (row.checkStatus == 1) {
rowBackground.color = '#FC4A45';
}
return rowBackground;
},
selectBindRl(row) {
let query = {
id: this.curRow.id,
relId: row.id,
mySupId: row.unitFk,
};
updateCodeBindSup(query).then((response) => {
if (response.code == 20000) {
this.$message.success("绑定成功");
this.orderFormData.id = this.curRow.orderId;
this.closeBindDialog();
this.getCodeList();
} else {
if (response.code == 503) {
this.curRow = response.data;
this.orderFormData.id = this.curRow.orderId;
this.getCodeList();
this.selectUnitTitle = response.message;
this.handleUnitClick(response.data);
} else
this.$message.error(response.message);
}
}).catch(() => {
});
},
selectSupUnit(row) {
let query = {
id: this.curRow.id,
supId: row.erpId,
};
updateCodeBindSup(query).then((response) => {
if (response.code == 20000) {
this.$message.success("绑定成功");
this.idQuery.id = this.curRow.orderId;
this.getCodeList();
// this.refreshPanel();
} else {
this.$message.error(response.message);
}
}).catch(() => {
});
},
association(row) {
this.editTitle = "关联条码";
this.orderQuery = row;
this.associationCodeVisible = true;
},
closeBindDialog() {
this.selectRlVisible = false;
this.dialogTableVisible = false;
this.getCodeList();
// this.refreshPanel();
},
closeCodeDialog() {
this.editCodeVisible = false;
this.editOriginCodeVisible = false;
this.associationCodeVisible = false;
//
updateIoCodeTempEntity({parentCode:this.orderQuery.code}).then((response) => {
}).catch(() => {
});
this.getCodeList();
// this.refreshPanel();
},
repeatAddCode(editData) {
let tQuery = editData;
tQuery.orderId = this.orderFormData.id;
tQuery.actDate = parseTime(this.orderFormData.actDate, '{y}-{m}-{d} {h}:{i}:{s}');
tQuery.action = this.orderFormData.action;
this.closeCodeDialog();
},
},
created() {
this.getCodeList();
},
components: {
selectRlDialog, DialogSelectUnit, editCodeDialog,operateRelCodeSpell
},
}
</script>
<style scoped>
</style>

@ -57,16 +57,38 @@
<el-button type="text" size="small" v-if="scope.row.index != selectedIndex" @click.stop="true"
@click.native="rowChange(scope.row)">编辑
</el-button>
<el-button type="text" size="small" v-if="scope.row.id" @click.stop="true"
@click.native="showCode(scope.row)">扫码明细
</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog
title="扫码明细"
:visible.sync="scanDetailVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="scanDetailVisible"
width="65%"
append-to-body
>
<codesPanelBiz
:bizId="bizId"
:billNo="billNo"
:closeScanDialog="closeScanDialog"
></codesPanelBiz>
</el-dialog>
</div>
</template>
<script>
import {convertDate} from "@/utils/date";
import {getDetailCodes, updateBizProduct, updateCodeProduct} from "@/api/inout/orderDetailCode";
import codesPanelBiz from "@/views/inoutDrug/PanelCreateOrderCodesDrugBiz";
export default {
name: "PanelCreateOrderDetailDrug",
@ -96,8 +118,11 @@ export default {
detailList: [],
total: 0,
selectRlVisible: false,
scanDetailVisible: false,
dialogTableVisible: false,
editCodeVisible: false,
bizId: null,
billNo: null,
}
},
@ -163,8 +188,21 @@ export default {
this.currentRow.batchNo = null;
this.selectedIndex = val.index;
},
showCode(val) {
this.bizId = val.id;
this.billNo = val.orderIdFk;
this.scanDetailVisible = true
},
closeScanDialog() {
this.bizId = null
this.billNo = null
this.scanDetailVisible = false
},
},
components:{
codesPanelBiz
},
created() {
if (this.idQuery.billNo != null)
this.getOrderDetails();

Loading…
Cancel
Save