feat: 项目组套和三方出入库明细

20231126-yw
chenhc 1 year ago
parent 2318737957
commit 066630cf5d

@ -0,0 +1,66 @@
import axios from '@/utils/request'
/**
* 获取单据列表
* @param query
* @returns {*}
*/
export function getThrInvOrders(query) {
return axios({
url: '/udiwms/thrsys/getThrInvOrders',
method: 'get',
params: query
})
}
/**
* 获取单据明细列表
* @param query
* @returns {*}
*/
export function getThrInvOrderDetails(query) {
return axios({
url: '/udiwms/thrsys/getThrInvOrderDetails',
method: 'get',
params: query
})
}
/**
* 删除明细行
* @param query
* @returns {*}
*/
export function delThrInvOrderDetail(query) {
return axios({
url: '/udiwms/thrsys/delThrInvOrderDetail',
method: 'post',
data: query
})
}
/**
* 删除单据
* @param query
* @returns {*}
*/
export function delThrInvOrder(query) {
return axios({
url: '/udiwms/thrsys/delThrInvOrder',
method: 'post',
data: query
})
}
/**
* 生成单据
* @param query
* @returns {*}
*/
export function generateOrder(query) {
return axios({
url: '/udiwms/thrsys/generateOrder',
method: 'post',
data: query
})
}

