feat: 三方出入库明细功能

dev_ksck2.0
chenhc 1 year ago
parent 8468687d27
commit fb0f39c860

@ -63,4 +63,17 @@ export function generateOrder(query) {
data: query
})
}
/**
* 刷新单据
* @param query
* @returns {*}
*/
export function refreshBill(query) {
return axios({
url: '/udiwms/thrsys/refreshOrder',
method: 'post',
data: query
})
}

@ -1,175 +1,198 @@
<template>
<el-form :model="newProductData" label-width="120px">
<el-row type="flex">
<el-col :span="11" type="flex">
<el-form-item label="产品名称:" prop="name">
<el-input style="width: 90%" size="small" placeholder="请输入产品名称" v-model.trim="newProductData.name"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-col :span="11" class="el-col">
<el-form-item label="规格型号:" prop="spec">
<el-input style="width: 90%" size="small" placeholder="请输入规格型号" v-model.trim="newProductData.spec"></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="计量单位:" prop="measname">
<el-input style="width: 90%" size="small" placeholder="请输入计量单位" v-model.trim="newProductData.measname"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-col :span="11" class="el-col">
<el-form-item label="生产企业:" prop="manufactory">
<el-input style="width: 90%" size="small" placeholder="请输入生产企业" v-model.trim="newProductData.manufactory"></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="注册证号:" prop="registerNo">
<el-input style="width: 90%" size="small" placeholder="请输入注册证号" v-model.trim="newProductData.registerNo"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-col :span="11" class="el-col">
<el-form-item label="医疗器械注册人:" prop="ylqxzcrbarmc">
<el-input style="width: 90%" size="small" placeholder="请输入医疗器械注册人" v-model.trim="newProductData.ylqxzcrbarmc"></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="注册人英文名称:" prop="ylqxzcrbarywmc">
<el-input style="width: 90%" size="small" placeholder="请输入注册人英文名称" v-model.trim="newProductData.ylqxzcrbarywmc"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-col :span="11" class="el-col">
<el-form-item label="产品类别:" prop="cplb">
<el-input style="width: 90%" size="small" placeholder="请输入产品类别" v-model.trim="newProductData.cplb"></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="分类编码:" prop="flbm">
<el-input style="width: 90%" size="small" placeholder="请输入分类编码" v-model.trim="newProductData.flbm"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-col :span="11" class="el-col">
<el-form-item label="商品条码:" prop="sptm">
<el-input style="width: 90%" size="small" placeholder="请输入商品条码" v-model.trim="newProductData.sptm"></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="医保编码:" prop="ybbm">
<el-input style="width: 90%" size="small" placeholder="请输入医保编码" v-model.trim="newProductData.ybbm"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-col :span="11" class="el-col">
<el-form-item label="统一社会信用号:" prop="tyshxydm">
<el-input style="width: 90%" size="small" placeholder="请输入统一社会信用号" v-model.trim="newProductData.tyshxydm"></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="器械类别:" prop="qxlb">
<el-input style="width: 90%" size="small" placeholder="请输入器械类别" v-model.trim="newProductData.qxlb"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form :model="newProductData" label-width="120px">
<el-row type="flex">
<el-col :span="11" class="el-col">
<el-form-item label="产品名称:" prop="name">
<el-input style="width: 90%" size="small" placeholder="请输入产品名称" v-model.trim="newProductData.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="11" type="flex">
<el-form-item label="产品属性:" prop="name">
<el-select v-model="newProductData.attributeType" style="width: 90%" placeholder="选择产品属性" clearable>
<el-option label="设备" :value="1"></el-option>
<el-option label="耗材" :value="2"></el-option>
<el-option label="伴随服务费" :value="3"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-col :span="11" class="el-col">
<el-form-item label="规格型号:" prop="spec">
<el-input style="width: 90%" size="small" placeholder="请输入规格型号" v-model.trim="newProductData.spec"></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="计量单位:" prop="measname">
<el-input style="width: 90%" size="small" placeholder="请输入计量单位" v-model.trim="newProductData.measname"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-col :span="11" class="el-col">
<el-form-item label="生产企业:" prop="manufactory">
<el-input style="width: 90%" size="small" placeholder="请输入生产企业" v-model.trim="newProductData.manufactory"
></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="注册证号:" prop="registerNo">
<el-input style="width: 90%" size="small" placeholder="请输入注册证号" v-model.trim="newProductData.registerNo"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-col :span="11" class="el-col">
<el-form-item label="医疗器械注册人:" prop="ylqxzcrbarmc">
<el-input style="width: 90%" size="small" placeholder="请输入医疗器械注册人" v-model.trim="newProductData.ylqxzcrbarmc"
></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="注册人英文名称:" prop="ylqxzcrbarywmc">
<el-input style="width: 90%" size="small" placeholder="请输入注册人英文名称"
v-model.trim="newProductData.ylqxzcrbarywmc"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-col :span="11" class="el-col">
<el-form-item label="产品类别:" prop="cplb">
<el-input style="width: 90%" size="small" placeholder="请输入产品类别" v-model.trim="newProductData.cplb"></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="分类编码:" prop="flbm">
<el-input style="width: 90%" size="small" placeholder="请输入分类编码" v-model.trim="newProductData.flbm"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-col :span="11" class="el-col">
<el-form-item label="商品条码:" prop="sptm">
<el-input style="width: 90%" size="small" placeholder="请输入商品条码" v-model.trim="newProductData.sptm"></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="医保编码:" prop="ybbm">
<el-input style="width: 90%" size="small" placeholder="请输入医保编码" v-model.trim="newProductData.ybbm"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-col :span="11" class="el-col">
<el-form-item label="统一社会信用号:" prop="tyshxydm">
<el-input style="width: 90%" size="small" placeholder="请输入统一社会信用号" v-model.trim="newProductData.tyshxydm"
></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="器械类别:" prop="qxlb">
<el-input style="width: 90%" size="small" placeholder="请输入器械类别" v-model.trim="newProductData.qxlb"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-col :span="23" class="el-col">
<el-form-item label="产品描述:" prop="cpms">
<el-input style="width: 92%" type="textarea" size="mini" rows="3" placeholder="请输入产品描述" v-model.trim="newProductData.cpms"></el-input>
</el-form-item>
</el-col>
</el-row>
<div style='text-align: center; margin-bottom: 10px;'>
<el-button type="primary" @click="saveNewProduct"></el-button>
<el-button type="primary" @click="closeAddDialog"></el-button>
</div>
</el-form>
<el-row type="flex">
<el-col :span="23" class="el-col">
<el-form-item label="产品描述:" prop="cpms">
<el-input style="width: 92%" type="textarea" size="mini" rows="3" placeholder="请输入产品描述"
v-model.trim="newProductData.cpms"
></el-input>
</el-form-item>
</el-col>
</el-row>
<div style="text-align: center; margin-bottom: 10px;">
<el-button type="primary" @click="saveNewProduct"></el-button>
<el-button type="primary" @click="closeAddDialog"></el-button>
</div>
</el-form>
</template>
<script>
import {addProduct} from "@/api/basic/product/udiRelevance";
import { addProduct } from '@/api/basic/product/udiRelevance'
export default {
name: "productAdd",
props: {
closeUdi: {
type: Function,
required: true,
}
},
data() {
return {
newProductData: {
name: null,
spec: null,
code: null,
measname: null,
manufactory: null,
registerNo: null,
ylqxzcrbarmc: null,
ylqxzcrbarywmc: null,
cplb: null,
flbm: null,
sptm: null,
ybbm: null,
tyshxydm: null,
qxlb: null,
cpms: null,
},
thirdSys: [],
}
name: 'productAdd',
props: {
closeUdi: {
type: Function,
required: true
}
},
data() {
return {
newProductData: {
name: null,
spec: null,
code: null,
measname: null,
manufactory: null,
registerNo: null,
ylqxzcrbarmc: null,
ylqxzcrbarywmc: null,
cplb: null,
flbm: null,
sptm: null,
ybbm: null,
tyshxydm: null,
qxlb: null,
cpms: null,
attributeType: null
},
thirdSys: []
}
},
methods: {
saveNewProduct() {
this.addProductDialogVisible = false;
if (this.$isBlank(this.newProductData.name)) {
this.$message.warning("产品名称不能为空!");
return;
}
if (this.$isBlank(this.newProductData.spec)) {
this.$message.warning("规格型号不能为空");
return;
}
if (this.$isBlank(this.newProductData.measname)) {
this.$message.warning("计量单位不能为空!");
return;
}
if (this.$isBlank(this.newProductData.manufactory)) {
this.$message.warning("生产企业不能为空!");
return;
}
if (this.$isBlank(this.newProductData.registerNo)) {
this.$message.warning("注册证号不能为空!");
return;
}
addProduct(this.newProductData).then((res) => {
if (res.code == 20000) {
this.$message.success("添加成功");
//
this.$emit("closeUdi", true);
}else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
})
},
closeAddDialog(){
this.$emit("closeUdi", false);
},
methods: {
saveNewProduct() {
this.addProductDialogVisible = false
if (this.$isBlank(this.newProductData.name)) {
this.$message.warning('产品名称不能为空!')
return
}
if (this.$isBlank(this.newProductData.spec)) {
this.$message.warning('规格型号不能为空')
return
}
if (this.$isBlank(this.newProductData.measname)) {
this.$message.warning('计量单位不能为空!')
return
}
if (this.$isBlank(this.newProductData.manufactory)) {
this.$message.warning('生产企业不能为空!')
return
}
if (this.$isBlank(this.newProductData.registerNo)) {
this.$message.warning('注册证号不能为空!')
return
}
if (this.$isBlank(this.newProductData.attributeType)) {
this.$message.warning('产品属性不能为空!')
return
}
addProduct(this.newProductData).then((res) => {
if (res.code == 20000) {
this.$message.success('添加成功')
//
this.$emit('closeUdi', true)
} else {
this.$message.error(res.message)
}
}).catch((error) => {
this.$message.error(error.message)
})
},
created() {
},
closeAddDialog() {
this.$emit('closeUdi', false)
}
},
created() {
}
}
</script>

@ -0,0 +1,510 @@
<template>
<div>
<el-card>
<el-form :model="filterQuery" size="mini" label-width="100px" v-if="showSearch">
<el-row>
<el-col :span="8">
<el-form-item label="单据号:">
<el-input v-model="filterQuery.billNo" style="width: 90%" placeholder="请输入单据号" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="外部系统:">
<el-select v-model="filterQuery.thirdSysFk" style="width: 90%" placeholder="请选择第三方系统"
clearable="true" @change="thirdSysChange">
<el-option
v-for="item in thirdSys"
:key="item.thirdId"
:label="item.thirdName"
:value="item.thirdId">
<span style="float: left;font-size: 13px">{{ item.thirdName }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单据类型:">
<el-select v-model="filterQuery.billType" style="width: 90%" placeholder="请选择第三方系统单据类型"
clearable="true">
<el-option
v-for="item in originTypes"
:key="item.name"
:label="item.name"
:value="item.action">
<span style="float: left;font-size: 13px">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px;margin-left: 10px">{{
item.thirdSysName
}}</span>
</el-option>
</el-select>
</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 日"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="top-right-btn">
<el-button-group style="display:flex;">
<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="getList"></el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row
@current-change="handleDetail">
<el-table-column label="序号" type="index" width="60"></el-table-column>
<el-table-column label="单据号" prop="billNo"></el-table-column>
<el-table-column label="单据时间" prop="billDate"></el-table-column>
<el-table-column label="出入库类型" prop="mainAction"></el-table-column>
<el-table-column label="第三方单据类型" prop="billType"></el-table-column>
<el-table-column label="外部系统" prop="thirdSysFk"></el-table-column>
<!-- <el-table-column label="单据状态" prop="status"></el-table-column>-->
<el-table-column
prop="status"
label="单据状态"
width="160"
filter-placement="bottom-end">
<template slot-scope="scope">
<el-tag
:type="scope.row.status == '1' ? 'primary' : 'success'"
disable-transitions>{{scope.row.status == 0 ? '待生成':'已生成'}}</el-tag>
</template>
</el-table-column>
<el-table-column label="异常信息" prop="exMsg" width="360">
<template v-slot="{ row }">
<el-tooltip class="item" effect="dark" :content="row.exMsg" placement="top">
<div class="ellipsis-text" :style="{ color: row.exMsg ? 'red' : 'red' } ">{{ row.exMsg }}</div>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="操作" width="160">
<template slot-scope="scope">
<el-button type="text" @click.native.stop="deleteDialog(scope.row)"
>删除
</el-button>
<el-button v-show="scope.row.status == 0" type="text" @click.native.stop="generateBill(scope.row)" STYLE="color:rgb(0,0,255)"
>生成单据
</el-button>
<el-button v-show="scope.row.status == 1" type="text" @click.native.stop="generateBill(scope.row)" STYLE="color:rgb(0,220,255)"
>重新生成
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="filterQuery.page"
:limit.sync="filterQuery.limit"
@pagination="getList"
/>
</el-card>
<el-card class="el-card">
<el-table v-loading="loading" :data="detailList" style="width: 100%" border highlight-current-row>
<el-table-column label="序号" type="index" width="120"></el-table-column>
<el-table-column label="物资编码" prop="relId"></el-table-column>
<el-table-column label="第三方项目编码" prop="thrCode"></el-table-column>
<el-table-column label="产品通用名" prop="cpmctymc" show-overflow-tooltip="true"></el-table-column>
<!-- <el-table-column label="DI" prop="nameCode" show-overflow-tooltip="true"></el-table-column>-->
<el-table-column label="规格型号" prop="ggxh" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="批次号" prop="batchNo"></el-table-column>
<el-table-column label="计量单位" prop="measname"></el-table-column>
<el-table-column label="价格" prop="price"></el-table-column>
<!-- <el-table-column label="生产日期" prop="productDate"></el-table-column>-->
<!-- <el-table-column label="失效日期" prop="expireDate"></el-table-column>-->
<el-table-column label="医疗器械注册备案人" prop="ylqxzcrbarmc"></el-table-column>
<el-table-column label="注册/备案号" prop="zczbhhzbapzbh"></el-table-column>
<el-table-column label="入库数量" prop="inCount"></el-table-column>
<el-table-column label="出库数量" prop="outCount"></el-table-column>
<el-table-column label="实际数量" prop="reCount"></el-table-column>
<el-table-column label="操作" width="60">
<template slot-scope="scope">
<el-button type="text" @click.native.stop="deleteDetailDialog(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog
:close-on-click-modal="false"
:close-on-press-escape="false"
title="生成单据"
:visible.sync="thrInvOrderGenerateVisible"
width="60%"
v-if="thrInvOrderGenerateVisible"
:close="closeAddDialog"
class="dialog-two"
top="5vh"
>
<thrInvOrderGenerate
:generateOrderDate=thisData
:originTypes=originTypes
:closeAddDialog="closeAddDialog">
</thrInvOrderGenerate>
</el-dialog>
</div>
</template>
<script>
import {delThrInvOrder, getThrInvOrders, getThrInvOrderDetails,delThrInvOrderDetail} from "@/api/thrsys/thrInvOrder";
import {getBussinessType} from "@/api/basic/bussinessType";
import {getOriginBusType} from "@/api/basic/busOriginType";
import {getBasicThirdSys, filterDetailByKey} from "@/api/basic/basicThirdSys";
import {selectIp} from "@/api/param/systemParamConfig";
import thrInvOrderGenerate from "@/views/thirdSys/invOrder/thrInvOrderGenerate";
export default {
data() {
return {
thisData:null,
showSearch: true,
filterQuery: {
billType: null,
billNo: "",
// originType: null,
thirdSysFk: "",
sourceType: 3,
page: 1,
limit: 10,
// corpName: null,
},
thrInvOrderGenerateVisible: false,
total: 0,
thirdSys: [],
thirdSysDetail: null,
busTypes: [],
originTypes: [],
list: [],
detailList: [],
uploadFileUrl: null,
fileList: [],
uploadData: {
thirdSys: "thirdId",
},
loading: false,
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]);
},
},
{
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]);
},
},
],
},
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
billNo: "",
thirdSysFk: "",
// billFlag: null,
billType: null,
startDate: null,
endDate: null,
page: 1,
limit: 10,
// corpName: null,
};
this.actDateRange = [];
this.getList();
},
hideSearch() {
this.showSearch = !this.showSearch;
},
getList() {
if (this.filterQuery.thirdSysFk == null) {
this.$message.warning("请先选择第三方系统!")
return;
}
if (this.actDateRange != null) {
this.filterQuery.startDate = this.actDateRange[0];
this.filterQuery.endDate = this.actDateRange[1];
} else {
this.filterQuery.startDate = null;
this.filterQuery.endDate = null;
}
this.loading = true;
getThrInvOrders(this.filterQuery)
.then((response) => {
if (response.code == 20000) {
this.list = response.data.list || [];
this.total = response.data.total || 0;
} else {
this.$message.error(response.message);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
handleDetail(row) {
if (row ==null) return;
let query = {orderIdFk: row.billNo};
getThrInvOrderDetails(query)
.then((response) => {
if (response.code == 20000) {
this.detailList = response.data.list || [];
} else {
this.$message.error(response.message);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
generateBill(row){
this.thisData = row;
this.thrInvOrderGenerateVisible = true;
},
deleteDialog(row) {
this.$confirm("此操作将永久删除该单据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let dQuery = {
billNo: row.billNo,
};
delThrInvOrder(dQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
this.getList();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
});
})
.catch(() => {
});
},
deleteDetailDialog(row){
this.$confirm("此操作将永久删除该单据明细行, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let dQuery = {
id: row.id,
};
delThrInvOrderDetail(dQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
row.billNo = row.orderIdFk;
this.handleDetail(row);
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
});
})
.catch(() => {
});
},
getBasicThirdSys() {
let query = {
enabled: true,
};
getBasicThirdSys(query)
.then((response) => {
this.thirdSys = response.data.list || [];
this.filterQuery.thirdSysFk = this.thirdSys[0].thirdId;
this.uploadData.thirdSys = this.filterQuery.thirdSysFk;
this.selectSysParam();
this.getThirdSysDetail();
this.getBusType();
})
.catch(() => {
this.loading = false;
this.list = [];
});
},
handleChange(response, files, fileList) {
console.log(response);
if (response.code != 20000) {
this.$message.error(response.message);
} else {
console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
this.$message.success("文件上传成功,请稍后刷新查看!");
}
},
selectSysParam() {
let query = {
key: "thirdIpUrl",
thirdSysFk: this.filterQuery.thirdSysFk
};
selectIp(query).then((response) => {
if (response.code == 20000) {
this.uploadFileUrl = response.data.thridUrl + "/udiwms/erp/pi/upload";
}
});
},
thirdSysChange() {
this.uploadData.thirdSys = this.filterQuery.thirdSysFk;
this.getThirdSysDetail();
this.filterQuery.billAction = "";
this.getBusType();
},
getThirdSysDetail() {
let query = {
thirdSysFk: this.filterQuery.thirdSysFk,
key: "orderQueryUrl",
};
filterDetailByKey(query)
.then((response) => {
this.thirdSysDetail = response.data;
})
.catch(() => {
this.loading = false;
this.list = [];
});
},
getActionName(action) {
for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].action === action) {
return this.busTypes[i].name;
}
}
},
getlocalName(action) {
for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].action === action) {
return this.busTypes[i].localName;
}
}
},
getBusType() {
let query = {
enabled: true,
thirdSys: this.filterQuery.thirdSysFk,
};
getBussinessType(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.getList();
})
.catch(() => {
});
getOriginBusType(query)
.then((response) => {
this.originTypes = response.data.list || [];
// this.filterQuery.originType = this.originTypes[0].action;
// this.getList();
})
.catch(() => {
});
},
closeAddDialog(val) {
this.thrInvOrderGenerateVisible = false;
if (val) {
this.getList();
}
},
},
components: {thrInvOrderGenerate},
mounted() {
},
created() {
this.getBasicThirdSys();
let end = new Date();
let start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.actDateRange = [start, end];
},
};
</script>
<style scoped>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 25%;
}
.text {
font-size: 13px;
font-family: "Microsoft YaHei";
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>

@ -90,6 +90,15 @@
disable-transitions>{{scope.row.status == 0 ? '待生成':'已生成'}}</el-tag>
</template>
</el-table-column>
<el-table-column label="异常信息" prop="exMsg" width="360">
<template v-slot="{ row }">
<el-tooltip class="item" effect="dark" :content="row.exMsg" placement="top">
<div class="ellipsis-text" :style="{ color: row.exMsg ? 'red' : 'red' } ">{{ row.exMsg }}</div>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="操作" width="160">
<template slot-scope="scope">
<el-button type="text" @click.native.stop="deleteDialog(scope.row)"
@ -101,6 +110,9 @@
<el-button v-show="scope.row.status == 1" type="text" @click.native.stop="generateBill(scope.row)" STYLE="color:rgb(0,220,255)"
>重新生成
</el-button>
<el-button v-show="scope.row.exMsg !== null && scope.row.exMsg !== ''" type="text" @click.native.stop="refreshBill(scope.row)"
>更新
</el-button>
</template>
</el-table-column>
</el-table>
@ -113,7 +125,7 @@
/>
</el-card>
<el-card class="el-card">
<el-table v-loading="loading" :data="detailList" style="width: 100%" border highlight-current-row>
<el-table v-loading="loading" :data="detailList" width="100%" :row-style="changRed" border highlight-current-row>
<el-table-column label="序号" type="index" width="120"></el-table-column>
<el-table-column label="物资编码" prop="relId"></el-table-column>
<el-table-column label="第三方项目编码" prop="thrCode"></el-table-column>
@ -132,11 +144,14 @@
<el-table-column label="入库数量" prop="inCount"></el-table-column>
<el-table-column label="出库数量" prop="outCount"></el-table-column>
<el-table-column label="实际数量" prop="reCount"></el-table-column>
<el-table-column label="操作" width="60">
<template slot-scope="scope">
<el-table-column label="操作" width="160">
<template slot-scope="scope" >
<el-button type="text" @click.native.stop="deleteDetailDialog(scope.row)"
>删除
</el-button>
<el-button type="text" v-if="scope.row.relId==null" @click.native.stop="jump()"
>处理
</el-button>
</template>
</el-table-column>
</el-table>
@ -163,7 +178,7 @@
</div>
</template>
<script>
import {delThrInvOrder, getThrInvOrders, getThrInvOrderDetails,delThrInvOrderDetail} from "@/api/thrsys/thrInvOrder";
import {delThrInvOrder, getThrInvOrders, getThrInvOrderDetails,delThrInvOrderDetail,refreshBill} from "@/api/thrsys/thrInvOrder";
import {getBussinessType} from "@/api/basic/bussinessType";
import {getOriginBusType} from "@/api/basic/busOriginType";
import {getBasicThirdSys, filterDetailByKey} from "@/api/basic/basicThirdSys";
@ -180,6 +195,7 @@ export default {
billNo: "",
// originType: null,
thirdSysFk: "",
sourceType: 1,
page: 1,
limit: 10,
// corpName: null,
@ -192,6 +208,7 @@ export default {
originTypes: [],
list: [],
detailList: [],
jumpSkProject: null,
uploadFileUrl: null,
fileList: [],
uploadData: {
@ -240,6 +257,7 @@ export default {
this.filterQuery = {
billNo: "",
thirdSysFk: "",
sourceType: 1,
// billFlag: null,
billType: null,
startDate: null,
@ -285,6 +303,7 @@ export default {
},
handleDetail(row) {
if (row ==null) return;
this.jumpSkProject = row.skProject;
let query = {orderIdFk: row.billNo};
getThrInvOrderDetails(query)
.then((response) => {
@ -304,6 +323,24 @@ export default {
this.thisData = row;
this.thrInvOrderGenerateVisible = true;
},
refreshBill(row){
let rQuery = {
billNo: row.billNo,
};
refreshBill(rQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("更新成功");
this.getList();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
});
},
deleteDialog(row) {
this.$confirm("此操作将永久删除该单据, 是否继续?", "提示", {
confirmButtonText: "确定",
@ -463,6 +500,20 @@ export default {
this.getList();
}
},
jump(){
if (this.jumpSkProject == 1){
this.$router.push('/thirdSys/destiny/skProject')
}else {
this.$router.push('/basic/product/maintain?vueRouteSource=1')
}
},
changRed({row}){
if (row.relId == null) { //
return {
color: "red" // return color backgroundColor
}
}
}
},
components: {thrInvOrderGenerate},
mounted() {

@ -0,0 +1,553 @@
<template>
<div>
<el-card>
<el-form :model="filterQuery" size="mini" label-width="100px" v-if="showSearch">
<el-row>
<el-col :span="8">
<el-form-item label="单据号:">
<el-input v-model="filterQuery.billNo" style="width: 90%" placeholder="请输入单据号" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="外部系统:">
<el-select v-model="filterQuery.thirdSysFk" style="width: 90%" placeholder="请选择第三方系统"
clearable="true" @change="thirdSysChange">
<el-option
v-for="item in thirdSys"
:key="item.thirdId"
:label="item.thirdName"
:value="item.thirdId">
<span style="float: left;font-size: 13px">{{ item.thirdName }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单据类型:">
<el-select v-model="filterQuery.billType" style="width: 90%" placeholder="请选择第三方系统单据类型"
clearable="true">
<el-option
v-for="item in originTypes"
:key="item.name"
:label="item.name"
:value="item.action">
<span style="float: left;font-size: 13px">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px;margin-left: 10px">{{
item.thirdSysName
}}</span>
</el-option>
</el-select>
</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 日"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="top-right-btn">
<el-button-group style="display:flex;">
<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="getList"></el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row
@current-change="handleDetail">
<el-table-column label="序号" type="index" width="60"></el-table-column>
<el-table-column label="单据号" prop="billNo"></el-table-column>
<el-table-column label="单据时间" prop="billDate"></el-table-column>
<el-table-column label="出入库类型" prop="mainAction"></el-table-column>
<el-table-column label="第三方单据类型" prop="billType"></el-table-column>
<el-table-column label="外部系统" prop="thirdSysFk"></el-table-column>
<!-- <el-table-column label="单据状态" prop="status"></el-table-column>-->
<el-table-column
prop="status"
label="单据状态"
width="160"
filter-placement="bottom-end">
<template slot-scope="scope">
<el-tag
:type="scope.row.status == '1' ? 'primary' : 'success'"
disable-transitions>{{scope.row.status == 0 ? '待生成':'已生成'}}</el-tag>
</template>
</el-table-column>
<el-table-column label="异常信息" prop="exMsg" width="360">
<template v-slot="{ row }">
<el-tooltip class="item" effect="dark" :content="row.exMsg" placement="top">
<div class="ellipsis-text" :style="{ color: row.exMsg ? 'red' : 'red' } ">{{ row.exMsg }}</div>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="操作" width="160">
<template slot-scope="scope">
<el-button type="text" @click.native.stop="deleteDialog(scope.row)"
>删除
</el-button>
<el-button v-show="scope.row.status == 0" type="text" @click.native.stop="generateBill(scope.row)" STYLE="color:rgb(0,0,255)"
>生成单据
</el-button>
<el-button v-show="scope.row.status == 1" type="text" @click.native.stop="generateBill(scope.row)" STYLE="color:rgb(0,220,255)"
>重新生成
</el-button>
<el-button v-show="scope.row.exMsg !== null && scope.row.exMsg !== ''" type="text" @click.native.stop="refreshBill(scope.row)"
>更新
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="filterQuery.page"
:limit.sync="filterQuery.limit"
@pagination="getList"
/>
</el-card>
<el-card class="el-card">
<el-table v-loading="loading" :data="detailList" width="100%" :row-style="changRed" border highlight-current-row>
<el-table-column label="序号" type="index" width="120"></el-table-column>
<el-table-column label="物资编码" prop="relId"></el-table-column>
<el-table-column label="第三方项目编码" prop="thrCode"></el-table-column>
<el-table-column label="产品通用名" prop="cpmctymc" show-overflow-tooltip="true"></el-table-column>
<!-- <el-table-column label="DI" prop="nameCode" show-overflow-tooltip="true"></el-table-column>-->
<el-table-column label="规格型号" prop="ggxh" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="批次号" prop="batchNo"></el-table-column>
<el-table-column label="计量单位" prop="measname"></el-table-column>
<el-table-column label="价格" prop="price"></el-table-column>
<!-- <el-table-column label="生产日期" prop="productDate"></el-table-column>-->
<!-- <el-table-column label="失效日期" prop="expireDate"></el-table-column>-->
<el-table-column label="医疗器械注册备案人" prop="ylqxzcrbarmc"></el-table-column>
<el-table-column label="注册/备案号" prop="zczbhhzbapzbh"></el-table-column>
<el-table-column label="入库数量" prop="inCount"></el-table-column>
<el-table-column label="出库数量" prop="outCount"></el-table-column>
<el-table-column label="实际数量" prop="reCount"></el-table-column>
<el-table-column label="操作" width="160">
<template slot-scope="scope" >
<el-button type="text" @click.native.stop="deleteDetailDialog(scope.row)"
>删除
</el-button>
<el-button type="text" v-if="scope.row.relId==null" @click.native.stop="jump()"
>处理
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog
:close-on-click-modal="false"
:close-on-press-escape="false"
title="生成单据"
:visible.sync="thrInvOrderGenerateVisible"
width="60%"
v-if="thrInvOrderGenerateVisible"
:close="closeAddDialog"
class="dialog-two"
top="5vh"
>
<thrInvOrderGenerate
:generateOrderDate=thisData
:originTypes=originTypes
:closeAddDialog="closeAddDialog">
</thrInvOrderGenerate>
</el-dialog>
</div>
</template>
<script>
import {delThrInvOrder, getThrInvOrders, getThrInvOrderDetails,delThrInvOrderDetail,refreshBill} from "@/api/thrsys/thrInvOrder";
import {getBussinessType} from "@/api/basic/bussinessType";
import {getOriginBusType} from "@/api/basic/busOriginType";
import {getBasicThirdSys, filterDetailByKey} from "@/api/basic/basicThirdSys";
import {selectIp} from "@/api/param/systemParamConfig";
import thrInvOrderGenerate from "@/views/thirdSys/invOrder/thrInvOrderGenerate";
export default {
data() {
return {
thisData:null,
showSearch: true,
filterQuery: {
billType: null,
billNo: "",
// originType: null,
thirdSysFk: "",
sourceType: 2,
page: 1,
limit: 10,
// corpName: null,
},
thrInvOrderGenerateVisible: false,
total: 0,
thirdSys: [],
thirdSysDetail: null,
busTypes: [],
originTypes: [],
list: [],
detailList: [],
jumpSkProject: null,
uploadFileUrl: null,
fileList: [],
uploadData: {
thirdSys: "thirdId",
},
loading: false,
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]);
},
},
{
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]);
},
},
],
},
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
billNo: "",
thirdSysFk: "",
sourceType: 2,
// billFlag: null,
billType: null,
startDate: null,
endDate: null,
page: 1,
limit: 10,
// corpName: null,
};
this.actDateRange = [];
this.getList();
},
hideSearch() {
this.showSearch = !this.showSearch;
},
getList() {
if (this.filterQuery.thirdSysFk == null) {
this.$message.warning("请先选择第三方系统!")
return;
}
if (this.actDateRange != null) {
this.filterQuery.startDate = this.actDateRange[0];
this.filterQuery.endDate = this.actDateRange[1];
} else {
this.filterQuery.startDate = null;
this.filterQuery.endDate = null;
}
this.loading = true;
getThrInvOrders(this.filterQuery)
.then((response) => {
if (response.code == 20000) {
this.list = response.data.list || [];
this.total = response.data.total || 0;
} else {
this.$message.error(response.message);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
handleDetail(row) {
if (row ==null) return;
this.jumpSkProject = row.skProject;
let query = {orderIdFk: row.billNo};
getThrInvOrderDetails(query)
.then((response) => {
if (response.code == 20000) {
this.detailList = response.data.list || [];
} else {
this.$message.error(response.message);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
generateBill(row){
this.thisData = row;
this.thrInvOrderGenerateVisible = true;
},
refreshBill(row){
let rQuery = {
billNo: row.billNo,
};
refreshBill(rQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("更新成功");
this.getList();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
});
},
deleteDialog(row) {
this.$confirm("此操作将永久删除该单据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let dQuery = {
billNo: row.billNo,
};
delThrInvOrder(dQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
this.getList();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
});
})
.catch(() => {
});
},
deleteDetailDialog(row){
this.$confirm("此操作将永久删除该单据明细行, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let dQuery = {
id: row.id,
};
delThrInvOrderDetail(dQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
row.billNo = row.orderIdFk;
this.handleDetail(row);
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
});
})
.catch(() => {
});
},
getBasicThirdSys() {
let query = {
enabled: true,
};
getBasicThirdSys(query)
.then((response) => {
this.thirdSys = response.data.list || [];
this.filterQuery.thirdSysFk = this.thirdSys[0].thirdId;
this.uploadData.thirdSys = this.filterQuery.thirdSysFk;
this.selectSysParam();
this.getThirdSysDetail();
this.getBusType();
})
.catch(() => {
this.loading = false;
this.list = [];
});
},
handleChange(response, files, fileList) {
console.log(response);
if (response.code != 20000) {
this.$message.error(response.message);
} else {
console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
this.$message.success("文件上传成功,请稍后刷新查看!");
}
},
selectSysParam() {
let query = {
key: "thirdIpUrl",
thirdSysFk: this.filterQuery.thirdSysFk
};
selectIp(query).then((response) => {
if (response.code == 20000) {
this.uploadFileUrl = response.data.thridUrl + "/udiwms/erp/pi/upload";
}
});
},
thirdSysChange() {
this.uploadData.thirdSys = this.filterQuery.thirdSysFk;
this.getThirdSysDetail();
this.filterQuery.billAction = "";
this.getBusType();
},
getThirdSysDetail() {
let query = {
thirdSysFk: this.filterQuery.thirdSysFk,
key: "orderQueryUrl",
};
filterDetailByKey(query)
.then((response) => {
this.thirdSysDetail = response.data;
})
.catch(() => {
this.loading = false;
this.list = [];
});
},
getActionName(action) {
for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].action === action) {
return this.busTypes[i].name;
}
}
},
getlocalName(action) {
for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].action === action) {
return this.busTypes[i].localName;
}
}
},
getBusType() {
let query = {
enabled: true,
thirdSys: this.filterQuery.thirdSysFk,
};
getBussinessType(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.getList();
})
.catch(() => {
});
getOriginBusType(query)
.then((response) => {
this.originTypes = response.data.list || [];
// this.filterQuery.originType = this.originTypes[0].action;
// this.getList();
})
.catch(() => {
});
},
closeAddDialog(val) {
this.thrInvOrderGenerateVisible = false;
if (val) {
this.getList();
}
},
jump(){
if (this.jumpSkProject == 1){
this.$router.push('/thirdSys/destiny/skProject')
}else {
this.$router.push('/basic/product/maintain?vueRouteSource=1')
}
},
changRed({row}){
if (row.relId == null) { //
return {
color: "red" // return color backgroundColor
}
}
}
},
components: {thrInvOrderGenerate},
mounted() {
},
created() {
this.getBasicThirdSys();
let end = new Date();
let start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.actDateRange = [start, end];
},
};
</script>
<style scoped>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 25%;
}
.text {
font-size: 13px;
font-family: "Microsoft YaHei";
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>
Loading…
Cancel
Save