feat: 结合阿里健康业务功能

20240912_adapter
chenhc 2 months ago
parent a14e4f5334
commit 343fd9ac90

@ -683,4 +683,12 @@ export function batchUpdateCode(query) {
}); });
} }
export function addAliBizProduct(params) {
return axios({
url: "/udiwms/inout/order/addAliBizProduct",
method: "post",
data: params,
timeout: 1800000
});
}

@ -0,0 +1,18 @@
import axios from "@/utils/request";
export function aliYljgSearchbillPage(query) {
return axios({
url: "/spms/alihealth/aliYljgSearchbillPage",
method: "post",
data: query
});
}
export function aliYljgBillDetail(query) {
return axios({
url: "/spms/alihealth/aliYljgBillDetail",
method: "post",
data: query
});
}

@ -12,6 +12,12 @@
<el-button-group <el-button-group
style="display: flex; margin: 0px 0 15px 0; height: 35px;float: right" style="display: flex; margin: 0px 0 15px 0; height: 35px;float: right"
> >
<el-button size="mini" type="primary" @click="triggerFileUpload2"
>
上传阳采单据
</el-button>
<!-- 隐藏的文件输入元素 -->
<input type="file" ref="fileInput2" accept=".xlsx,.xls" style="display: none;" @change="handleFileUpload2"/>
<el-button <el-button
size="mini" size="mini"
type="primary" type="primary"
@ -368,7 +374,9 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="2">
<el-button-group
style="display: flex; height: 35px">
<el-button <el-button
type="primary" type="primary"
size="mini" size="mini"
@ -376,6 +384,15 @@
style="margin-left: 15px" style="margin-left: 15px"
>扫码添加 >扫码添加
</el-button> </el-button>
<el-button
type="primary"
size="mini"
@click.native="selectOrder()"
v-if="curAction.checkWebNew != 2 || viewType !=1"
>下载码上放心追溯码
<!-- v-if="(curAction.checkWebNew !== 2 || viewType !== 1) && orderFormData.billNo"-->
</el-button
>
<el-button <el-button
type="primary" type="primary"
size="mini" size="mini"
@ -383,6 +400,7 @@
@click.native.stop="addInvProduct()" @click.native.stop="addInvProduct()"
>库存选入 >库存选入
</el-button> </el-button>
</el-button-group>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -555,11 +573,29 @@
></dialogInvProduct> ></dialogInvProduct>
</el-dialog> </el-dialog>
<el-dialog
title="选入码上放心单据"
:visible.sync="selectOrderVisible"
append-to-body width="80%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="selectOrderVisible">
<selectMsfxOrderDialog
:orderFormData=this.orderFormData
:closeDialog=this.orderFormDataClose
>
</selectMsfxOrderDialog>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import selectMsfxOrderDialog from "./selectMsfxOrderDialog"
import { import {
submitBiz, submitBiz,
submitCodes, submitCodes,
@ -767,12 +803,14 @@ export default {
// //
selectInvProductVisible: false, selectInvProductVisible: false,
selectOrderVisible: false,
invQueryData: { invQueryData: {
invCode: null, invCode: null,
}, },
}; };
}, },
components: { components: {
selectMsfxOrderDialog,
codesPanel, codesPanel,
checkResultPanel, checkResultPanel,
codeDetailPanel, codeDetailPanel,
@ -782,7 +820,76 @@ export default {
DialogSelectUnit, DialogSelectSpace, selectRlDialog, diSkPrescribePanel, dialogInvProduct DialogSelectUnit, DialogSelectSpace, selectRlDialog, diSkPrescribePanel, dialogInvProduct
}, },
methods: { methods: {
//msfx
selectOrder() {
if (this.orderFormData.action == null) {
this.$message.error('请选择单据类型!')
return
}
this.selectOrderVisible = true
},
triggerFileUpload2() {
this.$refs.fileInput2.click();
},
handleFileUpload2(event) {
const file = event.target.files[0];
const uploadUrl = process.env.VUE_APP_BASE_API + '/udiwms/inout/order/yc/orderFileUpload';
if (file) {
const formData = new FormData();
this.orderFormData.orderEntity = Object.assign(JSON.parse(JSON.stringify(this.orderFormData)));
formData.append('billNoJson', JSON.stringify(this.orderFormData));
formData.append('file', file);
fetch(uploadUrl, {
method: 'POST',
headers: {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
},
body: formData
})
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.json();
})
.then(data => {
if (data.code === 20000) {
//
if (data.data && data.data.billNo) {
this.orderFormData.billNo = data.data.billNo;
}
//
this.isCodeAlive = false;
this.isBizDetailAlive = false;
this.isCodeDetailAlive = false;
this.$nextTick(() => {
this.isCodeAlive = true;
this.isBizDetailAlive = true;
this.isCodeDetailAlive = true;
this.$refs.inputRef.focus();
this.$refs.inputRef.select();
this.$message.success("上传成功!");
});
} else {
this.$message.error(data.message);
}
})
.catch(error => {
console.error('File upload failed:', error);
this.$message.error('文件上传失败:' + error.message);
});
} else {
this.$message.warning('请选择要上传的文件');
}
//
event.target.value = '';
},
// //
findInvListByUser() { findInvListByUser() {
this.curInvOptions = []; this.curInvOptions = [];
@ -1176,7 +1283,11 @@ export default {
// this.refreshCodesPanel() // this.refreshCodesPanel()
}, },
orderFormDataClose(data) {
this.orderFormData = data
this.refreshCodesPanel();
this.selectOrderVisible = false
},
// //
addCode(event) { addCode(event) {

@ -0,0 +1,101 @@
<template>
<div>
<el-card class="el-card">
<!-- <el-form :model="orderQuery" size="mini" label-width="100px" v-show="showSearch">-->
<!-- <el-row>-->
<!-- <el-col :span="6">-->
<!-- <el-form-item class="query-form-item" label="追溯码:">-->
<!-- <el-input v-model="orderQuery.unionCode" placeholder="请扫描或输入追溯码"-->
<!-- style="width: 500px"-->
<!-- clearable="true"></el-input>-->
<!-- </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="search"></el-button>-->
<!-- &lt;!&ndash;<el-button type="primary" icon="el-icon-check" @click="confirmSelect"></el-button>&ndash;&gt;-->
<!-- </el-button-group>-->
<!-- </div>-->
<el-table
:data="dataList"
style="width: 100%"
highlight-current-row="false"
v-loading="loading"
border
@current-change="handleChange"
ref="multipleTable"
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="监管码"
prop="code"
width="240"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="监管码级别"
prop="codeLevel"
width="100"
show-overflow-tooltip
></el-table-column>
<!-- <el-table-column-->
<!-- label="最小包装数量"-->
<!-- prop="pkgAmount"-->
<!-- width="100"-->
<!-- show-overflow-tooltip-->
<!-- ></el-table-column>-->
<!-- <el-table-column-->
<!-- width="100"-->
<!-- label="最小制剂数量"-->
<!-- prop="prepnAmount"-->
<!-- show-overflow-tooltip-->
<!-- ></el-table-column>-->
<el-table-column
label="制剂规格"
prop="prepnSpec"
show-overflow-tooltip
></el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
export default {
props: {
dataList: {
type: Array,
required: true,
}
},
data() {
return {
orderQuery:{
page: 1,
limit: 10,
},
pageTotal:10,
showSearch: true
}
},
methods:{
hideSearch() {
this.showSearch = !this.showSearch;
},
}
}
</script>
<style scoped>
</style>

@ -0,0 +1,368 @@
<template>
<div>
<el-card class="el-card">
<el-form :model="orderQuery" size="mini" label-width="100px" v-show="showSearch">
<!-- <el-row>-->
<!-- <el-col :span="6">-->
<!-- <el-form-item class="query-form-item" label="单据编号:">-->
<!-- <el-input v-model="orderQuery.bill_code" placeholder="单据编号"-->
<!-- style="width: 90%"-->
<!-- clearable="true"-->
<!-- ></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <el-form-item label="单据类型:" class="query-form-item">-->
<!-- <el-select v-model="orderQuery.bill_type" style="width: 90%" placeholder="选择单据" clearable>-->
<!-- <el-option label="所有" :value="'A'"></el-option>-->
<!-- <el-option label="入库" :value="'AI'"></el-option>-->
<!-- <el-option label="出库" :value="'AO'"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- &lt;!&ndash;<el-col :span="6">&ndash;&gt;-->
<!-- &lt;!&ndash; <el-form-item class="query-form-item" label="药品信息:">&ndash;&gt;-->
<!-- &lt;!&ndash; <el-input v-model="orderQuery.cpmctymc" placeholder="药品信息" clearable="true"&ndash;&gt;-->
<!-- &lt;!&ndash; style="width: 90%"&ndash;&gt;-->
<!-- &lt;!&ndash; ></el-input>&ndash;&gt;-->
<!-- &lt;!&ndash; </el-form-item>&ndash;&gt;-->
<!-- &lt;!&ndash;</el-col>&ndash;&gt;-->
<!-- <el-col :span="6">-->
<!-- <el-form-item class="query-form-item" label="发货单位:">-->
<!-- <el-input v-model="orderQuery.bzgg" placeholder="发货单位" clearable="true"-->
<!-- style="width: 90%"-->
<!-- ></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <el-form-item class="query-form-item" label="收货单位:">-->
<!-- <el-input v-model="orderQuery.ylqxzcrbarmc" placeholder="收货单位"-->
<!-- style="width: 90%"-->
<!-- clearable="true"-->
<!-- ></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="8">
<el-form-item label="单据时间:">
<el-date-picker
:picker-options="pickerOptions"
v-model="actDateRange"
type="daterange"
format="yyyy 年 MM 月 dd 日"
style="width: 90%"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6" >
<el-form-item label="订单编号:">
<el-input v-model="orderQuery.billCode"
style="transform: translateX (-500px)"
clearable="true"
placeholder="订单编号"></el-input>
</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="search"></el-button>
<el-button type="primary" icon="el-icon-check" @click="confirmSelect" :loading="loading">确定</el-button>
</el-button-group>
</div>
<el-table
:data="dataList"
style="width: 100%"
highlight-current-row="false"
v-loading="loading"
border
@current-change="handleChange"
ref="multipleTable"
>
<el-table-column label width="45">
<template slot-scope="scope">
<el-radio :label="scope.row.billCode" v-model="radioCheck" :disabled="scope.row.checkBillNO" ><span></span></el-radio>
</template>
</el-table-column>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="订单编号" prop="billCode" width="140" show-overflow-tooltip ></el-table-column>
<el-table-column width="180" label="单据时间" prop="billTimeFormat" show-overflow-tooltip ></el-table-column>
<!-- <el-table-column label="单据类型" prop="billType" show-overflow-tooltip ></el-table-column>-->
<!-- <el-table-column label="药品信息" prop="physicInfo" show-overflow-tooltip width="240"></el-table-column>-->
<!-- <el-table-column label="药品名称" prop="physicName" show-overflow-tooltip width="180"></el-table-column>-->
<el-table-column label="发货企业" prop="fromUserName" show-overflow-tooltip width="180"></el-table-column>
<el-table-column label="收货企业" prop="toUserName" show-overflow-tooltip width="180"></el-table-column>
<!-- <el-table-column width="100" label="生产批号" prop="produceBatchNo" show-overflow-tooltip ></el-table-column>-->
<!-- <el-table-column label="生产日期" prop="produceDate" show-overflow-tooltip width="180"></el-table-column>-->
<!-- <el-table-column label="有效期至" prop="exprieDate" show-overflow-tooltip width="180"></el-table-column>-->
<!-- <el-table-column width="120" label="制剂数量" prop="prepnCount" show-overflow-tooltip ></el-table-column>-->
<!-- <el-table-column width="120" label="最小包装数量" prop="codeCount" show-overflow-tooltip ></el-table-column>-->
<!-- <el-table-column width="120" label="厂商" prop="produceEntName" show-overflow-tooltip ></el-table-column>-->
</el-table>
<!-- <pagination-->
<!-- v-show="pageTotal>0"-->
<!-- :total="pageTotal"-->
<!-- :page.sync="orderQuery.page"-->
<!-- :limit.sync="orderQuery.limit"-->
<!-- />-->
<!--@pagination="getList"-->
</el-card>
<!-- <el-card>-->
<el-tabs type="border-card" style="margin: 15px">
<el-tab-pane label="单据明细">
<el-table
:data="aliYljgBillDetailDrugList"
style="width: 100%"
highlight-current-row="false"
v-loading="loading"
border
ref="multipleTable"
>
<el-table-column label="药品通用名" prop="prodName" width="240" show-overflow-tooltip ></el-table-column>
<!-- <el-table-column width="140" label="药品商品名" prop="prodName" show-overflow-tooltip ></el-table-column>-->
<!-- <el-table-column label="生产企业名称" prop="productEntName" show-overflow-tooltip ></el-table-column>-->
<!-- <el-table-column label="药品信息" prop="physicInfo" show-overflow-tooltip ></el-table-column>-->
<!-- <el-table-column label="药品名称" prop="physicName" show-overflow-tooltip ></el-table-column>-->
<!-- <el-table-column label="制剂数量" prop="prepnCount" show-overflow-tooltip ></el-table-column>-->
<el-table-column width="100" label="生产批号" prop="produceBatchNo" show-overflow-tooltip ></el-table-column>
<!-- <el-table-column label="包装单位描述" prop="pkgUnitDesc" show-overflow-tooltip ></el-table-column>-->
<el-table-column width="180" label="生产日期" prop="produceDate" show-overflow-tooltip ></el-table-column>
<el-table-column width="180" label="有效期至" prop="validEndDate" show-overflow-tooltip ></el-table-column>
<el-table-column width="180" label="制剂规格描述" prop="prepnSpec" show-overflow-tooltip ></el-table-column>
<el-table-column width="120" label="制剂数量" prop="leastPrepnAmount" show-overflow-tooltip ></el-table-column>
<el-table-column width="120" label="最小包装数量" prop="leastPkgAmount" show-overflow-tooltip ></el-table-column>
<el-table-column width="120" label="厂商" prop="productEntName" show-overflow-tooltip ></el-table-column>
<el-table-column label="操作" width="160" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="handleCodeDetailClick(scope.row)"
>追溯码明细
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<!-- </el-card>-->
<el-dialog
title="追溯码明细"
:visible.sync="codeDetailVisible"
append-to-body width="65%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="codeDetailVisible"
>
<retraceCodeDetailDialog
:dataList="this.codes">
</retraceCodeDetailDialog>
</el-dialog>
</div>
</template>
<script>
import retraceCodeDetailDialog from './retraceCodeDetailDialog'
import { aliYljgSearchbillPage,aliYljgBillDetail } from '@/api/thrsys/alihealthBus.js'
import { addAliBizProduct } from '@/api/inout/order.js'
export default {
components: { retraceCodeDetailDialog },
props: {
closeDialog: {
type: Function,
required: true,
},
orderFormData: {
type: Object,
required: true,
}
},
data() {
return {
loading: false,
orderQuery: {
beginDate:null,
ensDate:null,
billCode:null,
page: 1,
limit: 100
},
pageTotal: 10,
dataList: [],
aliYljgBillDetailDrugList: [],
codes: [],
pickerOptions: {
shortcuts: [
{
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])
}
}
]
},
actDateRange: [],
showSearch: true,
codeDetailVisible: false,
radioCheck: null,
currentRow: null
}
},
methods: {
onReset() {
this.orderQuery = {
beginDate: null,
ensDate: null,
page: 1,
limit: 100
},
this.getList()
},
confirmSelect() {
if (this.currentRow == null) {
this.$message.error('请选择要选入的单据!')
return
}
if (this.orderFormData.action == null) {
this.$message.error('请选择单据类型!')
return
}
this.orderFormData.orderEntity = JSON.parse(JSON.stringify(this.orderFormData));
this.orderFormData.aliData = this.currentRow
// this.loading = true
//
const loading = this.$loading({
lock: true,
text: '选入中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
addAliBizProduct(this.orderFormData).then((res) => {
if (res.code === 20000) {
this.codeDetailVisible = false
this.$message.success('选入成功')
// this.loading = false
this.closeDialog(res.data)
//
loading.close();
} else {
this.$message.error(res.message)
// this.loading = false
loading.close();
}
}).catch((error) => {
this.$message.error('选入失败')
// this.loading = false
loading.close();
})
},
hideSearch() {
this.showSearch = !this.showSearch
},
search() {
this.getList()
},
handleCodeDetailClick(row) {
this.codes = row.aliYljgBillDetailDrugCodeList
this.codeDetailVisible = true
},
handleChange(currentRow) {
this.getBillDetail(currentRow)
if (currentRow.checkBillNO){
this.$message.error('已被选入')
return
}
this.radioCheck = currentRow.billCode
this.currentRow = currentRow
},
createDateTime() {
const end = new Date(); //
const start = new Date(); //
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); // 7
const formatDate = (date) => {
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
return `${year}-${month}-${day}`;
};
this.actDateRange = [formatDate(start), formatDate(end)];
},
getList() {
if (this.actDateRange !== null) {
this.orderQuery.beginDate = this.actDateRange[0]
this.orderQuery.ensDate = this.actDateRange[1]
}else {
this.$message.error('请先选择查询日期范围!')
}
aliYljgSearchbillPage(this.orderQuery).then(res => {
if (res.code == 20000) {
this.dataList = res.data.list || []
this.radioCheck = null
}
})
},
getBillDetail(currentRow) {
aliYljgBillDetail(currentRow).then(res => {
if (res.code == 20000) {
this.aliYljgBillDetailDrugList = res.data.aliYljgBillDetailDrugList || []
}
})
}
},
created() {
this.createDateTime()
this.getList()
}
}
</script>
<style scoped>
.query-form-item {
display: block !important;
margin-right: 10px;
margin-bottom: 5px;
}
div /deep/ .el-table .warning-row {
background: #bebebe;
}
div /deep/ .el-table .success-row {
background: #ffffff;
}
</style>
Loading…
Cancel
Save