申购管理配置

20231126-yw
yuanwei 1 year ago
parent 2951e1b9ea
commit 9620345b5f

@ -1,4 +1,5 @@
import axios from "@/utils/request";
import {findInvByUserOptimize} from "@/api/system/invSubWarehouse";
export function filterDepts(query) {
return axios({
@ -8,6 +9,14 @@ export function filterDepts(query) {
});
}
export function filterDeptsOptimize(query) {
return axios({
url: "/spms/inv/warehouse/filterAllOptimize",
method: "get",
params: query
});
}
export function addDept(data) {
return axios({
url: "/udi/auth/dept/add",

@ -47,6 +47,15 @@ export function filterGroupBySpuse(params) {
});
}
export function filterGroupBySpuseOptimize(params) {
return axios({
url: "/spms/inv/warehouse/filterGroupBySpuseOptimize",
method: "get",
params: params
});
}
//获取除了自己所有其他仓库
export function findByFromOptimize(query) {

@ -1,4 +1,5 @@
import axios from "@/utils/request";
import {filterDeptsOptimize} from "@/api/auth/authDept";
// 获取列表
@ -241,6 +242,15 @@ export function getInvListByUser(params) {
params: params
});
}
export function getInvListByUserOptimize(params) {
return axios({
url: "/spms/inv/warehouse/findInvListByUserOptimize",
method: "get",
params: params
});
}
export function findAllInvByUser(params) {
return axios({
url: "/spms/inv/warehouse/findAllInvByUser",

@ -618,6 +618,9 @@ export default {
});
},
newDistributionForm(_this, row) {
if(_this == null){
_this = this
}
_this.idQuery.id = '';
if (_this.$isNotBlank(row) && _this.$isNotBlank(row.id)) {
_this.idQuery.id = row.id;

@ -1,87 +1,151 @@
<template>
<div>
<el-card class="el-card">
<el-form :model="filterQuery" class="query-form" label-width="100px" 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 v-if="queryList && queryList.length > 0" :model="filterQuery" class="query-form" label-width="100px" 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" placeholder="请选择申购仓库" @change="getInvList"-->
<!-- style="width: 90%">-->
<!-- <el-option-->
<!-- v-for="item in invList"-->
<!-- :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-col :span="8">-->
<!-- <el-form-item label="到货部门:">-->
<!-- <el-select v-model="filterQuery.targetDeptCode" placeholder="请选择申购部门" @change="getInvList"-->
<!-- 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-col :span="8">-->
<!-- <el-form-item label="到货仓库:">-->
<!-- <el-select v-model="filterQuery.targetInvCode" style="width: 90%" clearable placeholder="请选择所属仓库">-->
<!-- <el-option-->
<!-- v-for="item in targetInvList"-->
<!-- :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="紧急程度:" prop="emergency">-->
<!-- <el-select v-model="filterQuery.emergency" placeholder="请选择紧急程度" style="width: 90%" 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-col :span="8">-->
<!-- <el-form-item label="创建时间:">-->
<!-- <el-date-picker-->
<!-- :picker-options="pickerOptions"-->
<!-- v-model="actDateRange"-->
<!-- 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-row style=" display:flex; flex-wrap: wrap; ">
<template v-for="(item, index) in queryList" >
<el-form-item v-if="item.columnType == 'input' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`" :key="item.id">
<el-input
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
@keyup.enter.native="executeFuc($event,'5',item.clickFuc)"
clearable
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="申购仓库:">
<el-select v-model="filterQuery.invCode" placeholder="请选择申购仓库" @change="getInvList"
style="width: 90%">
<el-form-item v-if="item.columnType == 'select' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-select v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
clearable>
<el-option
v-for="item in invList"
:key="item.code"
:label="item.name"
:value="item.code"
>
<span style="float: left">{{ item.name }}</span>
</el-option>
v-for="dict in item.lableRuleObj"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="到货部门:">
<el-select v-model="filterQuery.targetDeptCode" placeholder="请选择申购部门" @change="getInvList"
style="width: 90%">
<el-form-item v-if="item.columnType == 'selectServer' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-select
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
filterable
remote
:remote-method="(query) => executeFuc(query,'5',item.clickFuc)"
clearable>
<el-option
v-for="item in deptList"
v-for="item in options[item.clickFuc]"
:key="item.code"
:label="item.name"
:label="item.label"
: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.targetInvCode" style="width: 90%" clearable placeholder="请选择所属仓库">
<el-option
v-for="item in targetInvList"
: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="紧急程度:" prop="emergency">
<el-select v-model="filterQuery.emergency" placeholder="请选择紧急程度" style="width: 90%" 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-col :span="8">
<el-form-item label="创建时间:">
<el-form-item v-if="item.columnType == 'datePicker' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-date-picker
:picker-options="pickerOptions"
v-model="actDateRange"
type="daterange"
format="yyyy 年 MM 月 dd 日"
style="width: 90%"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
></el-date-picker>
</el-form-item>
<el-form-item v-if="item.columnType == 'date' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-date-picker
v-model="filterQuery[item.columnName]"
:style="`width:${item.width+'px'}`"
value-format="yyyy-MM-dd"
:disabled="executeEval(null,item.disabledFuc,false)"
type="date"
:placeholder="item.columnDesc"
></el-date-picker>
</el-form-item>
</el-col>
</template>
</el-row>
</el-form>
<div class="top-right-btn">
@ -96,37 +160,126 @@
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%" @current-change="handleDetail" border
<el-table v-loading="loading" :data="list" style="width: 100%"
@current-change="(row) => executeFuc(row,'0',tableObj.handleChangeFuc)"
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="invName"></el-table-column>
<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="status">
<template slot-scope="scope">
<el-tag :type="(scope.row.status) | statusFilterType">
{{ statusMap[scope.row.status] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="创建时间" prop="createTime"
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.stop="deleteDialog(scope.row)">删除</el-button>
</template>
</el-table-column>
<!-- <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="invName"></el-table-column>-->
<!-- <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="status">-->
<!-- <template slot-scope="scope">-->
<!-- <el-tag :type="(scope.row.status) | statusFilterType">-->
<!-- {{ statusMap[scope.row.status] }}-->
<!-- </el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="备注" prop="remark"></el-table-column>-->
<!-- <el-table-column label="创建时间" prop="createTime"-->
<!-- 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.stop="deleteDialog(scope.row)">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<template v-for="(item, index) in tableHeader">
<el-table-column
v-if="item.columnType == 'id' && executeEval(row,item.expression,true)"
type="index" :label="item.columnDesc"></el-table-column>
<el-table-column
v-if="item.columnType == 'selection'"
type="selection"
:width="item.width"
:selectable="(row,number) => executeFuc(row,'3',item.clickFuc)"
></el-table-column>
<el-table-column
v-if="item.columnType == 'radio' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-radio :label="scope.row.id" v-model="radioCheck"><span></span></el-radio>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'laber' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item.lableRuleObj[scope.row[item.columnName]])}">{{ item.lableRuleObj[scope.row[item.columnName]] }}</span>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'eltag' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-tag :type="executeFuc(scope.row,'4',item,item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName])">
<span>{{ item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName] }}</span>
</el-tag>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'button' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:width="item.width"
:key="item.columnName"
fixed="right"
>
<template slot-scope="scope">
<el-button v-for="(buttonItem, buttonIndex) in item.buttonRulObj"
:type="buttonItem.type"
:size="buttonItem.size"
:style="buttonItem.style"
:key="buttonItem"
v-if="executeEval(scope.row,buttonItem.hasPermi,true)"
:disabled="executeEval(scope.row,buttonItem.disabledFuc,false)"
@click.native.stop="executeFuc(scope.row,'1',buttonItem.clickFuc)"
>{{ buttonItem.name }}
</el-button>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'text' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item,scope.row[item.columnName])}">{{ scope.row[item.columnName] }}</span>
</template>
</el-table-column>
</template>
</el-table>
<pagination
@ -141,15 +294,102 @@
<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="60"></el-table-column>
<el-table-column label="DI/物资编码" prop="nameCode"></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="measname" show-overflow-tooltip="true" width="100"></el-table-column>
<el-table-column label="申购数量" prop="count"></el-table-column>
<el-table-column label="注册/备案号" prop="zczbhhzbapzbh"></el-table-column>
<el-table-column label="生产厂家" prop="manufactory"></el-table-column>
<el-table-column label="供应商" prop="supName"></el-table-column>
<!-- <el-table-column label="序号" type="index" width="60"></el-table-column>-->
<!-- <el-table-column label="DI/物资编码" prop="nameCode"></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="measname" show-overflow-tooltip="true" width="100"></el-table-column>-->
<!-- <el-table-column label="申购数量" prop="count"></el-table-column>-->
<!-- <el-table-column label="注册/备案号" prop="zczbhhzbapzbh"></el-table-column>-->
<!-- <el-table-column label="生产厂家" prop="manufactory"></el-table-column>-->
<!-- <el-table-column label="供应商" prop="supName"></el-table-column>-->
<template v-for="(item, index) in tableHeader2">
<el-table-column
v-if="item.columnType == 'id' && executeEval(row,item.expression,true)"
type="index" :label="item.columnDesc"></el-table-column>
<el-table-column
v-if="item.columnType == 'selection'"
type="selection"
:width="item.width"
:selectable="(row,number) => executeFuc(row,'3',item.clickFuc)"
></el-table-column>
<el-table-column
v-if="item.columnType == 'radio' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-radio :label="scope.row.id" v-model="radioCheck"><span></span></el-radio>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'laber' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item.lableRuleObj[scope.row[item.columnName]])}">{{ item.lableRuleObj[scope.row[item.columnName]] }}</span>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'eltag' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-tag :type="executeFuc(scope.row,'4',item,item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName])">
<span>{{ item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName] }}</span>
</el-tag>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'button' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:width="item.width"
:key="item.columnName"
fixed="right"
>
<template slot-scope="scope">
<el-button v-for="(buttonItem, buttonIndex) in item.buttonRulObj"
:type="buttonItem.type"
:size="buttonItem.size"
:style="buttonItem.style"
:key="buttonItem"
v-if="executeEval(scope.row,buttonItem.hasPermi,true)"
:disabled="executeEval(scope.row,buttonItem.disabledFuc,false)"
@click.native.stop="executeFuc(scope.row,'1',buttonItem.clickFuc)"
>{{ buttonItem.name }}
</el-button>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'text' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item,scope.row[item.columnName])}">{{ scope.row[item.columnName] }}</span>
</template>
</el-table-column>
</template>
</el-table>
</el-card>
@ -175,9 +415,12 @@
<script>
import pureApplyEdit from "./purApplyEditDiaolog";
import {delApply, delApplyDetailAll, inserThrOrderWeb, listApply, listApplyDetail} from "@/api/purchase/purApply";
import {getInvListByUser} from '@/api/system/invWarehouse'
import {filterDepts, getDeptListByUser} from '@/api/auth/authDept'
import {filterGroupBySpuse, filterSubAll} from "@/api/system/invSubWarehouse";
import {getInvListByUserOptimize} from '@/api/system/invWarehouse'
import {filterDeptsOptimize, getDeptListByUser} from '@/api/auth/authDept'
import {filterGroupBySpuseOptimize, filterSubAllOptimize} from "@/api/system/invSubWarehouse";
import {
getHead,executeFuc
} from "@/utils/customConfig";
export default {
data() {
@ -219,6 +462,17 @@ export default {
},
idQuery: {},
total: 0,
tableHeader:[],
queryList:[],
fromList:[],
tableHeader2:[],
queryList2:[],
fromList2:[],
options: {
getCurInvList:[],
getDeptList:[],
getInvList:[],
},
thirdSys: [],
invList: [],
targetInvList: [],
@ -360,17 +614,17 @@ export default {
this.total = 0;
});
},
handleDetail(row) {
handleDetail(_this,row) {
let query = {orderIdFk: row.id};
this.detailLoading = true;
_this.detailLoading = true;
listApplyDetail(query) //
.then((response) => {
this.detailList = response.data.list || [];
this.detailLoading = false;
_this.detailList = response.data.list || [];
_this.detailLoading = false;
})
.catch(() => {
this.detailLoading = false;
this.detailList = [];
_this.detailLoading = false;
_this.detailList = [];
});
},
handleClose() {
@ -400,8 +654,8 @@ export default {
this.loading = false;
})
},
deleteDialog(row) {
this.$confirm("此操作将永久删除该单据, 是否继续?", "提示", {
deleteDialog(_this,row) {
_this.$confirm("此操作将永久删除该单据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
@ -409,16 +663,16 @@ export default {
.then(() => {
delApply(row.id)
.then((response) => {
this.loading = false;
_this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
this.getList();
_this.$message.success("删除成功");
_this.getList();
} else {
this.$message.error(response.message);
_this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
_this.loading = false;
});
})
@ -437,54 +691,56 @@ export default {
},
newDistributionForm(index, row) {
console.log(this.idQuery)
this.idQuery.id = '';
if (this.$isNotBlank(row) && this.$isNotBlank(row.id)) {
this.idQuery.id = row.id;
this.idQuery.formData = row;
this.formName = "update";
newDistributionForm(_this, row) {
if(_this == null){
_this = this
}
_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;
_this.formName = "add";
_this.newSpDistributionVisible = true;
},
getCurInvCode() {
},
getCurInvList() {
getInvListByUser()
getCurInvList(_this) {
getInvListByUserOptimize()
.then((response) => {
this.invList = response.data || [];
_this.options.getCurInvList = response.data || [];
})
.catch(() => {
});
},
getInvList() {
getInvList(_this) {
var query = {
parentId: this.filterQuery.targetDeptCode,
parentId: _this.filterQuery.targetDeptCode,
spUse: true,
}
this.filterQuery.targetInvCode = null
this.$forceUpdate()
filterGroupBySpuse(query).then((res) => {
this.targetInvList = res.data || [];
_this.filterQuery.targetInvCode = null
_this.$forceUpdate()
filterGroupBySpuseOptimize(query).then((res) => {
_this.options.getInvList = res.data || [];
})
},
getDeptList() {
getDeptList(_this) {
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
filterDeptsOptimize(query).then((res) => {
_this.options.getDeptList = res.data || [];
if (_this.options.getDeptList.length > 0) {
_this.filterQuery.targetDeptCode = _this.options.getDeptList[0].code
_this.invCodebe = _this.filterQuery.targetDeptCode
}
this.getList();
this.getInvList();
_this.getList();
_this.getInvList();
});
},
initActDateRange() {
@ -493,6 +749,15 @@ export default {
let start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.actDateRange = [start, end];
},
executeFuc(row,type,clickFuc,value){
return executeFuc(this,row,type,clickFuc,value);
},
executeEval(row,expression,defaultRet){
if(expression){
return eval(expression);
}
return defaultRet;
}
}
@ -516,9 +781,24 @@ export default {
}
,
created() {
getHead("purApply-1","1").then((re) => {
//
this.tableObj = re.data;
this.tableHeader = re.data.tableList;
this.queryList = re.data.queryList;
this.fromList = re.data.fromList;
});
getHead("purApply-2","1").then((re) => {
//
this.tableObj2 = re.data;
this.tableHeader2 = re.data.tableList;
this.queryList2 = re.data.queryList;
this.fromList2 = re.data.fromList;
});
this.initActDateRange()
this.getCurInvList();
this.getDeptList();
this.getCurInvList(this);
this.getDeptList(this);
this.getInvList(this);
}
,
}

@ -1,86 +1,151 @@
<template>
<div>
<el-card class="el-card">
<el-form :model="filterQuery" class="query-form" label-width="100px" 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-form v-if="queryList && queryList.length > 0" :model="filterQuery" class="query-form" label-width="100px" 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.parentId" placeholder="请选择申购部门" style="width: 90%"
@change="getInvList"
>
<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-col :span="8">-->
<!-- <el-form-item label="申购部门">-->
<!-- <el-select v-model="filterQuery.parentId" placeholder="请选择申购部门" style="width: 90%"-->
<!-- @change="getInvList"-->
<!-- >-->
<!-- <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-col :span="8">
<el-form-item label="申购仓库">
<el-select v-model="filterQuery.invCode" @change="getList" style="width: 90%" clearable
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.invCode" @change="getList" style="width: 90%" clearable-->
<!-- 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.targetInvCode" @change="getList" style="width: 90%" clearable
placeholder="请选择到货仓库">
<!-- <el-col :span="8">-->
<!-- <el-form-item label="到货仓库">-->
<!-- <el-select v-model="filterQuery.targetInvCode" @change="getList" style="width: 90%" clearable-->
<!-- placeholder="请选择到货仓库">-->
<!-- <el-option-->
<!-- v-for="item in targetInvList"-->
<!-- :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="紧急程度:" prop="emergency">-->
<!-- <el-select v-model="filterQuery.emergency" placeholder="请选择紧急程度" style="width: 90%" 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-col :span="8">-->
<!-- <el-form-item label="创建时间:">-->
<!-- <el-date-picker-->
<!-- :picker-options="pickerOptions"-->
<!-- v-model="actDateRange"-->
<!-- 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-row style=" display:flex; flex-wrap: wrap; ">
<template v-for="(item, index) in queryList" >
<el-form-item v-if="item.columnType == 'input' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`" :key="item.id">
<el-input
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
@keyup.enter.native="executeFuc($event,'5',item.clickFuc)"
clearable
></el-input>
</el-form-item>
<el-form-item v-if="item.columnType == 'select' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-select v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
clearable>
<el-option
v-for="item in targetInvList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
v-for="dict in item.lableRuleObj"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="紧急程度:" prop="emergency">
<el-select v-model="filterQuery.emergency" placeholder="请选择紧急程度" style="width: 90%" clearable>
<el-option label="正常" :value=1></el-option>
<el-option label="较急" :value=2></el-option>
<el-option label="特急" :value=3></el-option>
<el-form-item v-if="item.columnType == 'selectServer' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-select
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
filterable
remote
:remote-method="(query) => executeFuc(query,'5',item.clickFuc)"
clearable>
<el-option
v-for="item in options[item.clickFuc]"
:key="item.code"
:label="item.label"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="创建时间:">
<el-form-item v-if="item.columnType == 'datePicker' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-date-picker
:picker-options="pickerOptions"
v-model="actDateRange"
type="daterange"
format="yyyy 年 MM 月 dd 日"
style="width: 90%"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
></el-date-picker>
</el-form-item>
</el-col>
<el-form-item v-if="item.columnType == 'date' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-date-picker
v-model="filterQuery[item.columnName]"
:style="`width:${item.width+'px'}`"
value-format="yyyy-MM-dd"
:disabled="executeEval(null,item.disabledFuc,false)"
type="date"
:placeholder="item.columnDesc"
></el-date-picker>
</el-form-item>
</template>
</el-row>
</el-form>
@ -95,37 +160,124 @@
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row
@current-change="handleDetail"
@current-change="(row) => executeFuc(row,'0',tableObj.handleChangeFuc)"
: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="deptName"></el-table-column>
<el-table-column label="申购仓库" prop="invName"></el-table-column>
<el-table-column label="到货仓库" prop="targetInvName"></el-table-column>
<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="status">
<template slot-scope="scope">
<el-tag :type="(scope.row.status) | statusFilterType">
{{ statusMap[scope.row.status] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createTime"
sortable="custom" :sort-orders="['ascending', 'descending']"></el-table-column>
<el-table-column label="备注" prop="remark" width="180" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作" width="60px">
<template slot-scope="scope">
<el-button type="text" :disabled="scope.row.status!=2"
@click.native="newDistributionForm(scope.$index, scope.row)">审核
</el-button>
</template>
</el-table-column>
<!-- <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="deptName"></el-table-column>-->
<!-- <el-table-column label="申购仓库" prop="invName"></el-table-column>-->
<!-- <el-table-column label="到货仓库" prop="targetInvName"></el-table-column>-->
<!-- <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="status">-->
<!-- <template slot-scope="scope">-->
<!-- <el-tag :type="(scope.row.status) | statusFilterType">-->
<!-- {{ statusMap[scope.row.status] }}-->
<!-- </el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="创建时间" prop="createTime"-->
<!-- sortable="custom" :sort-orders="['ascending', 'descending']"></el-table-column>-->
<!-- <el-table-column label="备注" prop="remark" width="180" show-overflow-tooltip>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作" width="60px">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button type="text" :disabled="scope.row.status!=2"-->
<!-- @click.native="newDistributionForm(scope.$index, scope.row)">审核-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<template v-for="(item, index) in tableHeader">
<el-table-column
v-if="item.columnType == 'id' && executeEval(row,item.expression,true)"
type="index" :label="item.columnDesc"></el-table-column>
<el-table-column
v-if="item.columnType == 'selection'"
type="selection"
:width="item.width"
:selectable="(row,number) => executeFuc(row,'3',item.clickFuc)"
></el-table-column>
<el-table-column
v-if="item.columnType == 'radio' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-radio :label="scope.row.id" v-model="radioCheck"><span></span></el-radio>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'laber' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item.lableRuleObj[scope.row[item.columnName]])}">{{ item.lableRuleObj[scope.row[item.columnName]] }}</span>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'eltag' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-tag :type="executeFuc(scope.row,'4',item,item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName])">
<span>{{ item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName] }}</span>
</el-tag>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'button' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:width="item.width"
:key="item.columnName"
fixed="right"
>
<template slot-scope="scope">
<el-button v-for="(buttonItem, buttonIndex) in item.buttonRulObj"
:type="buttonItem.type"
:size="buttonItem.size"
:style="buttonItem.style"
:key="buttonItem"
v-if="executeEval(scope.row,buttonItem.hasPermi,true)"
:disabled="executeEval(scope.row,buttonItem.disabledFuc,false)"
@click.native.stop="executeFuc(scope.row,'1',buttonItem.clickFuc)"
>{{ buttonItem.name }}
</el-button>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'text' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item,scope.row[item.columnName])}">{{ scope.row[item.columnName] }}</span>
</template>
</el-table-column>
</template>
</el-table>
<pagination
@ -139,15 +291,102 @@
</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="60"></el-table-column>
<el-table-column label="DI/物资编码" prop="nameCode"></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="measname" show-overflow-tooltip="true" width="100"></el-table-column>
<el-table-column label="申购数量" prop="count"></el-table-column>
<el-table-column label="注册/备案号" prop="zczbhhzbapzbh"></el-table-column>
<el-table-column label="生产厂家" prop="manufactory"></el-table-column>
<el-table-column label="供应商" prop="supName"></el-table-column>
<!-- <el-table-column label="序号" type="index" width="60"></el-table-column>-->
<!-- <el-table-column label="DI/物资编码" prop="nameCode"></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="measname" show-overflow-tooltip="true" width="100"></el-table-column>-->
<!-- <el-table-column label="申购数量" prop="count"></el-table-column>-->
<!-- <el-table-column label="注册/备案号" prop="zczbhhzbapzbh"></el-table-column>-->
<!-- <el-table-column label="生产厂家" prop="manufactory"></el-table-column>-->
<!-- <el-table-column label="供应商" prop="supName"></el-table-column>-->
<template v-for="(item, index) in tableHeader2">
<el-table-column
v-if="item.columnType == 'id' && executeEval(row,item.expression,true)"
type="index" :label="item.columnDesc"></el-table-column>
<el-table-column
v-if="item.columnType == 'selection'"
type="selection"
:width="item.width"
:selectable="(row,number) => executeFuc(row,'3',item.clickFuc)"
></el-table-column>
<el-table-column
v-if="item.columnType == 'radio' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-radio :label="scope.row.id" v-model="radioCheck"><span></span></el-radio>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'laber' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item.lableRuleObj[scope.row[item.columnName]])}">{{ item.lableRuleObj[scope.row[item.columnName]] }}</span>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'eltag' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-tag :type="executeFuc(scope.row,'4',item,item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName])">
<span>{{ item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName] }}</span>
</el-tag>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'button' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:width="item.width"
:key="item.columnName"
fixed="right"
>
<template slot-scope="scope">
<el-button v-for="(buttonItem, buttonIndex) in item.buttonRulObj"
:type="buttonItem.type"
:size="buttonItem.size"
:style="buttonItem.style"
:key="buttonItem"
v-if="executeEval(scope.row,buttonItem.hasPermi,true)"
:disabled="executeEval(scope.row,buttonItem.disabledFuc,false)"
@click.native.stop="executeFuc(scope.row,'1',buttonItem.clickFuc)"
>{{ buttonItem.name }}
</el-button>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'text' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item,scope.row[item.columnName])}">{{ scope.row[item.columnName] }}</span>
</template>
</el-table-column>
</template>
</el-table>
</el-card>
@ -171,9 +410,13 @@
<script>
import pureApplyDetail from "./pureApplyDetailDialog";
import {delApply, auditOrder, listApplyDetail, auditListApply} from "@/api/purchase/purApply";
import {filterAll, getInvListByUser} from "@/api/system/invWarehouse";
import {getDeptListByUser} from "@/api/auth/authDept";
import {filterGroupBySpuse, filterSubAll} from "@/api/system/invSubWarehouse";
import {getInvListByUser} from "@/api/system/invWarehouse";
import {filterDeptsOptimize,getDeptListByUser} from "@/api/auth/authDept";
import {filterGroupBySpuse, filterGroupBySpuseOptimize, filterSubAllOptimize} from "@/api/system/invSubWarehouse";
import {
getHead,executeFuc
} from "@/utils/customConfig";
export default {
data() {
@ -216,6 +459,17 @@ export default {
idQuery: {},
editType: 1,
total: 0,
tableHeader:[],
queryList:[],
fromList:[],
tableHeader2:[],
queryList2:[],
fromList2:[],
options: {
getCurInvList:[],
getDeptList:[],
getInvList:[],
},
thirdSys: [],
invCodebe: null,
thirdSysDetail: null,
@ -336,18 +590,18 @@ export default {
this.total = 0;
});
},
handleDetail(row) {
handleDetail(_this,row) {
let query = {orderIdFk: row.id};
this.loading = true;
_this.loading = true;
listApplyDetail(query) //
.then((response) => {
this.detailList = response.data.list || [];
this.loading = false;
_this.detailList = response.data.list || [];
_this.loading = false;
})
.catch(() => {
this.loading = false;
this.detailList = [];
this.total = 0;
_this.loading = false;
_this.detailList = [];
_this.total = 0;
});
},
submitOrder(row) {
@ -407,47 +661,56 @@ export default {
},
newDistributionForm(index, row) {
this.idQuery.id = '';
if (this.$isNotBlank(row) && this.$isNotBlank(row.id)) {
this.idQuery.id = row.id;
this.idQuery.formData = row;
this.formName = "update";
newDistributionForm(_this, 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;
_this.formName = "add";
_this.newSpDistributionVisible = true;
},
deptChange() {
this.getInvList();
this.getList();
},
getInvList() {
getInvList(_this) {
var query = {
parentId: this.filterQuery.parentId
parentId: _this.filterQuery.parentId
}
this.filterQuery.targetInvCode = null
filterSubAll(query).then((res) => {
this.invList = res.data || [];
_this.filterQuery.targetInvCode = null
filterSubAllOptimize(query).then((res) => {
_this.options.getInvList = res.data || [];
})
},
getDeptList() {
filterAll().then((res) => {
this.deptList = res.data || [];
this.getInvList();
this.getList();
getDeptList(_this) {
filterDeptsOptimize().then((res) => {
_this.options.getDeptList = res.data || [];
_this.getInvList();
_this.getList();
});
},
getCurInvList() {
getCurInvList(_this) {
var query = {
spUse: true,
}
this.filterQuery.targetInvCode = null
this.$forceUpdate()
filterGroupBySpuse(query).then((res) => {
this.targetInvList = res.data || [];
_this.filterQuery.targetInvCode = null
_this.$forceUpdate()
filterGroupBySpuseOptimize(query).then((res) => {
_this.options.getCurInvList = res.data || [];
})
},
executeFuc(row,type,clickFuc,value){
return executeFuc(this,row,type,clickFuc,value);
},
executeEval(row,expression,defaultRet){
if(expression){
return eval(expression);
}
return defaultRet;
}
}
,
components: {
@ -470,12 +733,27 @@ export default {
}
,
created() {
getHead("pureApplyAudit-1","1").then((re) => {
//
this.tableObj = re.data;
this.tableHeader = re.data.tableList;
this.queryList = re.data.queryList;
this.fromList = re.data.fromList;
});
getHead("pureApplyAudit-2","1").then((re) => {
//
this.tableObj2 = re.data;
this.tableHeader2 = re.data.tableList;
this.queryList2 = re.data.queryList;
this.fromList2 = re.data.fromList;
});
let end = new Date();
let start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.actDateRange = [start, end];
this.getDeptList();
this.getCurInvList();
this.getCurInvList(this);
this.getDeptList(this);
this.getInvList(this);
}
,
}

@ -1,99 +1,176 @@
<template>
<div>
<el-card class="el-card">
<el-form :model="filterQuery" class="query-form" label-width="100px" 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-form v-if="queryList && queryList.length > 0" :model="filterQuery" class="query-form" label-width="100px" 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" placeholder="请选择申购仓库" @change="getInvList"-->
<!-- style="width: 90%">-->
<!-- <el-option-->
<!-- v-for="item in invList"-->
<!-- :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-col :span="8">
<el-form-item label="申购仓库:">
<el-select v-model="filterQuery.invCode" placeholder="请选择申购仓库" @change="getInvList"
style="width: 90%">
<!-- <el-col :span="8">-->
<!-- <el-form-item label="到货部门">-->
<!-- <el-select v-model="filterQuery.targetDeptCode" clearable @change="getInvList" 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-col :span="8">-->
<!-- <el-form-item label="到货仓库">-->
<!-- <el-select v-model="filterQuery.targetInvCode" style="width: 90%" clearable placeholder="请选择所属仓库">-->
<!-- <el-option-->
<!-- v-for="item in targetInvList"-->
<!-- :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="紧急程度:" prop="emergency">-->
<!-- <el-select v-model="filterQuery.emergency" placeholder="请选择紧急程度" style="width: 90%" 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-col :span="8">-->
<!-- <el-form-item label="创建时间:">-->
<!-- <el-date-picker-->
<!-- :picker-options="pickerOptions"-->
<!-- v-model="actDateRange"-->
<!-- 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-col :span="8">-->
<!-- <el-form-item label="审核时间:">-->
<!-- <el-date-picker-->
<!-- :picker-options="pickerAuditOptions"-->
<!-- v-model="actAuditDateRange"-->
<!-- 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-row style=" display:flex; flex-wrap: wrap; ">
<template v-for="(item, index) in queryList" >
<el-form-item v-if="item.columnType == 'input' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`" :key="item.id">
<el-input
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
@keyup.enter.native="executeFuc($event,'5',item.clickFuc)"
clearable
></el-input>
</el-form-item>
<el-form-item v-if="item.columnType == 'select' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-select v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
clearable>
<el-option
v-for="item in invList"
:key="item.code"
:label="item.name"
:value="item.code"
>
<span style="float: left">{{ item.name }}</span>
</el-option>
v-for="dict in item.lableRuleObj"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="到货部门">
<el-select v-model="filterQuery.targetDeptCode" clearable @change="getInvList" placeholder="请选择申购部门"
style="width: 90%">
<el-form-item v-if="item.columnType == 'selectServer' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-select
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
filterable
remote
:remote-method="(query) => executeFuc(query,'5',item.clickFuc)"
clearable>
<el-option
v-for="item in deptList"
v-for="item in options[item.clickFuc]"
:key="item.code"
:label="item.name"
:label="item.label"
: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.targetInvCode" style="width: 90%" clearable placeholder="请选择所属仓库">
<el-option
v-for="item in targetInvList"
: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="紧急程度:" prop="emergency">
<el-select v-model="filterQuery.emergency" placeholder="请选择紧急程度" style="width: 90%" 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-col :span="8">
<el-form-item label="创建时间:">
<el-form-item v-if="item.columnType == 'datePicker' && item.columnName == 'actDateRange' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-date-picker
:picker-options="pickerOptions"
v-model="actDateRange"
type="daterange"
format="yyyy 年 MM 月 dd 日"
style="width: 90%"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="审核时间:">
<el-form-item v-if="item.columnType == 'datePicker' && item.columnName == 'actAuditDateRange' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-date-picker
:picker-options="pickerAuditOptions"
:picker-options="pickerOptions"
v-model="actAuditDateRange"
type="daterange"
format="yyyy 年 MM 月 dd 日"
style="width: 90%"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
></el-date-picker>
</el-form-item>
</el-col>
<el-form-item v-if="item.columnType == 'date' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-date-picker
v-model="filterQuery[item.columnName]"
:style="`width:${item.width+'px'}`"
value-format="yyyy-MM-dd"
:disabled="executeEval(null,item.disabledFuc,false)"
type="date"
:placeholder="item.columnDesc"
></el-date-picker>
</el-form-item>
</template>
</el-row>
</el-form>
@ -107,39 +184,126 @@
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row
@current-change="handleDetail"
@current-change="(row) => executeFuc(row,'0',tableObj.handleChangeFuc)"
: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="invName"></el-table-column>
<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="createTime"
sortable="custom" :sort-orders="['ascending', 'descending']"></el-table-column>
<el-table-column label="审核时间" prop="auditTime"
sortable="custom" :sort-orders="['ascending', 'descending']"></el-table-column>
<el-table-column label="审核人" prop="auditByName"></el-table-column>
<!-- <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="invName"></el-table-column>-->
<!-- <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="createTime"-->
<!-- sortable="custom" :sort-orders="['ascending', 'descending']"></el-table-column>-->
<!-- <el-table-column label="审核时间" prop="auditTime"-->
<!-- sortable="custom" :sort-orders="['ascending', 'descending']"></el-table-column>-->
<!-- <el-table-column label="审核人" prop="auditByName"></el-table-column>-->
<el-table-column label="审核状态" prop="status">
<template slot-scope="scope">
<el-tag :type="(scope.row.status) | statusFilterType">
{{ statusMap[scope.row.status] }}
</el-tag>
</template>
</el-table-column>
<!-- <el-table-column label="审核状态" prop="status">-->
<!-- <template slot-scope="scope">-->
<!-- <el-tag :type="(scope.row.status) | statusFilterType">-->
<!-- {{ statusMap[scope.row.status] }}-->
<!-- </el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" width="90">
<template slot-scope="scope">
<el-button type="text" size="small" @click.native.stop="printOrder(scope.row)">打印</el-button>
<el-button type="text" @click.native.stop="deleteDialog(scope.row)">删除</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="操作" width="90">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button type="text" size="small" @click.native.stop="printOrder(scope.row)">打印</el-button>-->
<!-- <el-button type="text" @click.native.stop="deleteDialog(scope.row)">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<template v-for="(item, index) in tableHeader">
<el-table-column
v-if="item.columnType == 'id' && executeEval(row,item.expression,true)"
type="index" :label="item.columnDesc"></el-table-column>
<el-table-column
v-if="item.columnType == 'selection'"
type="selection"
:width="item.width"
:selectable="(row,number) => executeFuc(row,'3',item.clickFuc)"
></el-table-column>
<el-table-column
v-if="item.columnType == 'radio' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-radio :label="scope.row.id" v-model="radioCheck"><span></span></el-radio>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'laber' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item.lableRuleObj[scope.row[item.columnName]])}">{{ item.lableRuleObj[scope.row[item.columnName]] }}</span>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'eltag' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-tag :type="executeFuc(scope.row,'4',item,item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName])">
<span>{{ item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName] }}</span>
</el-tag>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'button' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:width="item.width"
:key="item.columnName"
fixed="right"
>
<template slot-scope="scope">
<el-button v-for="(buttonItem, buttonIndex) in item.buttonRulObj"
:type="buttonItem.type"
:size="buttonItem.size"
:style="buttonItem.style"
:key="buttonItem"
v-if="executeEval(scope.row,buttonItem.hasPermi,true)"
:disabled="executeEval(scope.row,buttonItem.disabledFuc,false)"
@click.native.stop="executeFuc(scope.row,'1',buttonItem.clickFuc)"
>{{ buttonItem.name }}
</el-button>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'text' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item,scope.row[item.columnName])}">{{ scope.row[item.columnName] }}</span>
</template>
</el-table-column>
</template>
</el-table>
<pagination
@ -153,15 +317,102 @@
</el-card>
<el-card class="el-card">
<el-table v-loading="loading" :data="detailList" style="width: 100%" border>
<el-table-column label="序号" type="index" width="60"></el-table-column>
<el-table-column label="DI/物资编码" prop="nameCode"></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="measname" show-overflow-tooltip="true" width="100"></el-table-column>
<el-table-column label="申购数量" prop="count"></el-table-column>
<el-table-column label="注册/备案号" prop="zczbhhzbapzbh"></el-table-column>
<el-table-column label="生产厂家" prop="manufactory"></el-table-column>
<el-table-column label="供应商" prop="supName"></el-table-column>
<!-- <el-table-column label="序号" type="index" width="60"></el-table-column>-->
<!-- <el-table-column label="DI/物资编码" prop="nameCode"></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="measname" show-overflow-tooltip="true" width="100"></el-table-column>-->
<!-- <el-table-column label="申购数量" prop="count"></el-table-column>-->
<!-- <el-table-column label="注册/备案号" prop="zczbhhzbapzbh"></el-table-column>-->
<!-- <el-table-column label="生产厂家" prop="manufactory"></el-table-column>-->
<!-- <el-table-column label="供应商" prop="supName"></el-table-column>-->
<template v-for="(item, index) in tableHeader2">
<el-table-column
v-if="item.columnType == 'id' && executeEval(row,item.expression,true)"
type="index" :label="item.columnDesc"></el-table-column>
<el-table-column
v-if="item.columnType == 'selection'"
type="selection"
:width="item.width"
:selectable="(row,number) => executeFuc(row,'3',item.clickFuc)"
></el-table-column>
<el-table-column
v-if="item.columnType == 'radio' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-radio :label="scope.row.id" v-model="radioCheck"><span></span></el-radio>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'laber' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item.lableRuleObj[scope.row[item.columnName]])}">{{ item.lableRuleObj[scope.row[item.columnName]] }}</span>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'eltag' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-tag :type="executeFuc(scope.row,'4',item,item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName])">
<span>{{ item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName] }}</span>
</el-tag>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'button' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:width="item.width"
:key="item.columnName"
fixed="right"
>
<template slot-scope="scope">
<el-button v-for="(buttonItem, buttonIndex) in item.buttonRulObj"
:type="buttonItem.type"
:size="buttonItem.size"
:style="buttonItem.style"
:key="buttonItem"
v-if="executeEval(scope.row,buttonItem.hasPermi,true)"
:disabled="executeEval(scope.row,buttonItem.disabledFuc,false)"
@click.native.stop="executeFuc(scope.row,'1',buttonItem.clickFuc)"
>{{ buttonItem.name }}
</el-button>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'text' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item,scope.row[item.columnName])}">{{ scope.row[item.columnName] }}</span>
</template>
</el-table-column>
</template>
</el-table>
</el-card>
@ -186,9 +437,13 @@
<script>
import pureApplyDetail from "./pureApplyDetailDialog";
import {delApply, auditOrder, listApplyDetail, auditListApply, listApply, printOrder} from "@/api/purchase/purApply";
import {getInvListByUser} from "@/api/system/invWarehouse";
import {filterDepts, getDeptListByUser} from "@/api/auth/authDept";
import {filterSubAll} from "@/api/system/invSubWarehouse";
import {getInvListByUser, getInvListByUserOptimize} from "@/api/system/invWarehouse";
import {filterDeptsOptimize, getDeptListByUser} from "@/api/auth/authDept";
import {filterSubAllOptimize} from "@/api/system/invSubWarehouse";
import {
getHead,executeFuc
} from "@/utils/customConfig";
export default {
data() {
@ -228,6 +483,17 @@ export default {
idQuery: {},
editType: 2,
total: 0,
tableHeader:[],
queryList:[],
fromList:[],
tableHeader2:[],
queryList2:[],
fromList2:[],
options: {
getCurInvList:[],
getDeptList:[],
getInvList:[],
},
thirdSys: [],
invCodebe: null,
thirdSysDetail: null,
@ -391,18 +657,18 @@ export default {
this.total = 0;
});
},
handleDetail(row) {
handleDetail(_this,row) {
let query = {orderIdFk: row.id};
this.loading = true;
_this.loading = true;
listApplyDetail(query) //
.then((response) => {
this.detailList = response.data.list || [];
this.loading = false;
_this.detailList = response.data.list || [];
_this.loading = false;
})
.catch(() => {
this.loading = false;
this.detailList = [];
this.total = 0;
_this.loading = false;
_this.detailList = [];
_this.total = 0;
});
},
submitOrder(row) {
@ -425,7 +691,7 @@ export default {
this.loading = false;
})
},
deleteDialog(row) {
deleteDialog(_this,row) {
this.$confirm("此操作将永久删除该单据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@ -434,16 +700,16 @@ export default {
.then(() => {
delApply(row.id)
.then((response) => {
this.loading = false;
_this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
this.getList();
_this.$message.success("删除成功");
_this.getList();
} else {
this.$message.error(response.message);
_this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
_this.loading = false;
});
})
@ -460,48 +726,48 @@ export default {
this.getList();
this.detailList = [];
},
getCurInvList() {
getInvListByUser()
getCurInvList(_this) {
getInvListByUserOptimize()
.then((response) => {
this.invList = response.data || [];
_this.options.getCurInvList = response.data || [];
})
.catch(() => {
});
},
newDistributionForm(index, row) {
this.idQuery.id = '';
if (this.$isNotBlank(row) && this.$isNotBlank(row.id)) {
this.idQuery.id = row.id;
this.idQuery.formData = row;
this.formName = "update";
newDistributionForm(_this, 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;
_this.formName = "add";
_this.newSpDistributionVisible = true;
},
getInvList() {
getInvList(_this) {
var query = {
parentId: this.filterQuery.targetDeptCode
parentId: _this.filterQuery.targetDeptCode
}
filterSubAll(query).then((res) => {
this.targetInvList = res.data || [];
filterSubAllOptimize(query).then((res) => {
_this.options.getInvList = res.data || [];
})
},
getDeptList() {
getDeptList(_this) {
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
filterDeptsOptimize(query).then((res) => {
_this.options.getDeptList = res.data || [];
if (_this.deptList.length > 0) {
_this.filterQuery.targetDeptCode = _this.deptList[0].code
_this.invCodebe = _this.filterQuery.targetDeptCode
}
this.getList();
this.getInvList();
_this.getList();
_this.getInvList();
});
},
printOrder(row) {
printOrder(_this,row) {
printOrder(row)
.then((response) => {
const binaryData = [];
@ -510,14 +776,22 @@ export default {
let url = window.URL.createObjectURL(
new Blob(binaryData, {type: "application/pdf"})
);
this.loading = false;
_this.loading = false;
window.open(url);//pdf
this.getList();
_this.getList();
})
.catch(() => {
});
},
executeFuc(row,type,clickFuc,value){
return executeFuc(this,row,type,clickFuc,value);
},
executeEval(row,expression,defaultRet){
if(expression){
return eval(expression);
}
return defaultRet;
}
}
,
components: {
@ -540,8 +814,23 @@ export default {
}
,
created() {
this.getDeptList();
this.getCurInvList();
getHead("pureApplyMySearch-1","1").then((re) => {
//
this.tableObj = re.data;
this.tableHeader = re.data.tableList;
this.queryList = re.data.queryList;
this.fromList = re.data.fromList;
});
getHead("pureApplyMySearch-2","1").then((re) => {
//
this.tableObj2 = re.data;
this.tableHeader2 = re.data.tableList;
this.queryList2 = re.data.queryList;
this.fromList2 = re.data.fromList;
});
this.getCurInvList(this);
this.getDeptList(this);
this.getInvList(this);
}
,
}

@ -1,97 +1,174 @@
<template>
<div>
<el-card class="el-card">
<el-form :model="filterQuery" class="query-form" label-width="100px" 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-form v-if="queryList && queryList.length > 0" :model="filterQuery" class="query-form" label-width="100px" 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.deptCode" clearable @change="getInvList" 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-col :span="8">-->
<!-- <el-form-item label="申购部门:">-->
<!-- <el-select v-model="filterQuery.deptCode" clearable @change="getInvList" 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-col :span="8">-->
<!-- <el-form-item label="申购仓库:">-->
<!-- <el-select v-model="filterQuery.invCode" style="width: 90%" clearable 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.targetInvCode" @change="getList" style="width: 90%" clearable-->
<!-- placeholder="请选择到货仓库">-->
<!-- <el-option-->
<!-- v-for="item in targetInvList"-->
<!-- :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="紧急程度:" prop="emergency">-->
<!-- <el-select v-model="filterQuery.emergency" placeholder="请选择紧急程度" style="width: 90%" 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-col :span="8">-->
<!-- <el-form-item label="创建时间:">-->
<!-- <el-date-picker-->
<!-- :picker-options="pickerOptions"-->
<!-- v-model="actDateRange"-->
<!-- 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-col :span="8">-->
<!-- <el-form-item label="审核时间:">-->
<!-- <el-date-picker-->
<!-- :picker-options="pickerAuditOptions"-->
<!-- v-model="actAuditDateRange"-->
<!-- 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-row style=" display:flex; flex-wrap: wrap; ">
<template v-for="(item, index) in queryList" >
<el-form-item v-if="item.columnType == 'input' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`" :key="item.id">
<el-input
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
@keyup.enter.native="executeFuc($event,'5',item.clickFuc)"
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%" clearable placeholder="请选择所属仓库">
<el-form-item v-if="item.columnType == 'select' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-select v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
clearable>
<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>
v-for="dict in item.lableRuleObj"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="到货仓库">
<el-select v-model="filterQuery.targetInvCode" @change="getList" style="width: 90%" clearable
placeholder="请选择到货仓库">
<el-form-item v-if="item.columnType == 'selectServer' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-select
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
filterable
remote
:remote-method="(query) => executeFuc(query,'5',item.clickFuc)"
clearable>
<el-option
v-for="item in targetInvList"
: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="紧急程度:" prop="emergency">
<el-select v-model="filterQuery.emergency" placeholder="请选择紧急程度" style="width: 90%" clearable>
<el-option label="正常" :value=1></el-option>
<el-option label="较急" :value=2></el-option>
<el-option label="特急" :value=3></el-option>
v-for="item in options[item.clickFuc]"
:key="item.code"
:label="item.label"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="创建时间:">
<el-form-item v-if="item.columnType == 'datePicker' && item.columnName == 'actDateRange' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-date-picker
:picker-options="pickerOptions"
v-model="actDateRange"
type="daterange"
format="yyyy 年 MM 月 dd 日"
style="width: 90%"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="审核时间:">
<el-form-item v-if="item.columnType == 'datePicker' && item.columnName == 'actAuditDateRange' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-date-picker
:picker-options="pickerAuditOptions"
:picker-options="pickerOptions"
v-model="actAuditDateRange"
type="daterange"
format="yyyy 年 MM 月 dd 日"
style="width: 90%"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
></el-date-picker>
</el-form-item>
</el-col>
<el-form-item v-if="item.columnType == 'date' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-date-picker
v-model="filterQuery[item.columnName]"
:style="`width:${item.width+'px'}`"
value-format="yyyy-MM-dd"
:disabled="executeEval(null,item.disabledFuc,false)"
type="date"
:placeholder="item.columnDesc"
></el-date-picker>
</el-form-item>
</template>
</el-row>
</el-form>
@ -105,39 +182,126 @@
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row
@current-change="handleDetail"
@current-change="(row) => executeFuc(row,'0',tableObj.handleChangeFuc)"
: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="invName"></el-table-column>
<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="createTime"
sortable="custom" :sort-orders="['ascending', 'descending']"></el-table-column>
<el-table-column label="审核时间" prop="auditTime"
sortable="custom" :sort-orders="['ascending', 'descending']"></el-table-column>
<el-table-column label="审核人" prop="auditByName"></el-table-column>
<!-- <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="invName"></el-table-column>-->
<!-- <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="createTime"-->
<!-- sortable="custom" :sort-orders="['ascending', 'descending']"></el-table-column>-->
<!-- <el-table-column label="审核时间" prop="auditTime"-->
<!-- sortable="custom" :sort-orders="['ascending', 'descending']"></el-table-column>-->
<!-- <el-table-column label="审核人" prop="auditByName"></el-table-column>-->
<el-table-column label="审核状态" prop="status">
<template slot-scope="scope">
<el-tag :type="(scope.row.status) | statusFilterType">
{{ statusMap[scope.row.status] }}
</el-tag>
</template>
</el-table-column>
<!-- <el-table-column label="审核状态" prop="status">-->
<!-- <template slot-scope="scope">-->
<!-- <el-tag :type="(scope.row.status) | statusFilterType">-->
<!-- {{ statusMap[scope.row.status] }}-->
<!-- </el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" width="90">
<template slot-scope="scope">
<el-button type="text" size="small" @click.native.stop="printOrder(scope.row)">打印</el-button>
<el-button type="text" @click.native.stop="deleteDialog(scope.row)">删除</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="操作" width="90">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button type="text" size="small" @click.native.stop="printOrder(scope.row)">打印</el-button>-->
<!-- <el-button type="text" @click.native.stop="deleteDialog(scope.row)">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<template v-for="(item, index) in tableHeader">
<el-table-column
v-if="item.columnType == 'id' && executeEval(row,item.expression,true)"
type="index" :label="item.columnDesc"></el-table-column>
<el-table-column
v-if="item.columnType == 'selection'"
type="selection"
:width="item.width"
:selectable="(row,number) => executeFuc(row,'3',item.clickFuc)"
></el-table-column>
<el-table-column
v-if="item.columnType == 'radio' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-radio :label="scope.row.id" v-model="radioCheck"><span></span></el-radio>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'laber' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item.lableRuleObj[scope.row[item.columnName]])}">{{ item.lableRuleObj[scope.row[item.columnName]] }}</span>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'eltag' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-tag :type="executeFuc(scope.row,'4',item,item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName])">
<span>{{ item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName] }}</span>
</el-tag>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'button' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:width="item.width"
:key="item.columnName"
fixed="right"
>
<template slot-scope="scope">
<el-button v-for="(buttonItem, buttonIndex) in item.buttonRulObj"
:type="buttonItem.type"
:size="buttonItem.size"
:style="buttonItem.style"
:key="buttonItem"
v-if="executeEval(scope.row,buttonItem.hasPermi,true)"
:disabled="executeEval(scope.row,buttonItem.disabledFuc,false)"
@click.native.stop="executeFuc(scope.row,'1',buttonItem.clickFuc)"
>{{ buttonItem.name }}
</el-button>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'text' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item,scope.row[item.columnName])}">{{ scope.row[item.columnName] }}</span>
</template>
</el-table-column>
</template>
</el-table>
<pagination
@ -151,15 +315,102 @@
</el-card>
<el-card class="el-card">
<el-table v-loading="loading" :data="detailList" style="width: 100%" border>
<el-table-column label="序号" type="index" width="60"></el-table-column>
<el-table-column label="DI/物资编码" prop="nameCode"></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="measname" show-overflow-tooltip="true" width="100"></el-table-column>
<el-table-column label="申购数量" prop="count"></el-table-column>
<el-table-column label="注册/备案号" prop="zczbhhzbapzbh"></el-table-column>
<el-table-column label="生产厂家" prop="manufactory"></el-table-column>
<el-table-column label="供应商" prop="supName"></el-table-column>
<!-- <el-table-column label="序号" type="index" width="60"></el-table-column>-->
<!-- <el-table-column label="DI/物资编码" prop="nameCode"></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="measname" show-overflow-tooltip="true" width="100"></el-table-column>-->
<!-- <el-table-column label="申购数量" prop="count"></el-table-column>-->
<!-- <el-table-column label="注册/备案号" prop="zczbhhzbapzbh"></el-table-column>-->
<!-- <el-table-column label="生产厂家" prop="manufactory"></el-table-column>-->
<!-- <el-table-column label="供应商" prop="supName"></el-table-column>-->
<template v-for="(item, index) in tableHeader2">
<el-table-column
v-if="item.columnType == 'id' && executeEval(row,item.expression,true)"
type="index" :label="item.columnDesc"></el-table-column>
<el-table-column
v-if="item.columnType == 'selection'"
type="selection"
:width="item.width"
:selectable="(row,number) => executeFuc(row,'3',item.clickFuc)"
></el-table-column>
<el-table-column
v-if="item.columnType == 'radio' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-radio :label="scope.row.id" v-model="radioCheck"><span></span></el-radio>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'laber' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item.lableRuleObj[scope.row[item.columnName]])}">{{ item.lableRuleObj[scope.row[item.columnName]] }}</span>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'eltag' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-tag :type="executeFuc(scope.row,'4',item,item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName])">
<span>{{ item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName] }}</span>
</el-tag>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'button' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:width="item.width"
:key="item.columnName"
fixed="right"
>
<template slot-scope="scope">
<el-button v-for="(buttonItem, buttonIndex) in item.buttonRulObj"
:type="buttonItem.type"
:size="buttonItem.size"
:style="buttonItem.style"
:key="buttonItem"
v-if="executeEval(scope.row,buttonItem.hasPermi,true)"
:disabled="executeEval(scope.row,buttonItem.disabledFuc,false)"
@click.native.stop="executeFuc(scope.row,'1',buttonItem.clickFuc)"
>{{ buttonItem.name }}
</el-button>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'text' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item,scope.row[item.columnName])}">{{ scope.row[item.columnName] }}</span>
</template>
</el-table-column>
</template>
</el-table>
</el-card>
@ -185,8 +436,14 @@
import pureApplyDetail from "./pureApplyDetailDialog";
import {delApply, auditOrder, listApplyDetail, auditListApply, printOrder} from "@/api/purchase/purApply";
import {filterAll, getInvListByUser} from "@/api/system/invWarehouse";
import {getDeptListByUser} from "@/api/auth/authDept";
import {filterGroupBySpuse, filterSubAll} from "@/api/system/invSubWarehouse";
import {filterDeptsOptimize, getDeptListByUser} from "@/api/auth/authDept";
import {
filterGroupBySpuse,
filterGroupBySpuseOptimize,
filterSubAll,
filterSubAllOptimize
} from "@/api/system/invSubWarehouse";
import {executeFuc, getHead} from "@/utils/customConfig";
export default {
data() {
@ -226,6 +483,17 @@ export default {
idQuery: {},
editType: 2,
total: 0,
tableHeader:[],
queryList:[],
fromList:[],
tableHeader2:[],
queryList2:[],
fromList2:[],
options: {
getCurInvList:[],
getDeptList:[],
getInvList:[],
},
thirdSys: [],
invCodebe: null,
thirdSysDetail: null,
@ -388,18 +656,18 @@ export default {
this.total = 0;
});
},
handleDetail(row) {
handleDetail(_this,row) {
let query = {orderIdFk: row.id};
this.loading = true;
_this.loading = true;
listApplyDetail(query) //
.then((response) => {
this.detailList = response.data.list || [];
this.loading = false;
_this.detailList = response.data.list || [];
_this.loading = false;
})
.catch(() => {
this.loading = false;
this.detailList = [];
this.total = 0;
_this.loading = false;
_this.detailList = [];
_this.total = 0;
});
},
submitOrder(row) {
@ -422,8 +690,8 @@ export default {
this.loading = false;
})
},
deleteDialog(row) {
this.$confirm("此操作将永久删除该单据, 是否继续?", "提示", {
deleteDialog(_this,row) {
_this.$confirm("此操作将永久删除该单据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
@ -431,16 +699,16 @@ export default {
.then(() => {
delApply(row.id)
.then((response) => {
this.loading = false;
_this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
this.getList();
_this.$message.success("删除成功");
_this.getList();
} else {
this.$message.error(response.message);
_this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
_this.loading = false;
});
})
@ -457,7 +725,7 @@ export default {
this.getList();
this.detailList = [];
},
printOrder(row) {
printOrder(_this,row) {
printOrder(row)
.then((response) => {
const binaryData = [];
@ -466,55 +734,64 @@ export default {
let url = window.URL.createObjectURL(
new Blob(binaryData, {type: "application/pdf"})
);
this.loading = false;
_this.loading = false;
window.open(url);//pdf
this.getList();
_this.getList();
})
.catch(() => {
});
},
newDistributionForm(index, row) {
this.idQuery.id = '';
if (this.$isNotBlank(row) && this.$isNotBlank(row.id)) {
this.idQuery.id = row.id;
this.idQuery.formData = row;
this.formName = "update";
newDistributionForm(_this, 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;
_this.formName = "add";
_this.newSpDistributionVisible = true;
},
getInvList() {
getInvList(_this) {
var query = {
parentId: this.filterQuery.targetDeptCode
}
filterSubAll(query).then((res) => {
this.invList = res.data || [];
filterSubAllOptimize(query).then((res) => {
_this.options.getInvList = res.data || [];
})
},
getDeptList() {
filterAll().then((res) => {
this.deptList = res.data || [];
if (this.deptList.length > 0) {
getDeptList(_this) {
filterDeptsOptimize().then((res) => {
_this.options.getDeptList = res.data || [];
if (_this.options.getDeptList.length > 0) {
//
// this.filterQuery.deptCode = this.deptList[0].code
this.invCodebe = this.filterQuery.deptCode
_this.invCodebe = _this.filterQuery.deptCode
}
this.getList();
this.getInvList();
_this.getList();
_this.getInvList();
});
},
getCurInvList() {
getCurInvList(_this) {
var query = {
spUse: true,
}
this.filterQuery.targetInvCode = null
this.$forceUpdate()
filterGroupBySpuse(query).then((res) => {
this.targetInvList = res.data || [];
_this.filterQuery.targetInvCode = null
_this.$forceUpdate()
filterGroupBySpuseOptimize(query).then((res) => {
_this.options.getCurInvList = res.data || [];
})
},
executeFuc(row,type,clickFuc,value){
return executeFuc(this,row,type,clickFuc,value);
},
executeEval(row,expression,defaultRet){
if(expression){
return eval(expression);
}
return defaultRet;
}
}
,
components: {
@ -537,8 +814,23 @@ export default {
}
,
created() {
this.getDeptList();
this.getCurInvList();
getHead("pureApplySearch-1","1").then((re) => {
//
this.tableObj = re.data;
this.tableHeader = re.data.tableList;
this.queryList = re.data.queryList;
this.fromList = re.data.fromList;
});
getHead("pureApplySearch-2","1").then((re) => {
//
this.tableObj2 = re.data;
this.tableHeader2 = re.data.tableList;
this.queryList2 = re.data.queryList;
this.fromList2 = re.data.fromList;
});
this.getCurInvList(this);
this.getDeptList(this);
this.getInvList(this);
}
,

Loading…
Cancel
Save