在用配件,在修工程

This commit is contained in:
hongchao 2025-10-10 12:19:10 +08:00
parent 1f9fb47860
commit 1544db731f
7 changed files with 815 additions and 31 deletions

View File

@ -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({

View File

@ -193,6 +193,15 @@ export function getAllUsDetailsApi(query) {
})
}
// 查询配件使用查询列表
export function getPartUsingListApi(query) {
return request({
url: '/material/repair/getPartUsingList',
method: 'get',
params: query
})
}

View File

@ -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>

View File

@ -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>

View File

@ -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)

View File

@ -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 || []

View File

@ -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()