在用配件,在修工程
This commit is contained in:
parent
1f9fb47860
commit
1544db731f
|
|
@ -36,6 +36,15 @@ export function getSltInfo(params){
|
|||
})
|
||||
}
|
||||
|
||||
// 查询材料站结算待审核详情(仅需 sltApplyCode)
|
||||
export function getClzSettledInfo(sltApplyCode) {
|
||||
return request({
|
||||
url: '/material/material_sltAgreementInfo/getSettledInfo',
|
||||
method: 'get',
|
||||
params: { sltApplyCode }
|
||||
})
|
||||
}
|
||||
|
||||
// 查询材料站费用结算申请详情
|
||||
export function getClzSltInfo(params){
|
||||
return request({
|
||||
|
|
@ -119,6 +128,15 @@ export function getSltList(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询材料站的结算审批列表
|
||||
export function getClzSltList(query) {
|
||||
return request({
|
||||
url: '/material/material_sltAgreementInfo/getSltList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询已结算报表列表
|
||||
export function getSltReportedList(params){
|
||||
return request({
|
||||
|
|
@ -137,6 +155,15 @@ export function costExamine(params){
|
|||
})
|
||||
}
|
||||
|
||||
// 材料站结算审批提交
|
||||
export function clzCostExamine(params){
|
||||
return request({
|
||||
url: '/material/material_sltAgreementInfo/costExamine',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 查询减免费用列表
|
||||
export function getReliefList(query) {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -193,6 +193,15 @@ export function getAllUsDetailsApi(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询配件使用查询列表
|
||||
export function getPartUsingListApi(query) {
|
||||
return request({
|
||||
url: '/material/repair/getPartUsingList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,334 @@
|
|||
<template>
|
||||
<div class="app-container" id="">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item prop="time">
|
||||
<el-date-picker
|
||||
v-model="queryParams.time"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 240px"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="unitId">
|
||||
<treeselect
|
||||
v-model="queryParams.unitId"
|
||||
:options="unitList" :normalizer="normalizer"
|
||||
:show-count="true" style="width: 240px" :disable-branch-nodes="true"
|
||||
noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果"
|
||||
placeholder="请选择退料单位" @select="unitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="proId">
|
||||
<treeselect
|
||||
v-model="queryParams.proId"
|
||||
:options="proList" :normalizer="normalizer"
|
||||
:show-count="true" style="width: 240px" :disable-branch-nodes="true"
|
||||
noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果"
|
||||
placeholder="请选择退料工程" @select="proChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="keyWord">
|
||||
<el-input
|
||||
v-model="queryParams.keyWord"
|
||||
placeholder="请输入关键字"
|
||||
clearable :maxlength="20"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="handleQuery"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button
|
||||
icon="el-icon-refresh"
|
||||
size="mini"
|
||||
@click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
<el-table v-loading="loading" :data="tableList" border :max-height="650">
|
||||
<el-table-column label="序号" align="center" type="index">
|
||||
<template scope="scope">
|
||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index+1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退料单位" align="center" prop="unitName" width="180px"/>
|
||||
<el-table-column label="退料工程" align="center" prop="projectName" width="220px"/>
|
||||
<el-table-column label="维修单号" align="center" prop="code" width="150px" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="物资名称" align="center" prop="typeModelName" width="120px" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="规格型号" align="center" prop="typeName" width="150px" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="配件名称" align="center" prop="partModelName" width="120px" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="配件规格" align="center" prop="partName" width="150px":show-overflow-tooltip="true"/>
|
||||
<el-table-column label="设备编号" align="center" prop="maCode" width="120px" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="单位" align="center" prop="partUnit" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="使用数量" align="center" prop="partNum" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="单价(元)" align="center" prop="partPrice" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.partPrice.toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额(元)" align="center" prop="partCost" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.partCost.toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="使用班组" align="center" prop="createBy" width="120px" :show-overflow-tooltip="true"/>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getPartUsingListApi,
|
||||
} from '@/api/stquery/stquery';
|
||||
import {
|
||||
getProjectList,
|
||||
getUnitList,
|
||||
} from '@/api/back/index.js'
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
export default {
|
||||
name: 'PartUsing',
|
||||
dicts: [],
|
||||
components: { Treeselect },
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 弹出层标题
|
||||
title: '查看',
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
selectTreeProps: {
|
||||
children: 'children',
|
||||
label: 'name',
|
||||
// multiple: false,
|
||||
value: 'id',
|
||||
// multiple: true,
|
||||
},
|
||||
unitId: null,
|
||||
projectId: null,
|
||||
unitList: [],
|
||||
proList: [],
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 主表格数据
|
||||
tableList: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
time: null,
|
||||
unitId: null,
|
||||
proId: null,
|
||||
keyWord: null,
|
||||
typeName: null, //物资名称
|
||||
statusName: null //状态
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
groupPrintData() {
|
||||
const result = [];
|
||||
for (let i = 0; i < this.printTableData.length; i += 2) {
|
||||
const group = this.printTableData.slice(i, i + 2);
|
||||
// 若分组不足 2 个元素,补充空对象
|
||||
while (group.length < 2) {
|
||||
group.push({ partName: '', status: '' });
|
||||
}
|
||||
result.push(group);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
},
|
||||
created() {
|
||||
const end = new Date()
|
||||
let start = new Date()
|
||||
start.setMonth(start.getMonth() - 1)
|
||||
this.queryParams.time = [this.format(start), this.format(end)]
|
||||
this.initSelectData()
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
format(date) {
|
||||
const y = date.getFullYear()
|
||||
const m = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
return `${y}-${m}-${day}`
|
||||
},
|
||||
|
||||
// 定义格式化日期的方法
|
||||
formatDate(dateStr) {
|
||||
if (!dateStr) return '';
|
||||
const date = new Date(dateStr);
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
|
||||
initSelectData() {
|
||||
this.GetUnitData()
|
||||
this.GetProData()
|
||||
},
|
||||
/** 转换菜单数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children;
|
||||
}
|
||||
return {
|
||||
id: node.id,
|
||||
label: node.name,
|
||||
children: node.children,
|
||||
};
|
||||
},
|
||||
// 获取 来往单位 列表数据
|
||||
async GetUnitData() {
|
||||
const params = {
|
||||
// projectId: this.queryParams.proId /* */,
|
||||
}
|
||||
const res = await getUnitList(params)
|
||||
this.unitList = res.data
|
||||
},
|
||||
unitChange(val){
|
||||
setTimeout(()=>{
|
||||
this.GetProData()
|
||||
},500)
|
||||
},
|
||||
// 获取 工程名称 列表数据
|
||||
async GetProData() {
|
||||
const params = { unitId: this.queryParams.unitId}
|
||||
const res = await getProjectList(params)
|
||||
this.proList = res.data
|
||||
this.queryParams.proId=null
|
||||
},
|
||||
proChange(val){
|
||||
setTimeout(()=>{
|
||||
this.GetUnitData()
|
||||
},500)
|
||||
},
|
||||
|
||||
// 获取列表
|
||||
async getList() {
|
||||
try {
|
||||
this.loading = true
|
||||
const params = {
|
||||
unitId: this.queryParams.unitId,
|
||||
proId: this.queryParams.proId,
|
||||
keyWord: this.queryParams.keyWord,
|
||||
typeName: this.queryParams.typeName,
|
||||
statusName: this.queryParams.statusName,
|
||||
startTime: this.queryParams.time && this.queryParams.time[0],
|
||||
endTime: this.queryParams.time && this.queryParams.time[1],
|
||||
pageSize: this.queryParams.pageSize,
|
||||
pageNum: this.queryParams.pageNum
|
||||
}
|
||||
const res = await getPartUsingListApi(params)
|
||||
this.loading = false
|
||||
if(res.rows.length>0){
|
||||
this.tableList = res.rows;
|
||||
}else{
|
||||
this.tableList=[]
|
||||
}
|
||||
this.total = res.total;
|
||||
} catch (error) {
|
||||
this.loading = false
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
const end = new Date()
|
||||
let start = new Date()
|
||||
start.setMonth(start.getMonth() - 1)
|
||||
this.queryParams.time = [this.format(start), this.format(end)]
|
||||
this.unitId=[]
|
||||
this.projectId=[]
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const formatTime = (date) => {
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
const hours = String(date.getHours()).padStart(2, '0');
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||
return `${year}${month}${day}_${hours}${minutes}${seconds}`;
|
||||
};
|
||||
const params = {
|
||||
unitId: this.queryParams.unitId,
|
||||
proId: this.queryParams.proId,
|
||||
keyWord: this.queryParams.keyWord,
|
||||
typeName: this.queryParams.typeName,
|
||||
statusName: this.queryParams.statusName,
|
||||
startTime: this.queryParams.time && this.queryParams.time[0],
|
||||
endTime: this.queryParams.time && this.queryParams.time[1],
|
||||
pageSize: this.queryParams.pageSize,
|
||||
pageNum: this.queryParams.pageNum
|
||||
}
|
||||
const currentTime = formatTime(new Date());
|
||||
this.download(
|
||||
'material/repair/exportPartUsingList',
|
||||
{
|
||||
...params,
|
||||
},
|
||||
`配件查询_${currentTime}.xlsx`,
|
||||
)
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep.el-table .fixed-width .el-button--mini {
|
||||
width: 60px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.clickText {
|
||||
color: #02a7f0;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,231 @@
|
|||
<template>
|
||||
<div class="app-container" id="">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item prop="time">
|
||||
<el-date-picker
|
||||
v-model="queryParams.time"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 240px"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="keyWord">
|
||||
<el-input
|
||||
v-model="queryParams.keyWord"
|
||||
placeholder="请输入关键字"
|
||||
clearable :maxlength="20"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="handleQuery"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button
|
||||
icon="el-icon-refresh"
|
||||
size="mini"
|
||||
@click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
<el-table v-loading="loading" :data="tableList" border :max-height="650">
|
||||
<el-table-column label="序号" align="center" type="index">
|
||||
<template scope="scope">
|
||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index+1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="维修时间" align="center" prop="repairTime" width="180px":show-overflow-tooltip="true"/>
|
||||
<el-table-column label="维修单号" align="center" prop="repairCode" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="退料单位" align="center" prop="backUnitName" width="180px" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="退料工程" align="center" prop="backProjectName" width="220px"/>
|
||||
<el-table-column label="机具类型" align="center" prop="maTypeName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="机具规格" align="center" prop="maTypeModel" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="机具单位" align="center" prop="unitName" width="100px" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="在修数量" align="center" prop="repairNum" :show-overflow-tooltip="true"/>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getRepairProjectListApi,
|
||||
} from '@/api/repair/repair';
|
||||
|
||||
|
||||
export default {
|
||||
name: 'ProjectRepairing',
|
||||
dicts: [],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 弹出层标题
|
||||
title: '查看',
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
// 主表格数据
|
||||
tableList: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
time: null,
|
||||
keyWord: null,
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
groupPrintData() {
|
||||
const result = [];
|
||||
for (let i = 0; i < this.printTableData.length; i += 2) {
|
||||
const group = this.printTableData.slice(i, i + 2);
|
||||
// 若分组不足 2 个元素,补充空对象
|
||||
while (group.length < 2) {
|
||||
group.push({ partName: '', status: '' });
|
||||
}
|
||||
result.push(group);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
},
|
||||
created() {
|
||||
const end = new Date()
|
||||
let start = new Date()
|
||||
start.setMonth(start.getMonth() - 1)
|
||||
this.queryParams.time = [this.format(start), this.format(end)]
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
format(date) {
|
||||
const y = date.getFullYear()
|
||||
const m = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
return `${y}-${m}-${day}`
|
||||
},
|
||||
|
||||
// 定义格式化日期的方法
|
||||
formatDate(dateStr) {
|
||||
if (!dateStr) return '';
|
||||
const date = new Date(dateStr);
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
|
||||
// 获取列表
|
||||
async getList() {
|
||||
try {
|
||||
this.loading = true
|
||||
const params = {
|
||||
keyWord: this.queryParams.keyWord,
|
||||
startTime: this.queryParams.time && this.queryParams.time[0],
|
||||
endTime: this.queryParams.time && this.queryParams.time[1],
|
||||
pageSize: this.queryParams.pageSize,
|
||||
pageNum: this.queryParams.pageNum
|
||||
}
|
||||
const res = await getRepairProjectListApi(params)
|
||||
this.loading = false
|
||||
if(res.data.rows.length>0){
|
||||
this.tableList = res.data.rows;
|
||||
}else{
|
||||
this.tableList=[]
|
||||
}
|
||||
this.total = res.data.total;
|
||||
} catch (error) {
|
||||
this.loading = false
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
const end = new Date()
|
||||
let start = new Date()
|
||||
start.setMonth(start.getMonth() - 1)
|
||||
this.queryParams.time = [this.format(start), this.format(end)]
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const formatTime = (date) => {
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
const hours = String(date.getHours()).padStart(2, '0');
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||
return `${year}${month}${day}_${hours}${minutes}${seconds}`;
|
||||
};
|
||||
const params = {
|
||||
keyWord: this.queryParams.keyWord,
|
||||
statusName: this.queryParams.statusName,
|
||||
startTime: this.queryParams.time && this.queryParams.time[0],
|
||||
endTime: this.queryParams.time && this.queryParams.time[1],
|
||||
pageSize: this.queryParams.pageSize,
|
||||
pageNum: this.queryParams.pageNum
|
||||
}
|
||||
const currentTime = formatTime(new Date());
|
||||
this.download(
|
||||
'material/repair/exportRepairProjectList',
|
||||
{
|
||||
...params,
|
||||
},
|
||||
`在修工程查询_${currentTime}.xlsx`,
|
||||
)
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep.el-table .fixed-width .el-button--mini {
|
||||
width: 60px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.clickText {
|
||||
color: #02a7f0;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -2,7 +2,74 @@
|
|||
<!-- 基础页面 -->
|
||||
<div class="app-container">
|
||||
<el-form v-show="showSearch" :model="queryParams" ref="queryForm" size="small" inline @submit.native.prevent>
|
||||
<el-form-item label="工程名称" prop="proId">
|
||||
<el-form-item label="分公司" prop="impUnitName">
|
||||
<el-select
|
||||
v-model="queryParams.impUnitName"
|
||||
placeholder="请选择分公司"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 240px"
|
||||
@change="handleImpUnitChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in impUnitOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="项目部" prop="departName">
|
||||
<el-select
|
||||
v-model="queryParams.departName"
|
||||
placeholder="请选择项目部"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 240px"
|
||||
@change="handleDepartChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in departOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="工程" prop="proId">
|
||||
<el-select
|
||||
v-model="queryParams.proId"
|
||||
placeholder="请选择工程"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 240px"
|
||||
@change="getTeamListAndSubUnit"
|
||||
>
|
||||
<el-option v-for="(item, index) in proOptions" :key="index" :label="item.proName" :value="item.proId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="班组名称" prop="teamName">
|
||||
<el-select
|
||||
v-model="queryParams.teamName"
|
||||
placeholder="请选择班组"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in teamOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="工程名称" prop="proId">
|
||||
<el-select
|
||||
v-model="queryParams.proId"
|
||||
placeholder="请选择工程名称"
|
||||
|
|
@ -12,7 +79,7 @@
|
|||
>
|
||||
<el-option v-for="(item, index) in projectList" :key="index" :label="item.proName" :value="item.proId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="关键字" prop="keyWord">
|
||||
<el-input
|
||||
v-model="queryParams.keyWord"
|
||||
|
|
@ -79,7 +146,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getTeamInOrOutInfoApi, getListProject } from '@/api/materialsStation'
|
||||
import { getTeamInOrOutInfoApi, getListProject,getImpUnitListApi, getDepartListByImpUnitApi, getProListByDepartApi, getTeamList, } from '@/api/materialsStation'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -93,10 +160,16 @@ export default {
|
|||
proId: '',
|
||||
startTime: '', // 开始时间
|
||||
endTime: '', // 结束时间
|
||||
impUnitName: null,
|
||||
departName: null,
|
||||
proName: null,
|
||||
teamName: null,
|
||||
},
|
||||
total: 0, // 总条数
|
||||
// 表头
|
||||
tableColumns: [
|
||||
{ label: '分公司', prop: 'impUnitName', unShowTooltip: true },
|
||||
{ label: '项目部', prop: 'departName', unShowTooltip: true },
|
||||
{ label: '工程名称', prop: 'projectName', unShowTooltip: true },
|
||||
{ label: '班组分包名称', prop: 'subcontractor', unShowTooltip: true },
|
||||
{ label: '班组名称', prop: 'teamName' },
|
||||
|
|
@ -107,11 +180,19 @@ export default {
|
|||
],
|
||||
// 表格数据
|
||||
tableList: [],
|
||||
projectList: []
|
||||
projectList: [],
|
||||
impUnitOptions: [], // 分公司下拉
|
||||
departOptions: [], // 项目部下拉
|
||||
proOptions: [], // 工程下拉
|
||||
teamOptions: [], // 班组下拉
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.projectInfoList()
|
||||
async created() {
|
||||
await this.getImpUnitOptions()
|
||||
await this.handleImpUnitChange()
|
||||
await this.handleDepartChange()
|
||||
await this.getTeamListAndSubUnit()
|
||||
await this.getList()
|
||||
},
|
||||
methods: {
|
||||
format(date) {
|
||||
|
|
@ -130,25 +211,122 @@ export default {
|
|||
this.queryParams.keyWord = ''
|
||||
this.queryParams.pageNum = 1
|
||||
this.queryParams.pageSize = 10
|
||||
this.queryParams.impUnitName = null
|
||||
this.queryParams.departName = null
|
||||
this.queryParams.teamName = null
|
||||
this.tableList = []
|
||||
this.getList()
|
||||
},
|
||||
changePro() {
|
||||
this.getList()
|
||||
},
|
||||
/** 工程-下拉选 */
|
||||
async projectInfoList() {
|
||||
|
||||
/** 获取分公司下拉 */
|
||||
async getImpUnitOptions() {
|
||||
try {
|
||||
const res = await getListProject({ unitId: null, isApp: true })
|
||||
if (res.data.length === 0) return
|
||||
this.projectList = res.data
|
||||
this.queryParams.proId = res.data[0].proId
|
||||
console.log('🚀 ~ projectInfoList ~ this.queryParams.proId:', this.queryParams.proId)
|
||||
this.getList()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ projectInfoList ~ error:', error)
|
||||
const res = await getImpUnitListApi() // 调后台接口
|
||||
this.impUnitOptions = res.data.map(item => ({
|
||||
label: item.impUnitName, // 这里根据实际字段替换
|
||||
value: item.impUnitName
|
||||
}))
|
||||
} catch (e) {
|
||||
console.error('获取分公司下拉失败:', e)
|
||||
}
|
||||
},
|
||||
/** 分公司选择变化,加载项目部 */
|
||||
async handleImpUnitChange() {
|
||||
this.queryParams.departName = null // 清空项目部已选
|
||||
this.departOptions = [] // 清空原有下拉
|
||||
|
||||
try {
|
||||
const params = {
|
||||
impUnitName: this.queryParams.impUnitName, // 分公司名称
|
||||
departName: this.queryParams.departName, // 项目部名称
|
||||
proName: this.queryParams.proName,
|
||||
teamName:this.queryParams.teamName,
|
||||
subUnitName:this.queryParams.subUnitName,
|
||||
}
|
||||
const res = await getDepartListByImpUnitApi(params)
|
||||
this.departOptions = res.data.map(item => ({
|
||||
label: item.departName, // 项目部名称字段
|
||||
value: item.departName
|
||||
}))
|
||||
} catch (e) {
|
||||
console.error('获取项目部下拉失败:', e)
|
||||
}
|
||||
},
|
||||
|
||||
// async projectInfoList() {
|
||||
// try {
|
||||
// const res = await getListProject({ unitId: null, isApp: true,impUnit:this.queryParams.impUnitName })
|
||||
// if (res.data.length === 0) return
|
||||
// this.proOptions = res.data
|
||||
// console.log('🚀 ~ projectInfoList ~ this.queryParams.proId:', this.queryParams.proId)
|
||||
// this.getList()
|
||||
// } catch (error) {
|
||||
// console.log('🚀 ~ projectInfoList ~ error:', error)
|
||||
// }
|
||||
// },
|
||||
|
||||
/** 项目部选择变化,加载工程 */
|
||||
async handleDepartChange() {
|
||||
this.queryParams.proId = null // 清空工程已选
|
||||
this.proOptions = [] // 清空原有下拉
|
||||
|
||||
try {
|
||||
// 同时传入分公司和项目部参数
|
||||
const params = {
|
||||
impUnitName: this.queryParams.impUnitName, // 分公司名称
|
||||
departName: this.queryParams.departName,
|
||||
unitId: null, isApp: true,
|
||||
}
|
||||
const res = await getListProject(params)
|
||||
this.proOptions = res.data
|
||||
this.queryParams.proId = res.data[0].proId
|
||||
this.queryParams.proName = res.data[0].proName
|
||||
console.log("zzzzzzzzzzzzzzzzzz",this.queryParams.proName)
|
||||
} catch (e) {
|
||||
console.error('获取工程下拉失败:', e)
|
||||
}
|
||||
},
|
||||
|
||||
async getTeamListAndSubUnit() {
|
||||
this.queryParams.teamName = null // 清空工程已选
|
||||
this.teamOptions = [] // 清空原有下拉
|
||||
console.log("yyyyyyyyyyyyyyyy",this.queryParams.proName)
|
||||
this.queryParams.proName = this.proOptions.find(item => item.proId == this.queryParams.proId)?.proName || null;
|
||||
console.log("Xxxxxxxxxxxxxxxxxxx",this.queryParams.proName)
|
||||
try {
|
||||
// 同时传入分公司和项目部参数
|
||||
const params = {
|
||||
impUnitName: this.queryParams.impUnitName, // 分公司名称
|
||||
departName: this.queryParams.departName, // 项目部名称
|
||||
proName: this.queryParams.proName,
|
||||
teamName:this.queryParams.teamName,
|
||||
}
|
||||
const res = await getTeamList(params)
|
||||
this.teamOptions = res.data.map(item => ({
|
||||
label: item.teamName, // 工程名称字段
|
||||
value: item.teamName
|
||||
}))
|
||||
} catch (e) {
|
||||
console.error('获取班组下拉失败:', e)
|
||||
}
|
||||
},
|
||||
|
||||
// changePro() {
|
||||
// this.getList()
|
||||
// },
|
||||
// /** 工程-下拉选 */
|
||||
// async projectInfoList() {
|
||||
// try {
|
||||
// const res = await getListProject({ unitId: null, isApp: true })
|
||||
// if (res.data.length === 0) return
|
||||
// this.projectList = res.data
|
||||
// this.queryParams.proId = res.data[0].proId
|
||||
// console.log('🚀 ~ projectInfoList ~ this.queryParams.proId:', this.queryParams.proId)
|
||||
// this.getList()
|
||||
// } catch (error) {
|
||||
// console.log('🚀 ~ projectInfoList ~ error:', error)
|
||||
// }
|
||||
// },
|
||||
// 获取列表
|
||||
async getList() {
|
||||
console.log('列表-查询', this.queryParams)
|
||||
|
|
|
|||
|
|
@ -219,7 +219,8 @@ import {
|
|||
equipmentTypeTree,
|
||||
getListsByConfigId,
|
||||
getStandardConfigList,
|
||||
getBmTeamApi
|
||||
getBmTeamApi,
|
||||
getProListByDepartApi
|
||||
} from '@/api/materialsStation'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
|
@ -460,7 +461,7 @@ export default {
|
|||
/** 工程-下拉选 */
|
||||
async projectInfoList() {
|
||||
try {
|
||||
const res = await getListProject({ unitId: null, isApp: true, teamName: this.maForm.teamName })
|
||||
const res = await getProListByDepartApi({ teamName: this.maForm.teamName })
|
||||
this.projectList = res.data
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ projectInfoList ~ error:', error)
|
||||
|
|
@ -469,7 +470,7 @@ export default {
|
|||
async changePro(e) {
|
||||
console.log('🚀 ~ changePro ~ e:', e)
|
||||
this.maForm.proId = e
|
||||
this.maForm.projectId = this.projectList.find(item => item.proId === e)?.projectId
|
||||
this.maForm.projectId = this.projectList.find(item => item.proId == e)?.projectId
|
||||
this.maForm.teamId = ''
|
||||
this.maForm.leasePerson = ''
|
||||
await this.getBmTeam()
|
||||
|
|
@ -606,8 +607,8 @@ export default {
|
|||
// this.loading = true;
|
||||
await getApplyInfo(this.id).then(response => {
|
||||
Object.assign(this.maForm, response.data.leaseApplyInfo)
|
||||
this.maForm.proId = response.data.leaseApplyInfo.proId
|
||||
this.maForm.projectId = this.projectList.find(item => item.proId === response.data.leaseApplyInfo.proId)?.projectId
|
||||
this.maForm.proId = String(response.data.leaseApplyInfo.proId)
|
||||
this.maForm.projectId = this.projectList.find(item => item.proId == response.data.leaseApplyInfo.proId)?.projectId
|
||||
this.maForm.relPhone = response.data.leaseApplyInfo.phone || response.data.leaseApplyInfo.relPhone || ''
|
||||
this.getBmTeam()
|
||||
this.equipmentList = response.data.leaseApplyDetailsList || []
|
||||
|
|
|
|||
|
|
@ -242,7 +242,8 @@ import {
|
|||
getListsByConfigId,
|
||||
getStandardConfigList,
|
||||
getLeaseDataByCode,
|
||||
getPickDepartListApi
|
||||
getPickDepartListApi,
|
||||
getProListByDepartApi
|
||||
} from '@/api/materialsStation'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
|
@ -484,7 +485,7 @@ export default {
|
|||
// return
|
||||
// }
|
||||
|
||||
const isProIdValid = this.projectList.some(item => String(item.proId) === String(leaseApplyInfo.proId))
|
||||
const isProIdValid = this.projectList.some(item => String(item.proId) == String(leaseApplyInfo.proId))
|
||||
|
||||
if (!isProIdValid) {
|
||||
this.$message.warning('该领料单号不属于您负责的工程')
|
||||
|
|
@ -494,7 +495,7 @@ export default {
|
|||
// 自动带入工程(不论用户是否先选工程)
|
||||
this.maForm.proId = leaseApplyInfo.proId
|
||||
// 如果 projectList 中存在对应项,带入 projectId(你原 code 使用 projectId 字段关联)
|
||||
const matchedProject = this.projectList.find(item => String(item.proId) === String(leaseApplyInfo.proId))
|
||||
const matchedProject = this.projectList.find(item => String(item.proId) == String(leaseApplyInfo.proId))
|
||||
if (matchedProject) {
|
||||
this.maForm.projectId = matchedProject.projectId || matchedProject.projectId
|
||||
}
|
||||
|
|
@ -702,7 +703,7 @@ export default {
|
|||
async changePro(e) {
|
||||
console.log('🚀 ~ changePro ~ e:', e)
|
||||
this.maForm.proId = e
|
||||
this.maForm.projectId = this.projectList.find(item => item.proId === e)?.projectId
|
||||
this.maForm.projectId = this.projectList.find(item => item.proId == e)?.projectId
|
||||
this.maForm.teamId = ''
|
||||
this.maForm.leasePerson = ''
|
||||
this.equipmentList = []
|
||||
|
|
@ -738,7 +739,9 @@ export default {
|
|||
/** 租赁单位和工程-下拉选 */
|
||||
async projectInfoList() {
|
||||
try {
|
||||
const res = await getListProject({ unitId: null, isApp: true, teamName: this.maForm.teamName })
|
||||
|
||||
const res = await getProListByDepartApi({ teamName: this.maForm.teamName })
|
||||
// const res = await getListProject({ unitId: null, isApp: true, teamName: this.maForm.teamName })
|
||||
this.projectList = res.data
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ projectInfoList ~ error:', error)
|
||||
|
|
@ -876,9 +879,10 @@ export default {
|
|||
}
|
||||
Object.assign(this.maForm, response.data.leaseApplyInfo)
|
||||
this.maForm.pickType = 0
|
||||
this.maForm.proId = response.data.leaseApplyInfo.proId
|
||||
this.maForm.proId = String(response.data.leaseApplyInfo.proId)
|
||||
console.log("xxxxxxyyy", this.maForm.proId)
|
||||
this.maForm.projectId = this.projectList.find(
|
||||
item => item.proId === response.data.leaseApplyInfo.proId
|
||||
item => item.proId == response.data.leaseApplyInfo.proId
|
||||
)?.projectId
|
||||
this.maForm.relPhone = response.data.leaseApplyInfo.phone || response.data.leaseApplyInfo.relPhone || ''
|
||||
this.getBmTeam()
|
||||
|
|
|
|||
Loading…
Reference in New Issue