新增选入采购订单

ywj_dev
anthonywj 2 years ago
parent aa7e48cf0c
commit 32cdbdf3a3

@ -7,7 +7,7 @@ ENV = 'production'
#林纪裕
# VUE_APP_BASE_API = 'http://101.43.77.55:9150/UDI_SPMS_SERVER/'
# VUE_APP_BASE_API = 'http://r.jiyuudims.cloud:5004/UDI_SPMS_SERVER/'
# 吴总测试服务器
# VUE_APP_BASE_API = 'http://116.204.106.103:9150/UDI_SPMS_SERVER/'

@ -124,6 +124,14 @@ export function addReceiveOrder(query) {
data: query
});
}
export function addPurOrder(query) {
return axios({
url: "/udiwms/inout/order/addPurOrder",
method: "post",
data: query
});
}
export function addThrOrder(query) {
return axios({

@ -0,0 +1,543 @@
<template>
<div>
<el-card>
<el-form :model="filterQuery" class="query-form" label-width="100px" size="mini" v-show="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.invCode" style="width: 90%" placeholder="请选择采购部门">
<el-option
v-for="item in invList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收货仓库">
<el-select v-model="filterQuery.deptCode" placeholder="请选择收货仓库" style="width: 90%">
<el-option
v-for="item in deptList"
:key="item.code"
:label="item.name"
:value="item.code"
>
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item class="query-form-item" label="处理状态:">
<el-select v-model="filterQuery.dealStatus"
placeholder="请选择处理状态"
clearable
style="width: 90%"
>
<el-option label="未处理" :value="0"></el-option>
<el-option label="已处理" :value="1"></el-option>
<el-option label="已作废" :value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" v-if="showSup">
<el-form-item class="query-form-item" label="供应商:">
<el-select
v-model="filterQuery.supId"
filterable
remote
clearable="true"
reserve-keyword
placeholder="供应商"
:remote-method="findMethod"
size="mini"
:loading="corpLoading"
style="width: 90%"
>
<el-option
v-for="item in fromOptions"
:key="item.name"
:label="item.name"
:value="item.erpId"
>
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发布时间:">
<el-date-picker
:picker-options="pickerUpOptions"
v-model="auditTimes"
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-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="onSubmitFind"></el-button>
<el-button type="primary" icon="el-icon-check" @click="combine"
>确定
</el-button
>
<el-button type="primary" icon="el-icon-share" v-if="this.Menustatus === 1" @click="help"></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="true"
@current-change="handleDetail">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="采购订单号" prop="billNo" width="150" show-overflow-tooltip></el-table-column>
<el-table-column label="发布时间" prop="auditTime" width="150" show-overflow-tooltip></el-table-column>
<el-table-column label="供应商" prop="supName" show-overflow-tooltip="true" width="180"
v-if="showSup"></el-table-column>
<el-table-column label="处理状态" prop="emergency" width="120">
<template slot-scope="scope">
{{ dealStatus[scope.row.emergency] }}
</template>
</el-table-column>
<!-- <el-table-column label="创建时间" prop="createTime" width="180" show-overflow-tooltip></el-table-column>-->
<el-table-column label="紧急程度" prop="emergency" width="120">
<template slot-scope="scope">
{{ emergencyMap[scope.row.emergency] }}
</template>
</el-table-column>
<el-table-column label="到货时间" prop="arrivalTime" width="150" show-overflow-tooltip></el-table-column>
<el-table-column label="订单说明" prop="remark" width="180" show-overflow-tooltip></el-table-column>
<el-table-column label="采购部门" prop="deptName" width="150" show-overflow-tooltip></el-table-column>
<el-table-column label="收货仓库" prop="invName" width="150" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" fixed="right" width="100">
<template slot-scope="scope">
<el-button type="text" size="small" @click.native.stop="newDistributionForm(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="handleCurrentChange"
></pagination>
</el-card>
<el-card class="el-card">
<el-table v-loading="loading" :data="detailList" style="width: 100%" border highlight-current-row="true">
<el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column label="物资名称" prop="productName" show-overflow-tooltip width="150"></el-table-column>
<el-table-column label="规格型号" prop="spec" show-overflow-tooltip width="160"></el-table-column>
<el-table-column label="计量单位" prop="measname" show-overflow-tooltip width="100"></el-table-column>
<el-table-column label="计划数量" prop="planCount" width="100"></el-table-column>
<el-table-column label="订单数量" prop="count" width="100"></el-table-column>
<el-table-column label="计量单位" prop="spec" show-overflow-tooltip="true" width="100"></el-table-column>
<el-table-column label="
" prop="manufactory" show-overflow-tooltip="true" width="160"></el-table-column>
<el-table-column label="注册/备案号" prop="zczbhhzbapzbh" show-overflow-tooltip="true" width="160"></el-table-column>
<!-- <el-table-column label="注册/备案人" prop="ylqxzcrbarmc" show-overflow-tooltip="true"></el-table-column>-->
</el-table>
</el-card>
</div>
</template>
<script>
import {delApply, listOrder, listOrderDetail, delOrderDetailAll} from "@/api/purchase/purOrder";
import {selectAuthMenu} from "@/api/system/sysMenuHelp";
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
import {addPurOrder} from "@/api/inout/erpOrder";
import {getInvListByUser} from "@/api/system/invWarehouse";
import {getDeptListByUser} from "@/api/auth/authDept";
export default {
name: "closeDialog",
props: {
data: {
type: Object,
required: true,
},
closeDialog: {
type: Function,
required: true,
},
},
data() {
return {
BASE_URL: process.env.VUE_APP_BASE_API,
filterQuery: {
billAction: null,
billNo: "",
originType: null,
thirdSysFk: "",
page: 1,
limit: 10,
corpName: null,
type: 1,
editStatus: 1,
},
corpLoading: false,
fromOptions: [],
Menustatus: null,
filePath: "",
createTimes: null,
auditTimes: null,
showSearch: true,
formName: null,
formMap: {
add: "新增采购订单",
update: "采购订单处理",
},
statusMap: {
1: "草稿",
2: "未审核",
3: "已审核",
4: "已拒绝"
},
emergencyMap: {
1: "普通",
2: "紧急",
3: "不紧急",
},
dealStatus: {
1: "已处理",
2: "未处理",
3: "作废",
},
showSup: false,
invList: {},
deptList: {},
idQuery: {},
editType: 1,
total: 0,
thirdSys: [],
thirdSysDetail: null,
busTypes: [],
originTypes: [],
list: [],
detailList: [],
loading: false,
actDateRange: [],
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]);
},
},
],
},
pickerUpOptions: {
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.pickerOptions = [];
this.pickerUpOptions = [];
this.getList();
},
onSubmitFind() {
this.filterQuery.page = 1;
this.getList();
},
combine() {
if (this.$isBlank(this.currentRow.id)) {
return;
}
let tQuery = {
id: this.currentRow.id,
}
addPurOrder(tQuery)
.then((response) => {
if (response.code === 20000) {
this.closeDialog();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
});
},
hideSearch() {
this.showSearch = !this.showSearch;
},
help() {
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
window.open(this.certFileUrl + this.filePath);
},
getList() {
if (this.createTimes != null) {
this.filterQuery.startDate = this.createTimes[0];
this.filterQuery.endDate = this.createTimes[1];
} else {
this.filterQuery.startDate = null;
this.filterQuery.endDate = null;
}
if (this.auditTimes != null) {
this.filterQuery.startAuditDate = this.auditTimes[0];
this.filterQuery.endAuditDate = this.auditTimes[1];
} else {
this.filterQuery.startAuditDate = null;
this.filterQuery.endAuditDate = null;
}
this.loading = true;
this.filterQuery.status = 3;
listOrder(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) {
let query = {orderIdFk: row.id};
this.loading = true;
listOrderDetail(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(() => {
delOrderDetailAll(row)
.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();
},
selectAuthMenu() {
let params = {menuName: this.$route.meta.title}
selectAuthMenu(params).then((res) => {
if (res.code === 20000) {
this.Menustatus = res.data.status;
this.filePath = res.data.filePath;
}
})
},
findMethod(key) {
this.corpLoading = true;
this.fromOptions = [];
let params = {
key: key,
corpType: 2,
page: 1,
limit: 20
};
getBasicUnitMaintains(params).then((res) => {
this.corpLoading = false;
this.fromOptions = res.data.list || [];
}).catch(() => {
this.corpLoading = false;
})
},
getInvList() {
getInvListByUser().then((res) => {
this.invList = res.data || [];
this.getBusType();
})
},
getDeptList() {
getDeptListByUser().then((res) => {
this.deptList = res.data || [];
});
},
newDistributionForm(row) {
this.idQuery.id = '';
if (this.$isNotBlank(row) && this.$isNotBlank(row.id)) {
this.idQuery.id = row.id;
this.idQuery.formData = row;
this.formName = "update";
} else
this.formName = "add";
this.newSpDistributionVisible = true;
},
}
,
components: {
}
,
filters: {
statusFilterType(status) {
const statusMap = {
2: "warning",
3: "success",
4: "danger",
};
return statusMap[status];
}
,
}
,
mounted() {
}
,
created() {
let supId = this.$store.getters.customerId;
if (supId == "110") {
this.showSup = true;
}
this.selectAuthMenu();
let end = new Date();
let start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.actDateRange = [start, end];
this.getList();
this.getInvList();
this.getDeptList();
}
,
}
;
</script>
<style scoped>
</style>

@ -142,7 +142,7 @@
</template>
<script>
import {addReceiveOrder, addStockOrder, getCloudErp} from "../../api/inout/erpOrder";
import {addPurOrder, addReceiveOrder, addStockOrder, getCloudErp} from "../../api/inout/erpOrder";
import store from "../../store";
import {filterAllByUser} from "@/api/system/invWarehouse";
@ -319,7 +319,7 @@ export default {
let tQuery = {
id: this.currentRow.id,
}
addReceiveOrder(tQuery)
addPurOrder(tQuery)
.then((response) => {
if (response.code === 20000) {
this.closeDialog();

@ -193,7 +193,7 @@
></selectThrOrder>
</el-dialog>
<el-dialog
title="选入领用单据"
title="选入采购订单"
:visible.sync="selectReceiveVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
@ -228,7 +228,7 @@ import {getLocalJoinByUser} from "@/api/basic/busType";
import {selectSysParamByKey} from "@/api/param/systemParamConfig";
import selectThrOrder from "./DialogSelectThrOrder";
import selectReceiveOrderDialog from "./DialogSelectReceiveOrder";
import selectReceiveOrderDialog from "./DialogSelectPurOrder";
export default {

Loading…
Cancel
Save