产品申购添加领用单引入

prod
郑明梁 2 years ago
parent 8de62cfb13
commit 8467940551

@ -1,4 +1,5 @@
import axios from '@/utils/request'
import request from "@/utils/request";
//--------------获取领用单据-------------------
export function getReceiveOrder(query) {
@ -35,6 +36,14 @@ export function getAudit(query) {
});
}
// 根据领用单单添加详情表
export function addOrderDetailAndApply(data) {
return request({
url: "/receive/order/addOrderDetailAndApply",
method: 'post',
data: data
})
}

@ -0,0 +1,335 @@
<template>
<div>
<el-card style="margin-top: -15px">
<el-form :model="filterQuery" label-width="120px" v-show="showSearch">
<el-row>
<el-col :span="6">
<el-form-item label="单据号:" class="query-form-item">
<el-input v-model="filterQuery.billNo" style="width: 90%" placeholder="单据号" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="单据日期:" class="query-form-item">
<el-date-picker
:picker-options="pickerOptions"
v-model="actDateRange"
type="daterange"
style="width: 90%"
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-search" @click="onSubmitFind"></el-button>
<el-button type="primary" icon="el-icon-plus" @click="combine"></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">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.billDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="创建人" prop="createByName"></el-table-column>
<el-table-column label="审核人" prop="auditByName"></el-table-column>
<el-table-column label="申购仓库" prop="invName"></el-table-column>
<el-table-column label="申购分库" prop="subInvName"></el-table-column>
<el-table-column label="申购说明" prop="remark"></el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="filterQuery.page"
:limit.sync="filterQuery.limit"
@pagination="handleCurrentChange"
></pagination>
</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="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="count"></el-table-column>
<el-table-column label="注册/备案凭证号" prop="zczbhhzbapzbh" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="生产企业" prop="manufactory" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="医疗器械注册人" prop="ylqxzcrbarmc" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="供应商" prop="supName" show-overflow-tooltip="true"></el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import {selectApprovedList,listApplyDetail} from "@/api/purchase/purPlan"
import {delOrder, addPlanDetailAndOrder,listOrderDetail} from "@/api/purchase/purOrder"
import {addOrderDetailAndApply, getOrderDetail, getReceiveOrder} from "@/api/inout/receiveOrder";
export default {
name: "selectPlanListDialog",
props: {
data: {
type: Object,
required: true,
},
closeDialog: {
type: Function,
required: true,
},
pId: {
type: Object,
required: true,
},
},
data() {
return {
showSearch: true,
filterQuery: {
billAction: null,
billNo: "",
originType: null,
page: 1,
limit: 10,
},
formName: null,
statusMap: {
1: "草稿",
2: "未审核",
3: "已审核",
4: "已拒绝"
},
ids: [],
idQuery: {},
editType: 2,
total: 0,
thirdSys: [],
thirdSysDetail: null,
busTypes: [],
originTypes: [],
list: [],
detailList: [],
loading: false,
currentRow: null,
actDateRange: [],
selectApplyVisible:false,
newSpDistributionVisible: false,
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,
billAction: null,
startDate: null,
endDate: null,
page: 1,
limit: 10,
corpName: null,
type: 1,
editStatus: 1,
};
this.actDateRange = [];
this.getList();
},
onSubmitFind() {
this.filterQuery.page = 1;
this.getList();
},
hideSearch() {
this.showSearch = !this.showSearch;
},
getList() {
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;
this.filterQuery.status = 3;
getReceiveOrder(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) {
this.currentRow = row;
let query = {orderIdFk: row.billNo};
this.loading = true;
getOrderDetail(query) //
.then((response) => {
this.detailList = response.data.list || [];
this.loading = false;
})
.catch(() => {
this.loading = false;
this.detailList = [];
this.total = 0;
});
},
deleteDialog(row) {
this.$confirm("此操作将永久删除该单据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delOrder(row.id)
.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(() => {
});
},
handleCurrentChange(val) {
this.filterQuery.page = val.page;
this.getList();
},
combine() {
if (this.$isBlank(this.currentRow.id)) {
this.$message.error("未选择申购单!");
}
var data = {
id: this.pId,
orderId: this.currentRow.billNo
}
addOrderDetailAndApply(data).then((res) => {
this.closeDialog(res.data);
}).catch(() => {
})
},
},
created() {
let end = new Date();
let start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.actDateRange = [start, end];
this.getList();
this.ids = [];
if (this.data.stockOrderLists.length > 0) {
for (var i = 0; i < this.data.stockOrderLists.length; i++) {
this.ids.push(this.data.stockOrderLists[i].productId);
}
}
},
components: {
},
filters: {
statusFilterType(status) {
const statusMap = {
2: "warning",
3: "success",
4: "danger",
};
return statusMap[status];
}
,
}
,
};
</script>
<style scoped>
div /deep/ .el-table .warning-row {
background: #bebebe;
}
div /deep/ .el-table .success-row {
background: #ffffff;
}
</style>

@ -209,6 +209,7 @@ export default {
},
getId(id){
if( this.formName=='add' && id!=null){
debugger
var data={
id:id
}
@ -268,7 +269,7 @@ export default {
});
},
handleClose(){
if( this.formName=='add' && this.pId!=null){
if( this.formName=='add'){
this.isChang=!this.isChang
}else{
this.newSpDistributionVisible=false

@ -63,17 +63,14 @@
</el-card>
<el-card>
<el-row type="flex" justify="end">
<el-button-group style="display: flex">
<el-button
type="primary"
size="small"
@click.native.stop="selectProductFunction()"
style="margin: 0px 60px 10px auto; height: 35px"
:loading="loading"
>产品录入
</el-button
>
<el-button-group style="display: flex;margin-bottom: 15px; margin-right: 50px">
<el-button type="primary" @click.native.stop="selectProductFunction()" :loading="loading">产品录入</el-button>
<el-button type="primary" :loading="loading" @click.native.stop="selectApply()">选入计划单</el-button>
</el-button-group>
</el-button-group>
</el-row>
<el-table v-loading="loading" :data="codeArray" style="width: 100%;" :row-class-name="tableRowClassName" border highlight-current-row max-height="300" height="300" ref="multipleTable">
<el-table-column label="序号" type="index" width="50"></el-table-column>
@ -121,6 +118,23 @@
:purType="1"
></purApplyProducts>
</el-dialog>
<el-dialog
title="计划单据选入"
:visible.sync="selectApplyVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="80%"
append-to-body
v-if="selectApplyVisible"
>
<select-recelve-list-dialog
:data="thisData"
:pId="pId"
:closeDialog="closeDialogC2"
></select-recelve-list-dialog>
</el-dialog>
</div>
</template>
@ -136,6 +150,8 @@ import {
updateDetail
} from "@/api/purchase/purApply";
import {filterSubByInv} from "@/api/system/invSubWarehouse";
import {addPlanId} from "@/api/purchase/purPlan";
import SelectRecelveListDialog from "@/views/inout/receive/selectReveiceListDialog";
export default {
name: "idQuery",
@ -195,6 +211,7 @@ export default {
2: "普通采购",
},
orderEditor: true,
selectApplyVisible:false,
sOptions: [],
sValue: [],
sList: [],
@ -218,6 +235,7 @@ export default {
components: {
draggable,
purApplyProducts,
SelectRecelveListDialog
},
methods: {
saveOrder(status) {
@ -304,6 +322,7 @@ export default {
},
closeDialogC2(rData) {
this.selectProductVisible = false;
this.selectApplyVisible = false;
this.query={
orderIdFk:rData
}
@ -344,6 +363,19 @@ export default {
this.getList();
}
},
selectApply() {
this.selectApplyVisible = true;
//idid
if(this.pId==null){
addApplyId().then(response => {
if (response.code === 20000) {
this.pId=response.data
}
}).catch(() => {
this.loading = false;
})
}
},
deleteCodeArray(index, row) {
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
confirmButtonText: "确定",

Loading…
Cancel
Save