@ -24,7 +24,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="单据类型:">
<el-select v-model="filterQuery.billAction" style="width: 90%" placeholder="请选择第三方系统单据类型"
<el-select v-model="filterQuery.billType" style="width: 90%" placeholder="请选择第三方系统单据类型"
clearable="true">
<el-option
v-for="item in originTypes"
@ -43,11 +43,6 @@
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="往来单位:">
<el-input v-model="filterQuery.corpName" style="width: 90%" placeholder="请输入往来单位" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单据日期:">
<el-date-picker
@ -78,17 +73,20 @@
<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="billTypeName"></el-table-column>
<el-table-column label="单据号" prop="billNo"></el-table-column>
<el-table-column label="往来单位ID" prop="corpId"></el-table-column>
<el-table-column label="往来单位" prop="corpName"
show-overflow-tooltip="true"></el-table-column>
<el-table-column label="单据日期" prop="billdate"></el-table-column>
<el-table-column label="操作" width="60">
<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 label="操作" width="160">
<template slot-scope="scope">
<el-button type="text" @click.native.stop="deleteDialog(scope.row)"
>删除
</el-button>
<el-button type="text" @click.native.stop="generateBill(scope.row)"
>生成单据
</el-button>
</template>
</el-table-column>
</el-table>
@ -103,38 +101,76 @@
<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="productId"></el-table-column>
<el-table-column label="产品通用名" prop="productName" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="规格型号" prop="spec" show-overflow-tooltip="true"></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="reCount"></el-table-column>-->
<el-table-column label="单据数量" prop="count"></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 {delThrOrders, delAll, downloadAll, getThrOrders, getThrOrderDetails} from "@/api/thrsys/thrOrder";
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: {
billAction: null,
billType: null,
billNo: "",
originType: null,
// originType: null,
thirdSysFk: "",
page: 1,
limit: 10,
corpName: null,
// corpName: null,
},
thrInvOrderGenerateVisible: false,
total: 0,
thirdSys: [],
thirdSysDetail: null,
@ -182,7 +218,6 @@ export default {
},
};
},
methods: {
onReset() {
this.$router.push({
@ -191,13 +226,13 @@ export default {
this.filterQuery = {
billNo: "",
thirdSysFk: "",
billFlag: null,
billAction: null,
// billFlag: null,
billType: null,
startDate: null,
endDate: null,
page: 1,
limit: 10,
corpName: null,
// corpName: null,
};
this.actDateRange = [];
this.getList();
@ -218,7 +253,7 @@ export default {
this.filterQuery.endDate = null;
}
this.loading = true;
getThrOrders(this.filterQuery)
getThrInvOrders(this.filterQuery)
.then((response) => {
if (response.code == 20000) {
this.list = response.data.list || [];
@ -235,8 +270,9 @@ export default {
});
},
handleDetail(row) {
if (row ==null) return;
let query = {orderIdFk: row.billNo};
getThrOrderDetails(query)
getThrInvOrderDetails(query)
.then((response) => {
if (response.code == 20000) {
this.detailList = response.data.list || [];
@ -250,6 +286,10 @@ export default {
});
},
generateBill(row){
this.thisData = row;
this.thrInvOrderGenerateVisible = true;
},
deleteDialog(row) {
this.$confirm("此操作将永久删除该单据, 是否继续?", "提示", {
confirmButtonText: "确定",
@ -258,9 +298,9 @@ export default {
})
.then(() => {
let dQuery = {
id: row.id,
billNo: row.billNo,
};
delThrOrders(dQuery)
delThrInvOrder(dQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
@ -278,21 +318,25 @@ export default {
.catch(() => {
});
},
clearAll() {
this.$confirm("此操作将清空所有单据, 是否继续?", "提示", {
deleteDetailDialog(row){
this.$confirm("此操作将永久删除该单据明细行, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delAll()
let dQuery = {
id: row.id,
};
delThrInvOrderDetail(dQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
this.getList();
row.billNo = row.orderIdFk;
this.handleDetail(row);
} else {
this.$message.success(response.message);
this.$message.error(response.message);
}
})
.catch(() => {
@ -362,19 +406,7 @@ export default {
});
},
downloadDatas() {
let query = {
billAction: this.filterQuery.billAction
};
downloadAll(query).then((response) => {
if (response.code == 20000) {
this.$message.success(response.data);
} else {
this.$message.error(response.message);
}
});
},
getActionName(action) {
for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].action === action) {
@ -410,12 +442,15 @@ export default {
})
.catch(() => {
});
},
closeAddDialog(val) {
this.thrInvOrderGenerateVisible = false;
if (val) {
this.getList();
}
},
},
components: {},
components: {thrInvOrderGenerate},
mounted() {
},
created() {

@ -0,0 +1,278 @@
<template>
<el-form :model="generateOrderDate" label-width="120px">
<el-row type="flex">
<el-col :span="11" type="flex">
<el-form-item label="来源单据号:" prop="code">
<el-input style="width: 90%" size="small" placeholder="请输入来源单据号"
disabled
v-model.trim="generateOrderDate.billNo"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="invCode" label="当前仓库:">
<el-select
v-model="generateOrderDate.invCode"
placeholder="当前仓库"
style="width: 90%"
:disabled="corpOrderIdDisabled"
@change="changeInv"
filterable
>
<el-option
v-for="item in curInvOptions"
:key="item.name"
:label="item.name"
:value="item.code"
>
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{
item.warehouseName
}}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="action" label="单据类型:">
<el-select
v-model="generateOrderDate.action"
placeholder="请选择单据类型"
:disabled="corpOrderIdDisabled"
style="width: 90%"
filterable
@change="actionChange"
>
<el-option
v-for="item in busTypeOptions"
:key="item.name"
:label="item.name"
:value="item.action"
>
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-form-item
prop="fromCorp"
label="往来信息:">
<el-select
v-model="generateOrderDate.fromCorp"
filterable
remote
clearable
reserve-keyword
style="width: 90%"
placeholder="请输入往来信息"
:remote-method="findMethod"
:loading="loading"
:disabled="corpOrderIdDisabled"
>
<el-option
v-for="item in fromOptions"
:key="item.erpId"
:label="item.name"
:value="item.erpId"
>
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-row>
<div style='text-align: center; margin-bottom: 10px;'>
<el-button type="primary" @click="generateOrder"></el-button>
<el-button type="primary" @click="closeAddDialog"></el-button>
</div>
</el-form>
</template>
<script>
import {generateOrder} from "@/api/thrsys/thrInvOrder";
import { findByFrom, findInvByUser } from '../../../api/system/invSubWarehouse'
import { parseTime } from '../../../utils/coTools'
import {findByInvUser, getBusTypeList} from "@/api/basic/busType";
import { getBasicUnitMaintains } from '../../../api/basic/basicUnitMaintain'
export default {
name: 'thrInvOrderGenerate',
props: {
generateOrderDate: {
type: Object,
required: true,
},
closeAddDialog: {
type: Function,
required: true,
},
originTypes: {
type: Object,
required: true,
}
},
data() {
return {
thirdSys: [],
options: [{
value: 1,
label: '客户信息'
}, {
value: 2,
label: '供应商信息'
},
{
value: 3,
label: '内部科室'
}, {
value: 4,
label: '特殊往来'
}],
curInvOptions: [],
fromOptions: [],
busTypeOptions: [],
fromInvOptions: [],
curPreInInvOptions: [], //
curPreInSpaceOptions: [], //
curPreSpaceOptions: [], //
curSpaceOptions: [], //
curAction: {
corpType: 0,
genUnit: false,
checkWebNew: null,
mainAction: null,
}
}
},
methods:{
//
generateOrder(){
generateOrder(this.generateOrderDate).then((res) => {
if (res.code == 20000) {
this.$message.success("生成成功!");
} else
this.$message.error(res.message);
}).catch((error) => {
this.$message.error(error.message);
})
},
//
findInvListByUser() {
this.curInvOptions = [];
findInvByUser()
.then((response) => {
this.curInvOptions = response.data || [];
if (
this.curInvOptions != null &&
this.curInvOptions.length > 0 &&
this.generateOrderDate.invWarehouseCode == null
) {
//this.orderFormData.invCode = this.curInvOptions[0].code;
this.getBusTypeByInv();
}
})
.catch(() => {
});
},
//
changeInv(row) {
this.generateOrderDate.action = null;
this.generateOrderDate.checkPreInOrders = null;
this.checkPreInArray = [];
if (this.documentShow) {
this.documentShow = false;
}
this.curSpaceShow = false;
this.preInSpaceShow = false;
this.preSpaceShow = false;
this.generateOrderDate.curSpaceCode = false;
this.generateOrderDate.checkPreInSpaceCode = false;
this.generateOrderDate.preCurSpaceCode = false;
this.getBusTypeByInv();
},
//
actionChange(item) {
this.generateOrderDate.checkPreInOption = null;
this.generateOrderDate.checkPreInOrders = null;
this.checkPreInArray = [];
this.curAction = this.getActionItem(item);
this.bizShow = false;
//2.
this.generateOrderDate.fromInvCode = null;
this.findMethod();
},
//,
getBusTypeByInv() {
let query = {
code: this.generateOrderDate.invCode,
editType: 2 //
};
findByInvUser(query)
.then((response) => {
this.busTypeOptions = response.data || [];
})
.catch(() => {
});
},
//
getActionItem(action) {
for (let i = 0; i < this.busTypeOptions.length; i++) {
if (this.busTypeOptions[i].action == action) {
return this.busTypeOptions[i];
}
}
},
//
findMethod(query) {
this.fromOptions = [];
let cQuery = {
key: query,
corpType: 4,
outType: null,
page: 1,
limit: 20,
};
getBasicUnitMaintains(cQuery)
.then((response) => {
this.loading = false;
this.fromOptions = response.data.list || [];
})
.catch(() => {
this.loading = false;
});
},
},
created() {
//
this.generateOrderDate.code = "";
this.generateOrderDate.orderType = this.viewType;
//
this.corpOrderIdDisabled = false;
let date = new Date();
this.generateOrderDate.createTime = parseTime(
date,
"{y}-{m}-{d} {h}:{i}:{s}"
);
this.generateOrderDate.corpOrderId =
parseTime(date, "{y}{m}{d}{h}{i}{s}") +
Math.ceil(Math.random() * 89 + 10);
this.generateOrderDate.deptCode = this.$store.getters.deptCode;
this.generateOrderDate.invCode = this.$store.getters.locInvCode;
this.findInvListByUser();
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save