切换分支备份

20240912_adapter_z
anthonywj 11 months ago
parent 6405797811
commit 9800f0ef1d

@ -0,0 +1,416 @@
<template>
<div>
<el-table v-loading="loading" :data="detailList" style="width: 100%" border
:row-style="rowStyle"
row-key="id"
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="药品通用名" width="150"
prop="coName"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="包装规格" width="150"
prop="spec"
></el-table-column>
<el-table-column label="批次号" header-align="center">
<el-table-column header-align="center"
label="手录" width="100"
prop="bbatchNo"
show-overflow-tooltip
></el-table-column>
<el-table-column header-align="center"
label="扫码"
prop="sbatchNo" width="100"
show-overflow-tooltip
></el-table-column>
</el-table-column>
<el-table-column label="生产日期" header-align="center">
<el-table-column header-align="center"
label="手录" width="100"
prop="bproductDate"
show-overflow-tooltip
></el-table-column>
<el-table-column header-align="center"
label="扫码" width="100"
prop="sproductDate"
show-overflow-tooltip
></el-table-column>
</el-table-column>
<el-table-column label="失效日期" header-align="center">
<el-table-column header-align="center"
label="手录" width="100"
prop="bexpireDate"
show-overflow-tooltip
></el-table-column>
<el-table-column header-align="center"
label="扫码" width="100"
prop="sexpireDate"
show-overflow-tooltip
></el-table-column>
</el-table-column>
<el-table-column label="数量" header-align="center">
<el-table-column
header-align="center"
label="单据数量" width="100"
prop="count"
></el-table-column>
<el-table-column
header-align="center"
label="扫码数量" width="100"
prop="scanCount"
></el-table-column>
</el-table-column>
<el-table-column
label="价格"
prop="price" width="100"
></el-table-column>
<el-table-column width="100" label="计量单位" prop="measname">
</el-table-column>
<el-table-column
label="生产企业"
prop="manufacturer" width="160"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="批准文号" width="160"
prop="certCode"
show-overflow-tooltip
></el-table-column>
</el-table>
</div>
</template>
<script>
import stockOrderNewSelectProduct from "./DialogSelectProduct";
import dialogInvProduct from "./DialogSelectInvProduct";
import {addBizProduct, getDetailBizs, updateBizProduct, delBizProduct} from "@/api/inout/orderDetailCode";
import {updateBizBind} from "@/api/inout/order";
import selectRlDialog from "@/views/inout/DialogSelectRl";
import DialogSelectUnit from "@/views/inout/DialogSelectUnit";
import {getCheckDetailList} from "@/api/inout/orderDetailBiz";
export default {
name: "PanelCreateOrderCheckDrug",
props: {
idQuery: {
type: Object,
required: true,
},
refreshPanel: {
type: Function,
required: true,
},
refreshOrder: {
type: Function,
required: true,
},
viewType: {
type: Object,
required: true,
},
curBustype: {
type: Object,
required: true,
},
},
data() {
return {
bizType: 1,
loading: false,
query: {
orderId: null,
code: "",
corpOrderId: "",
},
detailList: [],
total: 0,
iCount: 0,
selectProductVisible: false,
selectInvProductVisible: false,
thisData: {},
selectedIndex: null,
invQueryData: {
invCode: null,
},
selectRlVisible: false,
dialogTableVisible: false,
curRow: null,
};
},
components: {
selectRlDialog, DialogSelectUnit,
stockOrderNewSelectProduct,
dialogInvProduct,
},
methods: {
getOrderDetails() {
this.loading = true;
this.query.orderIdFk = this.idQuery.billNo;
getCheckDetailList(this.query) //
.then((response) => {
this.detailList = response.data || [];
this.total = response.data || 0;
this.loading = false;
})
.catch(() => {
this.loading = false;
this.detailList = [];
this.total = 0;
});
},
rowChange(val) {
this.currentRow = val;
if (this.currentRow.batchNo == '')
this.currentRow.batchNo = null;
this.selectedIndex = val.index;
},
closeDialog(rData) {
this.selectProductVisible = false;
this.selectInvProductVisible = false;
this.idQuery = rData;
this.getOrderDetails();
},
closeDialogC2(rData) {
this.idQuery = rData;
this.selectInvProductVisible = false;
this.getOrderDetails();
},
rowStyle({row, rowIndex}) {
let rowBackground = {};
if (!this.$isNotBlank(row.supId) || !this.$isNotBlank(row.bindRlFk)) {
rowBackground.color = '#f60303';
return rowBackground;
}
if (this.viewType == 1)
return null;
if (!row.checkSuccess) {
rowBackground.color = '#f60303';
}
if (row.count != row.scanCount) {
rowBackground.color = '#f60303';
}
return rowBackground;
},
tableRowClassName({row, rowIndex}) {
row.index = rowIndex;
},
selectProductFunction() {
this.thisData = this.idQuery;
if (this.$isBlank(this.idQuery.action)) {
this.$message.error("单据类型不能为空!")
return;
}
if (this.$isBlank(this.idQuery.invCode)) {
this.$message.error("当前仓库不能为空!");
return;
}
if (this.$isBlank(this.idQuery.fromCorp) && this.$isBlank(this.idQuery.fromInvCode)) {
this.$message.error("往来信息不能为空!");
return;
}
if (this.curBustype.corpType == 3) {//
this.invQueryData.invCode = this.idQuery.invCode;
this.selectInvProductVisible = true;
} else if (this.curBustype.corpType == 2) { //
this.selectProductVisible = true;
} else if (this.curBustype.corpType === 1) {//
this.invQueryData.invCode = this.idQuery.invCode;
this.selectInvProductVisible = true;
}
},
saveChange(row) {
if (row.batchNo == '') {
row.batchNo = null;
}
updateBizProduct(row)
.then((response) => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("保存成功!");
this.selectedIndex = null;
this.refreshPanel();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.dataList = [];
this.pageTotal = 0;
});
},
copyDetail(row) {
let data = {
relId: row.bindRlFk,
supId: row.supId,
zczbhhzbapzbh: row.certCode,
orderEntity: this.idQuery,
}
this.loading = true;
addBizProduct(data)
.then((response) => {
this.loading = false;
if (response.code === 20000) {
this.getOrderDetails();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.dataList = [];
this.pageTotal = 0;
});
},
deleteDetail(row) {
let data = {
id: row.id,
}
this.loading = true;
delBizProduct(data)
.then((response) => {
this.loading = false;
if (response.code === 20000) {
this.getOrderDetails();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.dataList = [];
this.pageTotal = 0;
});
},
bindRl(val) {
this.curRow = val;
this.selectRlVisible = true;
},
handleUnitClick(row) {
this.curRow = row;
this.dialogTableVisible = true;
},
selectBindRl(row) {
let query = {
id: this.curRow.id,
bindRlFk: row.id,
};
updateBizBind(query).then((response) => {
if (response.code == 20000) {
this.$message.success("绑定成功");
this.getOrderDetails();
} else
this.$message.error(response.message);
}
).catch(() => {
});
},
selectSupUnit(row) {
let query = {
id: this.curRow.id,
supId: row.erpId,
};
updateBizBind(query).then((response) => {
if (response.code == 20000) {
this.$message.success("绑定成功");
this.getOrderDetails();
} else {
this.$message.error(response.message);
}
}).catch(() => {
});
}
,
closeBindDialog() {
this.selectRlVisible = false;
this.dialogTableVisible = false;
this.refreshPanel();
}
,
}
,
filters: {}
,
watch: {
'idQuery.billNo':
{
handler() {
this.refreshOrder(this.idQuery);
}
,
}
}
,
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
}
,
created() {
if (this.idQuery.billNo != null)
this.getOrderDetails();
}
,
}
;
</script>
<style scoped>
.el-table_fixed, el-table__fixed-right {
height: 80% !important;
}
.el-table__fixed-body-wrapper {
height: 80% !important;
}
.ao-text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
float: right;
text-align: right;
margin-top: 10px;
}
/**
解决el-input输入框 type=number时输入中文光标上移问题
*/
.el-input__inner {
line-height: 1px !important;
}
</style>

