|
|
|
@ -11,7 +11,8 @@
|
|
|
|
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="申购部门">
|
|
|
|
|
<el-select v-model="filterQuery.targetDeptCode" placeholder="请选择申购部门" @change="getInvList" style="width: 90%">
|
|
|
|
|
<el-select v-model="filterQuery.targetDeptCode" placeholder="请选择申购部门" @change="getInvList"
|
|
|
|
|
style="width: 90%">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in deptList"
|
|
|
|
|
:key="item.code"
|
|
|
|
@ -74,24 +75,26 @@
|
|
|
|
|
<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-plus" @click="newDistributionForm()" :loading="loading">新增单据</el-button>
|
|
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="newDistributionForm()" :loading="loading">新增单据
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-button-group>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<el-divider style="margin: 15px"></el-divider>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="list" style="width: 100%" @current-change="handleDetail" border highlight-current-row
|
|
|
|
|
<el-table v-loading="loading" :data="list" style="width: 100%" @current-change="handleDetail" border
|
|
|
|
|
highlight-current-row
|
|
|
|
|
:default-sort="defaultSort" @sort-change="handleSortChange">
|
|
|
|
|
<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="targetDeptName"></el-table-column>
|
|
|
|
|
<el-table-column label="申购仓库" prop="targetInvName"></el-table-column>
|
|
|
|
|
<el-table-column label="紧急程度" prop="emergency" >
|
|
|
|
|
<el-table-column label="紧急程度" prop="emergency">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{ emergencyMap[scope.row.emergency] }}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="到货截止" prop="arrivalTime" ></el-table-column>
|
|
|
|
|
<el-table-column label="到货截止" prop="arrivalTime"></el-table-column>
|
|
|
|
|
<el-table-column label="单据状态" prop="status">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-tag :type="(scope.row.status) | statusFilterType">
|
|
|
|
@ -104,7 +107,8 @@
|
|
|
|
|
sortable="custom" :sort-orders="['ascending', 'descending']"></el-table-column>
|
|
|
|
|
<el-table-column label="操作" width="120px">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button type="text" size="small" @click.native="newDistributionForm(scope.$index, scope.row)">编辑</el-button>
|
|
|
|
|
<el-button type="text" size="small" @click.native="newDistributionForm(scope.$index, scope.row)">编辑
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="text" size="small" @click.native.stop="deleteDialog(scope.row)">删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
@ -142,7 +146,7 @@
|
|
|
|
|
@close='closeDialog'
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
:close-on-press-escape="false"
|
|
|
|
|
:before-close ="handleClose"
|
|
|
|
|
:before-close="handleClose"
|
|
|
|
|
>
|
|
|
|
|
<pureApplyEdit
|
|
|
|
|
:closeDialog="closeDialog"
|
|
|
|
@ -156,16 +160,16 @@
|
|
|
|
|
<script>
|
|
|
|
|
import pureApplyEdit from "./purApplyEditDiaolog";
|
|
|
|
|
import {delApply, delApplyDetailAll, inserThrOrderWeb, listApply, listApplyDetail} from "@/api/purchase/purApply";
|
|
|
|
|
import { getInvListByUser } from '@/api/system/invWarehouse'
|
|
|
|
|
import { getDeptListByUser } from '@/api/auth/authDept'
|
|
|
|
|
import {filterSubAll} from "@/api/system/invSubWarehouse";
|
|
|
|
|
import {getInvListByUser} from '@/api/system/invWarehouse'
|
|
|
|
|
import {filterDepts, getDeptListByUser} from '@/api/auth/authDept'
|
|
|
|
|
import {filterGroupBySpuse, filterSubAll} from "@/api/system/invSubWarehouse";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
defaultSort: {prop: 'createTime', order: 'desc'},
|
|
|
|
|
showSearch: true,
|
|
|
|
|
pId:null,
|
|
|
|
|
pId: null,
|
|
|
|
|
filterQuery: {
|
|
|
|
|
billAction: null,
|
|
|
|
|
billNo: "",
|
|
|
|
@ -176,11 +180,11 @@ export default {
|
|
|
|
|
corpName: null,
|
|
|
|
|
type: 1,
|
|
|
|
|
editStatus: 1,
|
|
|
|
|
emergency:'',
|
|
|
|
|
targetDeptCode:'',
|
|
|
|
|
targetInvCode:null
|
|
|
|
|
emergency: '',
|
|
|
|
|
targetDeptCode: '',
|
|
|
|
|
targetInvCode: null
|
|
|
|
|
},
|
|
|
|
|
isChang:false,
|
|
|
|
|
isChang: false,
|
|
|
|
|
formName: null,
|
|
|
|
|
formMap: {
|
|
|
|
|
add: "新增申购单据",
|
|
|
|
@ -192,7 +196,7 @@ export default {
|
|
|
|
|
3: "已审核",
|
|
|
|
|
4: "已拒绝"
|
|
|
|
|
},
|
|
|
|
|
emergencyMap:{
|
|
|
|
|
emergencyMap: {
|
|
|
|
|
1: "正常",
|
|
|
|
|
2: "较急",
|
|
|
|
|
3: "特急",
|
|
|
|
@ -200,14 +204,14 @@ export default {
|
|
|
|
|
idQuery: {},
|
|
|
|
|
total: 0,
|
|
|
|
|
thirdSys: [],
|
|
|
|
|
invList:{},
|
|
|
|
|
invCodebe:null,
|
|
|
|
|
deptList:{},
|
|
|
|
|
invList: {},
|
|
|
|
|
invCodebe: null,
|
|
|
|
|
deptList: {},
|
|
|
|
|
thirdSysDetail: null,
|
|
|
|
|
busTypes: [],
|
|
|
|
|
originTypes: [],
|
|
|
|
|
list: [],
|
|
|
|
|
createTimes:null,
|
|
|
|
|
createTimes: null,
|
|
|
|
|
detailLoading: false,
|
|
|
|
|
detailList: [],
|
|
|
|
|
loading: false,
|
|
|
|
@ -266,29 +270,29 @@ export default {
|
|
|
|
|
type: 1,
|
|
|
|
|
editStatus: 1,
|
|
|
|
|
targetDeptCode: this.invCodebe,
|
|
|
|
|
targetInvCode:null
|
|
|
|
|
targetInvCode: null
|
|
|
|
|
};
|
|
|
|
|
this.initActDateRange()
|
|
|
|
|
if(deptCode!=this.invCodebe){
|
|
|
|
|
if (deptCode != this.invCodebe) {
|
|
|
|
|
this.getInvList()
|
|
|
|
|
}
|
|
|
|
|
this.actDateRange = [];
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
getId(id){
|
|
|
|
|
if( this.formName=='add' && id!=null){
|
|
|
|
|
var data={
|
|
|
|
|
id:id
|
|
|
|
|
getId(id) {
|
|
|
|
|
if (this.formName == 'add' && id != null) {
|
|
|
|
|
var data = {
|
|
|
|
|
id: id
|
|
|
|
|
}
|
|
|
|
|
this.pId=id
|
|
|
|
|
this.pId = id
|
|
|
|
|
//当在新增时取消添加操作删除掉这次的数据
|
|
|
|
|
delApplyDetailAll(data).then((response)=>{
|
|
|
|
|
if(response.code==20000){
|
|
|
|
|
this.newSpDistributionVisible=false
|
|
|
|
|
delApplyDetailAll(data).then((response) => {
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.newSpDistributionVisible = false
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
this.newSpDistributionVisible=false
|
|
|
|
|
} else {
|
|
|
|
|
this.newSpDistributionVisible = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
@ -325,7 +329,7 @@ export default {
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.list = response.data.list || [];
|
|
|
|
|
this.total = response.data.total || 0;
|
|
|
|
|
this.detailList=[]
|
|
|
|
|
this.detailList = []
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
}
|
|
|
|
@ -350,11 +354,11 @@ export default {
|
|
|
|
|
this.detailList = [];
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleClose(){
|
|
|
|
|
if( this.formName=='add'){
|
|
|
|
|
this.isChang=!this.isChang
|
|
|
|
|
}else{
|
|
|
|
|
this.newSpDistributionVisible=false
|
|
|
|
|
handleClose() {
|
|
|
|
|
if (this.formName == 'add') {
|
|
|
|
|
this.isChang = !this.isChang
|
|
|
|
|
} else {
|
|
|
|
|
this.newSpDistributionVisible = false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
submitOrder(row) {
|
|
|
|
@ -425,27 +429,31 @@ export default {
|
|
|
|
|
this.newSpDistributionVisible = true;
|
|
|
|
|
},
|
|
|
|
|
getInvList() {
|
|
|
|
|
var query={
|
|
|
|
|
parentId:this.filterQuery.targetDeptCode
|
|
|
|
|
var query = {
|
|
|
|
|
parentId: this.filterQuery.targetDeptCode,
|
|
|
|
|
spUse: true,
|
|
|
|
|
}
|
|
|
|
|
this.filterQuery.targetInvCode = null
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
filterSubAll(query).then((res) => {
|
|
|
|
|
filterGroupBySpuse(query).then((res) => {
|
|
|
|
|
this.invList = res.data || [];
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getDeptList() {
|
|
|
|
|
getDeptListByUser().then((res) => {
|
|
|
|
|
let query = {
|
|
|
|
|
spUse: true,
|
|
|
|
|
};
|
|
|
|
|
filterDepts(query).then((res) => {
|
|
|
|
|
this.deptList = res.data || [];
|
|
|
|
|
if(this.deptList.length>0){
|
|
|
|
|
this.filterQuery.targetDeptCode=this.deptList[0].code
|
|
|
|
|
this.invCodebe=this.filterQuery.targetDeptCode
|
|
|
|
|
if (this.deptList.length > 0) {
|
|
|
|
|
this.filterQuery.targetDeptCode = this.deptList[0].code
|
|
|
|
|
this.invCodebe = this.filterQuery.targetDeptCode
|
|
|
|
|
}
|
|
|
|
|
this.getList();
|
|
|
|
|
this. getInvList();
|
|
|
|
|
this.getInvList();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
initActDateRange(){
|
|
|
|
|
initActDateRange() {
|
|
|
|
|
|
|
|
|
|
let end = new Date();
|
|
|
|
|
let start = new Date();
|
|
|
|
|