@ -0,0 +1,430 @@
<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="ggxh"
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="price"
width="120"
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="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="supName"-->
<!-- width="180"-->
<!-- show-overflow-tooltip-->
<!-- ></el-table-column>-->
<el-table-column label="操作" width="220" 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
>
</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="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 "./DialogSelectRl";
import DialogSelectUnit from "./DialogSelectUnit";
import editCodeDialog from "./DialogEditCode";
import {parseTime} from "@/utils/coTools";
import {getCheckDetailCodes} from "@/api/inout/orderDetailCode";
export default {
name: "PanelCreateOrderCodesDrug",
props: {
idQuery: {
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 {
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.orderId = this.idQuery.billNo;
if (this.viewType == 7) {
//
getCheckDetailCodes(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;
});
} else {
errorCodeList(this.query) //
.then((response) => {
this.codeArray = response.data.list || [];
this.total = response.data.total || 0;
for (let i = 0; i < this.codeArray.length; i++) {
this.codeArray[i].fromType = this.formData.fromType;
this.codeArray[i].billType = this.formData.billType;
}
this.tableSelection();
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
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.refreshPanel();
} 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(() => {
});
},
closeBindDialog() {
this.selectRlVisible = false;
this.dialogTableVisible = false;
this.refreshPanel();
},
closeCodeDialog() {
this.editCodeVisible = false;
this.editOriginCodeVisible = false;
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() {
if (this.idQuery.billNo != null)
this.getCodeList();
},
components: {
selectRlDialog, DialogSelectUnit, editCodeDialog
},
}
</script>
<style scoped>
</style>

@ -0,0 +1,173 @@
<template>
<div>
<el-table v-loading="loading" :data="detailList" style="width: 100%;" max-height="350" height="350"
border
:row-style="rowStyle"
ref="multipleTable">
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column
label="药品编码" width="150"
prop="nameCode"
show-overflow-tooltip
></el-table-column>
<el-table-column label="药品通用名" width="150" prop="coName" show-overflow-tooltip></el-table-column>
<el-table-column label="包装规格" width="150" prop="spec" show-overflow-tooltip></el-table-column>
<el-table-column label="批次号" width="150" prop="batchNo" show-overflow-tooltip></el-table-column>
<el-table-column label="生产日期" width="120" prop="productDate" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ convertDateFun(scope.row.productDate) }}</span>
</template>
</el-table-column>
<el-table-column label="失效日期" width="120" prop="expireDate" show-overflow-tooltip>
<template slot-scope="scope" 12
>
<span>{{ convertDateFun(scope.row.expireDate) }}</span>
</template>
</el-table-column>
<el-table-column label="扫码数量" width="80" prop="count" show-overflow-tooltip></el-table-column>
<el-table-column label="实际数量" width="80" prop="reCount" show-overflow-tooltip></el-table-column>
<!-- <el-table-column width="120" label="价格"-->
<!-- v-if="curAction.mainAction=='WareHouseIn' && curAction.corpType==2">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.price"-->
<!-- type='number'-->
<!-- :disabled="scope.row.index !== selectedIndex"-->
<!-- placeholder="请输入价格"-->
<!-- ></el-input>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="价格" width="120" prop="price" show-overflow-tooltip-->
<!-- v-if="!(curAction.mainAction=='WareHouseIn' && curAction.corpType==2)"></el-table-column>-->
<el-table-column label="价格" width="150" prop="price" show-overflow-tooltip></el-table-column>
<el-table-column width="100" label="计量单位" prop="measname">
</el-table-column>
<el-table-column label="生产企业" width="150" prop="manufacturer" show-overflow-tooltip></el-table-column>
<el-table-column label="批准文号" width="150" prop="certCode" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="160" fixed="right"
v-if="curAction.mainAction=='WareHouseIn' && curAction.corpType==2">
<template slot-scope="scope">
<el-button type="text" size="small" v-if="scope.row.index == selectedIndex" @click.stop="true"
@click.native="saveChange(scope.row)">保存
</el-button>
<el-button type="text" size="small" v-if="scope.row.index != selectedIndex" @click.stop="true"
@click.native="rowChange(scope.row)">编辑
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import {convertDate} from "@/utils/date";
import {getDetailCodes, updateBizProduct, updateCodeProduct} from "@/api/inout/orderDetailCode";
export default {
name: "PanelCreateOrderDetailDrug",
props: {
idQuery: {
type: Object,
required: true,
},
viewType: {
type: Object,
required: true,
},
curAction: {
type: Object,
required: true,
},
},
data() {
return {
convertDateFun: convertDate,
loading: false,
query: {
orderId: null,
code: "",
corpOrderId: "",
},
detailList: [],
total: 0,
selectRlVisible: false,
dialogTableVisible: false,
editCodeVisible: false,
}
},
watch: {
"curAction": {
handler(newVal, oldVal) {
},
immediate: true
}
},
methods: {
getOrderDetails() {
this.loading = true;
this.query.orderId = this.idQuery.billNo;
getDetailCodes(this.query) //
.then((response) => {
this.detailList = response.data.list || [];
this.total = response.data.total || 0;
this.loading = false;
})
.catch(() => {
this.loading = false;
this.detailList = [];
this.total = 0;
});
},
rowStyle({row, rowIndex}) {
let rowBackground = {};
if (this.viewType == 3 && !row.checkSuccess) {
rowBackground.color = '#f60303';
}
return rowBackground;
},
saveChange(row) {
if (row.batchNo == '') {
row.batchNo = null;
}
updateCodeProduct(row)
.then((response) => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("保存成功!");
this.selectedIndex = null;
this.refreshPanel();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.dataList = [];
this.pageTotal = 0;
});
},
rowChange(val) {
this.currentRow = val;
if (this.currentRow.batchNo == '')
this.currentRow.batchNo = null;
this.selectedIndex = val.index;
},
},
created() {
if (this.idQuery.billNo != null)
this.getOrderDetails();
},
}
</script>
<style scoped>
</style>

@ -578,12 +578,14 @@ export default {
.catch(() => {
});
},
//
addOrders() {
this.idQuery = {};
this.title = "add";
this.addOrderVisible = true;
},
//
editOrder(_this,row) {
_this.idQuery = row;
_this.title = "edit";

Loading…
Cancel
Save