材料站-优化

This commit is contained in:
bb_pan 2025-07-10 18:02:53 +08:00
parent 2ca86860de
commit acea73bb8a
11 changed files with 212 additions and 271 deletions

View File

@ -1,6 +1,6 @@
import request from '@/utils/request' import request from '@/utils/request'
// 登录方法 // 登录方法 - 调试使用 - 产线环境需注释
export function login(data) { export function login(data) {
return request({ return request({
url: '/auth/login', url: '/auth/login',

View File

@ -152,6 +152,15 @@ export const getBmTeamApi = data => {
}) })
} }
// 班组管理-列表-退料
export const getTeamListApi = data => {
return request({
url: '/material/bmTeam/getTeamList',
method: 'get',
params: data
})
}
// 班组管理-新增 // 班组管理-新增
export const addBmTeamApi = data => { export const addBmTeamApi = data => {
return request({ return request({
@ -285,7 +294,7 @@ export function equipmentTypeTree(data) {
// 领料申请租赁工程下拉框 // 领料申请租赁工程下拉框
export function getListProject(data) { export function getListProject(data) {
return request({ return request({
url: '/material/select/getProjectList', url: '/material/select/getProjectInfo',
method: 'post', method: 'post',
data data
}) })

View File

@ -511,8 +511,9 @@ export default {
this.getCompanyAndProjectFun() this.getCompanyAndProjectFun()
this.getCardListFun() this.getCardListFun()
this.getPie_1DataFun() this.getPie_1DataFun()
await Promise.all([this.getUserInfoByUserName(), this.projectInfoList()]) this.getUserInfoByUserName()
this.getUserInfoByIdCard() // await Promise.all([this.getUserInfoByUserName(), this.projectInfoList()])
// this.getUserInfoByIdCard()
} }
} }
</script> </script>

View File

@ -10,8 +10,21 @@
label-width="100px" label-width="100px"
> >
<el-row> <el-row>
<el-form-item label="退料工程" prop="proId">
<el-select
v-if="backId == ''"
v-model="queryParams.proId"
placeholder="请选择退料工程"
style="width: 240px"
@change="handleProChange"
>
<el-option v-for="item in proList" :key="item.id" :label="item.proName" :value="item.proId"></el-option>
</el-select>
<el-input v-else v-model="queryParams.proName" disabled style="width: 240px" />
</el-form-item>
<el-form-item label="退料班组" prop="teamId"> <el-form-item label="退料班组" prop="teamId">
<el-select <el-select
v-if="backId == ''"
v-model="queryParams.teamId" v-model="queryParams.teamId"
:disabled="backId != ''" :disabled="backId != ''"
placeholder="请选择班组" placeholder="请选择班组"
@ -28,23 +41,7 @@
:data-key="item.id" :data-key="item.id"
/> />
</el-select> </el-select>
</el-form-item> <el-input v-else v-model="queryParams.teamName" disabled style="width: 240px" />
<el-form-item label="退料工程" prop="proId">
<el-select
v-if="backId == ''"
v-model="queryParams.proId"
placeholder="请选择退料工程"
style="width: 240px"
@change="handleProChange"
>
<el-option v-for="item in proList" :key="item.id" :label="item.proName" :value="item.proId"></el-option>
</el-select>
<el-input
v-else
v-model="queryParams.proName"
disabled
style="width: 240px"
/>
</el-form-item> </el-form-item>
<el-form-item label="班组长" prop="backPerson"> <el-form-item label="班组长" prop="backPerson">
<el-input v-model="queryParams.backPerson" placeholder="请输入班组长" disabled style="width: 240px" /> <el-input v-model="queryParams.backPerson" placeholder="请输入班组长" disabled style="width: 240px" />
@ -257,14 +254,14 @@
<script> <script>
import { import {
getProjectList, getListProject,
getAgreementInfoByIdBackApi, getAgreementInfoByIdBackApi,
getDeviceTreeByAgreementId, getDeviceTreeByAgreementId,
addBackApply, addBackApply,
getBackApplyInfo, getBackApplyInfo,
editBackApply, editBackApply,
getMachineById, getMachineById,
getBmTeamApi getTeamListApi
} from '@/api/materialsStation' } from '@/api/materialsStation'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
@ -422,7 +419,8 @@ export default {
} }
}, },
mounted() { mounted() {
this.GetUnitData() // this.GetUnitData()
this.GetProData()
if (this.backId) { if (this.backId) {
// //
this.rowId = this.backId this.rowId = this.backId
@ -438,25 +436,33 @@ export default {
const team = this.teamList.find(item => item.id === val) const team = this.teamList.find(item => item.id === val)
this.queryParams.backPerson = team ? team.relName : '' this.queryParams.backPerson = team ? team.relName : ''
this.queryParams.teamName = team ? team.teamName : '' this.queryParams.teamName = team ? team.teamName : ''
this.GetProData() this.queryParams.relName = team ? team.relName : ''
}, this.queryParams.phone = team ? team.relPhone : ''
handleProChange(val) { // this.GetProData()
console.log('🚀 ~ handleProChange ~ val:', val, this.queryParams)
setTimeout(() => { setTimeout(() => {
this.GetAgreementInfoById() this.GetAgreementInfoById()
}, 300) }, 300)
}, },
handleProChange(val) {
console.log('🚀 ~ handleProChange ~ val:', val, this.queryParams)
this.GetUnitData()
},
// //
async GetUnitData() { async GetUnitData() {
const res = await getBmTeamApi({ isAll: 0 }) try {
const res = await getTeamListApi({ isAll: 0, proId: this.queryParams.proId })
this.teamList = res.data this.teamList = res.data
this.GetAgreementInfoById()
} catch (error) {
console.log('🚀 ~ GetUnitData ~ error:', error)
}
}, },
// //
async GetProData() { async GetProData() {
const res = await getProjectList({ unitId: null, isApp: true, teamId: this.queryParams.teamId }) const res = await getListProject({ unitId: null, isApp: true })
this.proList = res.data this.proList = res.data
this.queryParams.proId = null // this.queryParams.proId = null
this.GetAgreementInfoById() // this.GetAgreementInfoById()
}, },
// //
async GetDeviceTypeTreeFn(agreementId) { async GetDeviceTypeTreeFn(agreementId) {

View File

@ -10,32 +10,31 @@
label-width="100px" label-width="100px"
> >
<el-row> <el-row>
<el-form-item label="退料班组" prop="teamName">
<el-input
v-model="queryParams.teamName"
placeholder="退料单位"
clearable
style="width: 240px"
:disabled="isView"
/>
</el-form-item>
<el-form-item label="退料工程" prop="proName"> <el-form-item label="退料工程" prop="proName">
<el-input <el-input
v-model="queryParams.proName" v-model="queryParams.proName"
placeholder="退料工程" placeholder="退料工程"
clearable clearable
style="width: 240px" style="width: 240px"
:disabled="isView" readonly
/>
</el-form-item>
<el-form-item label="退料班组" prop="teamName">
<el-input
v-model="queryParams.teamName"
placeholder="退料单位"
clearable
style="width: 240px"
readonly
/> />
</el-form-item> </el-form-item>
<el-form-item label="班组长" prop="backPerson"> <el-form-item label="班组长" prop="backPerson">
<el-input <el-input
v-model="queryParams.backPerson" v-model="queryParams.backPerson"
placeholder="请输入班组长" placeholder="请输入班组长"
clearable clearable
style="width: 240px" style="width: 240px"
:disabled="isView" readonly
/> />
</el-form-item> </el-form-item>
<el-form-item label="班组长电话" prop="phone"> <el-form-item label="班组长电话" prop="phone">
@ -45,7 +44,7 @@
clearable clearable
style="width: 240px" style="width: 240px"
:maxlength="11" :maxlength="11"
:disabled="isView" readonly
/> />
</el-form-item> </el-form-item>
@ -55,7 +54,7 @@
placeholder="请输入备注" placeholder="请输入备注"
clearable clearable
rows="1" rows="1"
:disabled="isView" readonly
type="textarea" type="textarea"
maxlength="100" maxlength="100"
style="width: 240px" style="width: 240px"
@ -64,47 +63,8 @@
</el-row> </el-row>
<el-row></el-row> <el-row></el-row>
</el-form> </el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-back"
size="mini"
@click="handleBack"
>退料管理</el-button
>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>保存</el-button
>
</el-col> -->
<el-col :span="1.5">
<!-- <el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:role:export']"
>导出</el-button> -->
</el-col>
</el-row>
<el-table v-loading="loading" :data="equipmentList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="equipmentList" @selection-change="handleSelectionChange">
<!-- <el-table-column
type="selection"
min-width="55"
align="center"
:selectable="selectable"
/> -->
<el-table-column label="序号" type="index" align="center" min-width="80" /> <el-table-column label="序号" type="index" align="center" min-width="80" />
<el-table-column label="类型名称" align="center" prop="typeName" :show-overflow-tooltip="true" /> <el-table-column label="类型名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="typeModel" :show-overflow-tooltip="true" /> <el-table-column label="规格型号" align="center" prop="typeModel" :show-overflow-tooltip="true" />
@ -122,55 +82,17 @@
<div style="color: rgb(2, 167, 240)" @click="openAddCode(scope.row)" v-if="scope.row.manageType == 0"> <div style="color: rgb(2, 167, 240)" @click="openAddCode(scope.row)" v-if="scope.row.manageType == 0">
{{ scope.row.preNum }} {{ scope.row.preNum }}
</div> </div>
<!-- <el-input
v-if="scope.row.manageType==1"
v-model.number="scope.row.preNum"
placeholder="退料数量"
type="number"
min="1"
clearable :readonly="isView"
@input="checkNum(scope.row)"
style="width: 100%"
/> -->
<div v-if="scope.row.manageType == 1">{{ scope.row.preNum }}</div> <div v-if="scope.row.manageType == 1">{{ scope.row.preNum }}</div>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column
label="完好数量"
align="center"
prop="goodNum"
min-width="120"
>
</el-table-column>
<el-table-column
label="损坏数量"
align="center"
prop="badNum"
min-width="120"
>
</el-table-column> -->
<el-table-column label="损坏价值判定" align="center" prop="apDetection" min-width="120"></el-table-column> <el-table-column label="损坏价值判定" align="center" prop="apDetection" min-width="120"></el-table-column>
<el-table-column label="备注" align="center" prop="remark" min-width="120"> <el-table-column label="备注" align="center" prop="remark" min-width="120">
<!-- <template slot-scope="scope">
<el-input
v-model="scope.row.remark"
placeholder="备注" :readonly="isView"
clearable maxlength="100"
style="width: 100%"
/>
</template> -->
</el-table-column> </el-table-column>
<el-table-column label="附件" align="center" prop="file"> <!-- <el-table-column label="附件" align="center" prop="file">
<template slot-scope="scope"> <template slot-scope="scope">
<div style="display: flex; align-items: center; justify-content: center"> <div style="display: flex; align-items: center; justify-content: center">
<!-- <el-upload ref="upload" :limit="1" :headers="upload.headers"
:action="upload.url" :show-file-list="false" accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
:on-success="handleFileSuccess" :auto-upload="true">
<el-button size="mini" type="text" @click="beforeFileUpload(scope.row)">
上传
</el-button>
</el-upload> -->
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -181,38 +103,12 @@
</el-button> </el-button>
</div> </div>
</template> </template>
</el-table-column>
<!-- <el-table-column
label="操作"
align="center"
width="100px"
>
<template slot-scope="scope">
<el-button size="mini" type="danger"
@click="handleDelete({ ...scope.row, index: scope.$index })">删除</el-button>
</template>
</el-table-column> --> </el-table-column> -->
</el-table> </el-table>
<el-dialog title="编码退料" :visible.sync="open" width="1000px" append-to-body> <el-dialog title="编码退料" :visible.sync="open" width="1000px" append-to-body>
<!-- <el-row :gutter="10" class="mb8">
<el-col :span="6">
<div style="width: 100%;height: 100%;display: flex;align-items: center;">
<span style="width: 80px;">编码</span>
<el-select v-model="maId" clearable filterable style="width: 240px" placeholder="请选择" @change="changeMachine">
<el-option v-for="item in machineList"
:key="item.maId"
:label="item.maCode"
:value="item.maId">
</el-option>
</el-select>
</div>
</el-col>
<el-col :span="1.5">
<el-button type="primary" size="mini" @click="handleAddCode">添加编码</el-button>
</el-col>
</el-row> -->
<el-table :data="maCodeList" width="100%" height="450px"> <el-table :data="maCodeList" width="100%" height="450px">
<el-table-column label="序号" type="index" width="55" align="center" /> <el-table-column label="序号" type="index" width="55" align="center" />
<el-table-column <el-table-column
@ -228,11 +124,11 @@
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
></el-table-column> ></el-table-column>
<el-table-column label="设备编码" prop="maCode" align="center" :show-overflow-tooltip="true"></el-table-column> <el-table-column label="设备编码" prop="maCode" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="设备状态" prop="maStatus" align="center" :show-overflow-tooltip="true"> <!-- <el-table-column label="设备状态" prop="maStatus" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.ma_machine_status" :value="scope.row.maStatus" /> <dict-tag :options="dict.type.ma_machine_status" :value="scope.row.maStatus" />
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column <el-table-column
label="损坏价值判定" label="损坏价值判定"
prop="apDetection" prop="apDetection"
@ -240,23 +136,10 @@
width="160" width="160"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
> >
<!-- <template slot-scope="scope">
<el-radio-group v-model="scope.row.apDetection" disabled>
<el-radio label="1">完好</el-radio>
<el-radio label="0">损坏</el-radio>
</el-radio-group>
</template> -->
</el-table-column> </el-table-column>
<el-table-column label="附件" align="center" width="100"> <!-- <el-table-column label="附件" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<div style="display: flex; align-items: center; justify-content: center"> <div style="display: flex; align-items: center; justify-content: center">
<!-- <el-upload ref="upload" :limit="1" :headers="upload.headers"
:action="upload.url" :show-file-list="false" accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
:on-success="handleFileSuccess2" :auto-upload="true">
<el-button size="mini" type="text" @click="beforeFileUpload(scope.row)">
上传
</el-button>
</el-upload> -->
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -267,13 +150,8 @@
</el-button> </el-button>
</div> </div>
</template> </template>
</el-table-column>
<!-- <el-table-column label="操作" align="center" width="120px">
<template slot-scope="scope">
<el-button size="mini" type="danger"
@click="handleDeleteCode({ ...scope.row, index: scope.$index })">删除</el-button>
</template>
</el-table-column> --> </el-table-column> -->
</el-table> </el-table>
<div style="width: 100%; height: 50px; display: flex; justify-content: flex-end; align-items: center"> <div style="width: 100%; height: 50px; display: flex; justify-content: flex-end; align-items: center">
<!-- <el-button type="primary" size="mini" @click="saveDevCode">保存</el-button> --> <!-- <el-button type="primary" size="mini" @click="saveDevCode">保存</el-button> -->

View File

@ -2,6 +2,19 @@
<!-- 新增工机具 --> <!-- 新增工机具 -->
<div> <div>
<el-form :model="maForm" ref="maForm" size="small" :rules="rules" :inline="true" label-width="120px"> <el-form :model="maForm" ref="maForm" size="small" :rules="rules" :inline="true" label-width="120px">
<el-form-item label="租赁工程" prop="projectId">
<el-select
v-if="!isEdit || !maForm.teamId"
v-model="maForm.projectId"
placeholder="请选择租赁工程"
filterable
style="width: 240px"
@change="changePro"
>
<el-option v-for="(item, index) in projectList" :key="index" :label="item.proName" :value="item.projectId" />
</el-select>
<el-input v-else v-model="maForm.projectName" disabled maxlength="50" style="width: 240px" />
</el-form-item>
<el-form-item label="领用班组" prop="teamId"> <el-form-item label="领用班组" prop="teamId">
<el-select <el-select
v-if="!isEdit" v-if="!isEdit"
@ -21,18 +34,6 @@
</el-select> </el-select>
<el-input v-else v-model="maForm.teamName" disabled maxlength="50" style="width: 240px" /> <el-input v-else v-model="maForm.teamName" disabled maxlength="50" style="width: 240px" />
</el-form-item> </el-form-item>
<el-form-item label="租赁工程" prop="projectId">
<el-select
v-if="!isEdit || !maForm.teamId"
v-model="maForm.projectId"
placeholder="请选择租赁工程"
filterable
style="width: 240px"
>
<el-option v-for="(item, index) in projectList" :key="index" :label="item.proName" :value="item.proId" />
</el-select>
<el-input v-else v-model="maForm.projectName" disabled maxlength="50" style="width: 240px" />
</el-form-item>
<el-form-item label="班组长" prop="leasePerson"> <el-form-item label="班组长" prop="leasePerson">
<el-input <el-input
v-model="maForm.leasePerson" v-model="maForm.leasePerson"
@ -43,9 +44,9 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="联系电话" prop="phone"> <el-form-item label="联系电话" prop="relPhone">
<el-input <el-input
v-model="maForm.phone" v-model="maForm.relPhone"
placeholder="请输入联系电话" placeholder="请输入联系电话"
clearable clearable
maxlength="11" maxlength="11"
@ -89,11 +90,11 @@
@visible-change="handleVisibleChange" @visible-change="handleVisibleChange"
> >
<el-option <el-option
v-for="item in filteredOptions" v-for="(item, index) in filteredOptions"
:key="item.typeId" :key="index"
:label="item.fullPath" :label="item.fullPath"
:value="item.typeId" :value="item.typeId"
:data-key="item.typeId" :data-key="index"
> >
<span v-html="highlightText(item.fullPath, searchKeyword)"></span> <span v-html="highlightText(item.fullPath, searchKeyword)"></span>
<span style="float: right; color: #8492a6; font-size: 13px">库存:{{ item.storageNum }}</span> <span style="float: right; color: #8492a6; font-size: 13px">库存:{{ item.storageNum }}</span>
@ -281,7 +282,8 @@ export default {
purchaseNumber: '', purchaseNumber: '',
standardConfig: undefined, standardConfig: undefined,
bmFileInfos: [], bmFileInfos: [],
fitNum: 1 fitNum: 1,
proId: undefined,
}, },
lastFitNum: 1, lastFitNum: 1,
standardConfigList: [], standardConfigList: [],
@ -301,7 +303,7 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
phone: [ relPhone: [
// { required: true, message: '', trigger: 'blur' }, // { required: true, message: '', trigger: 'blur' },
{ {
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
@ -350,7 +352,8 @@ export default {
this.id = this.editId this.id = this.editId
this.getTaskInfo() this.getTaskInfo()
} else { } else {
this.getBmTeam() // this.getBmTeam()
this.projectInfoList()
} }
setTimeout(() => { setTimeout(() => {
this.fitNum = this.maForm.fitNum this.fitNum = this.maForm.fitNum
@ -386,7 +389,8 @@ export default {
if (!this.maForm.teamId || !this.maForm.projectId) return if (!this.maForm.teamId || !this.maForm.projectId) return
getAgreement({ getAgreement({
teamId: this.maForm.teamId, teamId: this.maForm.teamId,
projectId: this.maForm.projectId // projectId: this.maForm.projectId,
proId: this.maForm.proId
}).then(res => { }).then(res => {
console.log('🚀 ~ getAgreementId ~ res:', res) console.log('🚀 ~ getAgreementId ~ res:', res)
if (!res.data || !Array.isArray(res.data)) { if (!res.data || !Array.isArray(res.data)) {
@ -413,13 +417,27 @@ export default {
async getBmTeam() { async getBmTeam() {
try { try {
const idCard = sessionStorage.getItem('idCard') const idCard = sessionStorage.getItem('idCard')
const res = await getBmTeamApi({ isAll: 0, idCard }) const res = await getBmTeamApi({ isAll: 0, idCard, projectId: this.maForm.projectId })
if (!res.data || res.data.length === 0) return if (!res.data || res.data.length === 0) return
this.uniteList = res.data this.uniteList = res.data
const userName = sessionStorage.getItem('userName')
if (this.uniteList.some(item => item.teamLeaderIdCard == userName)) {
const team = this.uniteList.find(item => item.teamLeaderIdCard == userName)
this.maForm.teamId = team.id
this.maForm.teamName = team.teamName
this.maForm.leasePerson = team.relName
this.maForm.relPhone = team.relPhone || ''
this.maForm.relName = team.relName
this.maForm.teamLeaderIdCard = team.teamLeaderIdCard
} else {
this.maForm.teamId = res.data[0].id this.maForm.teamId = res.data[0].id
this.maForm.teamName = res.data[0].teamName this.maForm.teamName = res.data[0].teamName
this.maForm.leasePerson = res.data[0].relName this.maForm.leasePerson = res.data[0].relName
this.projectInfoList() this.maForm.relPhone = res.data[0].relPhone || ''
this.maForm.relName = res.data[0].relName
this.maForm.teamLeaderIdCard = res.data[0].teamLeaderIdCard
}
// this.projectInfoList()
} catch (error) { } catch (error) {
console.log('🚀 ~ getBmTeam ~ error:', error) console.log('🚀 ~ getBmTeam ~ error:', error)
} }
@ -433,23 +451,33 @@ export default {
console.log('🚀 ~ projectInfoList ~ error:', error) console.log('🚀 ~ projectInfoList ~ error:', error)
} }
}, },
changePro(e) {
console.log('🚀 ~ changePro ~ e:', e)
this.maForm.proId = this.projectList.find(item => item.projectId === e)?.proId
this.getBmTeam()
},
changeTeam(e) { changeTeam(e) {
console.log('🚀 ~ changeTeam ~ e:', e) console.log('🚀 ~ changeTeam ~ e:', e)
this.maForm.projectId = null // this.maForm.projectId = null
this.maForm.projectName = null // this.maForm.projectName = null
// teamName // teamName
const team = this.uniteList.find(item => item.id === e) const team = this.uniteList.find(item => item.id === e)
this.maForm.teamName = team ? team.teamName : '' this.maForm.teamName = team ? team.teamName : ''
this.maForm.leasePerson = team ? team.relName : '' this.maForm.leasePerson = team ? team.relName : ''
this.maForm.relName = team.relName
this.maForm.relPhone = team.relPhone || ''
this.maForm.phone = team.relPhone || ''
this.maForm.teamLeaderIdCard = team.teamLeaderIdCard
console.log('🚀 ~ changeTeam ~ this.maForm.teamName:', this.maForm.teamName) console.log('🚀 ~ changeTeam ~ this.maForm.teamName:', this.maForm.teamName)
this.projectInfoList() // this.projectInfoList()
}, },
/** 机具类型 */ /** 机具类型 */
equipmentType() { equipmentType() {
equipmentTypeTree({ equipmentTypeTree({
agreementIdList: this.agreementId, agreementIdList: this.agreementId,
proId: this.maForm.projectId, proId: this.maForm.proId,
teamId: this.maForm.teamId // teamId: this.maForm.teamId,
teamName: this.maForm.teamName
}).then(response => { }).then(response => {
this.equipmentTypeList = response.data this.equipmentTypeList = response.data
// //
@ -554,9 +582,8 @@ export default {
async getTaskInfo() { async getTaskInfo() {
// this.loading = true; // this.loading = true;
await getApplyInfo(this.id).then(response => { await getApplyInfo(this.id).then(response => {
this.maForm = response.data.leaseApplyInfo Object.assign(this.maForm, response.data.leaseApplyInfo)
this.maForm.teamId = response.data.leaseApplyInfo.teamId this.maForm.projectId = response.data.leaseApplyInfo.proId
this.maForm.projectId = response.data.leaseApplyInfo.projectId
this.equipmentList = response.data.leaseApplyDetailsList || [] this.equipmentList = response.data.leaseApplyDetailsList || []
// bmFileInfos // bmFileInfos
if (this.maForm.bmFileInfos.length > 0) { if (this.maForm.bmFileInfos.length > 0) {

View File

@ -92,7 +92,6 @@
type="primary" type="primary"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-if="scope.row.taskStatus == 1" v-if="scope.row.taskStatus == 1"
v-hasPermi="['purchase:info:edit']"
> >
编辑 编辑
</el-button> </el-button>
@ -105,7 +104,6 @@
type="danger" type="danger"
@click="handleDeletePurchase(scope.row)" @click="handleDeletePurchase(scope.row)"
v-if="scope.row.taskStatus == 1" v-if="scope.row.taskStatus == 1"
v-hasPermi="['purchase:info:remove']"
> >
删除 删除
</el-button> </el-button>

View File

@ -7,20 +7,20 @@
:inline="true" :inline="true"
label-width="120px" label-width="120px"
> >
<el-form-item label="租赁单位" prop="teamName"> <el-form-item label="租赁工程" prop="projectId">
<el-input <el-input
v-model="maForm.teamName" v-model="maForm.projectName"
placeholder="租赁单位" placeholder="租赁工程"
clearable clearable
maxlength="50" maxlength="50"
style="width: 240px" style="width: 240px"
readonly readonly
/> />
</el-form-item> </el-form-item>
<el-form-item label="租赁工程" prop="projectId"> <el-form-item label="领用班组" prop="teamName">
<el-input <el-input
v-model="maForm.projectName" v-model="maForm.teamName"
placeholder="租赁工程" placeholder="领用班组"
clearable clearable
maxlength="50" maxlength="50"
style="width: 240px" style="width: 240px"
@ -39,9 +39,9 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="联系电话" prop="phone"> <el-form-item label="联系电话" prop="relPhone">
<el-input <el-input
v-model="maForm.phone" v-model="maForm.relPhone"
placeholder="联系电话" placeholder="联系电话"
clearable clearable
maxlength="50" maxlength="50"

View File

@ -2,6 +2,20 @@
<!-- 新增工机具 --> <!-- 新增工机具 -->
<div> <div>
<el-form :model="maForm" ref="maForm" size="small" :rules="rules" :inline="true" label-width="120px"> <el-form :model="maForm" ref="maForm" size="small" :rules="rules" :inline="true" label-width="120px">
<el-form-item label="租赁工程" prop="projectId">
<el-select
v-if="!isEdit"
v-model="maForm.projectId"
:disabled="isEdit"
placeholder="请选择租赁工程"
filterable
style="width: 240px"
@change="changePro"
>
<el-option v-for="(item, index) in projectList" :key="index" :label="item.proName" :value="item.projectId" />
</el-select>
<el-input v-else v-model="maForm.projectName" disabled maxlength="50" style="width: 240px" />
</el-form-item>
<el-form-item label="领用班组" prop="teamId"> <el-form-item label="领用班组" prop="teamId">
<el-select <el-select
v-if="!isEdit" v-if="!isEdit"
@ -21,19 +35,6 @@
</el-select> </el-select>
<el-input v-else v-model="maForm.teamName" disabled maxlength="50" style="width: 240px" /> <el-input v-else v-model="maForm.teamName" disabled maxlength="50" style="width: 240px" />
</el-form-item> </el-form-item>
<el-form-item label="租赁工程" prop="projectId">
<el-select
v-if="!isEdit"
v-model="maForm.projectId"
:disabled="isEdit || !maForm.teamId"
placeholder="请选择租赁工程"
filterable
style="width: 240px"
>
<el-option v-for="(item, index) in projectList" :key="index" :label="item.proName" :value="item.proId" />
</el-select>
<el-input v-else v-model="maForm.projectName" disabled maxlength="50" style="width: 240px" />
</el-form-item>
<el-form-item label="班组长" prop="leasePerson"> <el-form-item label="班组长" prop="leasePerson">
<el-input <el-input
v-model="maForm.leasePerson" v-model="maForm.leasePerson"
@ -44,9 +45,9 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="联系电话" prop="phone"> <el-form-item label="联系电话" prop="relPhone">
<el-input <el-input
v-model="maForm.phone" v-model="maForm.relPhone"
placeholder="请输入联系电话" placeholder="请输入联系电话"
:disabled="isEdit" :disabled="isEdit"
clearable clearable
@ -91,11 +92,11 @@
@visible-change="handleVisibleChange" @visible-change="handleVisibleChange"
> >
<el-option <el-option
v-for="item in filteredOptions" v-for="(item, index) in filteredOptions"
:key="item.typeId" :key="index"
:label="item.fullPath" :label="item.fullPath"
:value="item.typeId" :value="item.typeId"
:data-key="item.typeId" :data-key="index"
> >
<span v-html="highlightText(item.fullPath, searchKeyword)"></span> <span v-html="highlightText(item.fullPath, searchKeyword)"></span>
<span style="float: right; color: #8492a6; font-size: 13px">库存:{{ item.storageNum }}</span> <span style="float: right; color: #8492a6; font-size: 13px">库存:{{ item.storageNum }}</span>
@ -286,7 +287,8 @@ export default {
remark: '', remark: '',
purchaseNumber: '', purchaseNumber: '',
standardConfig: undefined, standardConfig: undefined,
bmFileInfos: [] bmFileInfos: [],
proId: undefined,
}, },
standardConfigList: [], standardConfigList: [],
// //
@ -311,7 +313,7 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
phone: [ relPhone: [
// { required: true, message: '', trigger: 'blur' }, // { required: true, message: '', trigger: 'blur' },
{ {
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
@ -373,7 +375,7 @@ export default {
this.id = this.editId this.id = this.editId
this.getTaskInfo() this.getTaskInfo()
} else { } else {
this.getBmTeam() this.projectInfoList()
} }
}, },
watch: { watch: {
@ -393,7 +395,8 @@ export default {
getAgreementId() { getAgreementId() {
getAgreement({ getAgreement({
teamId: this.maForm.teamId, teamId: this.maForm.teamId,
projectId: this.maForm.projectId // projectId: this.maForm.projectId,
proId: this.maForm.proId
}).then(res => { }).then(res => {
console.log('🚀 ~ getAgreementId ~ res:', res) console.log('🚀 ~ getAgreementId ~ res:', res)
if (!res.data || !Array.isArray(res.data)) { if (!res.data || !Array.isArray(res.data)) {
@ -419,28 +422,51 @@ export default {
// //
async getBmTeam() { async getBmTeam() {
try { try {
const teamLeaderIdCard = sessionStorage.getItem('idCard') const idCard = sessionStorage.getItem('idCard')
const res = await getBmTeamApi({ isAll: 0, teamLeaderIdCard }) const res = await getBmTeamApi({ isAll: 0, idCard, projectId: this.maForm.projectId })
if (!res.data || res.data.length === 0) return if (!res.data || res.data.length === 0) return
this.uniteList = res.data this.uniteList = res.data
const userName = sessionStorage.getItem('userName')
if (this.uniteList.some(item => item.teamLeaderIdCard == userName)) {
const team = this.uniteList.find(item => item.teamLeaderIdCard == userName)
this.maForm.teamId = team.id
this.maForm.teamName = team.teamName
this.maForm.leasePerson = team.relName
this.maForm.relPhone = team.relPhone || ''
this.maForm.relName = team.relName
this.maForm.teamLeaderIdCard = team.teamLeaderIdCard
} else {
this.maForm.teamId = res.data[0].id this.maForm.teamId = res.data[0].id
this.maForm.teamName = res.data[0].teamName this.maForm.teamName = res.data[0].teamName
this.maForm.leasePerson = res.data[0].relName this.maForm.leasePerson = res.data[0].relName
this.projectInfoList() this.maForm.relPhone = res.data[0].relPhone || ''
this.maForm.relName = res.data[0].relName
this.maForm.teamLeaderIdCard = res.data[0].teamLeaderIdCard
}
// this.projectInfoList()
} catch (error) { } catch (error) {
console.log('🚀 ~ getBmTeam ~ error:', error) console.log('🚀 ~ getBmTeam ~ error:', error)
} }
}, },
changePro(e) {
console.log('🚀 ~ changePro ~ e:', e)
this.maForm.proId = this.projectList.find(item => item.projectId === e)?.proId
this.getBmTeam()
},
changeTeam(e) { changeTeam(e) {
console.log('🚀 ~ changeTeam ~ e:', e) console.log('🚀 ~ changeTeam ~ e:', e)
this.maForm.projectId = null // this.maForm.projectId = null
this.maForm.projectName = null // this.maForm.projectName = null
// teamName // teamName
const team = this.uniteList.find(item => item.id === e) const team = this.uniteList.find(item => item.id === e)
this.maForm.teamName = team ? team.teamName : '' this.maForm.teamName = team ? team.teamName : ''
this.maForm.leasePerson = team ? team.relName : '' this.maForm.leasePerson = team ? team.relName : ''
this.maForm.relName = team.relName
this.maForm.relPhone = team.relPhone || ''
this.maForm.phone = team.relPhone || ''
this.maForm.teamLeaderIdCard = team.teamLeaderIdCard
console.log('🚀 ~ changeTeam ~ this.maForm.teamName:', this.maForm.teamName) console.log('🚀 ~ changeTeam ~ this.maForm.teamName:', this.maForm.teamName)
this.projectInfoList() // this.projectInfoList()
}, },
/** 租赁单位和工程-下拉选 */ /** 租赁单位和工程-下拉选 */
async projectInfoList() { async projectInfoList() {
@ -455,8 +481,9 @@ export default {
equipmentType() { equipmentType() {
equipmentTypeTree({ equipmentTypeTree({
agreementIdList: this.agreementId, agreementIdList: this.agreementId,
proId: this.maForm.projectId, proId: this.maForm.proId,
teamId: this.maForm.teamId // teamId: this.maForm.teamId,
teamName: this.maForm.teamName
}).then(response => { }).then(response => {
this.equipmentTypeList = response.data this.equipmentTypeList = response.data
// //
@ -567,11 +594,8 @@ export default {
if (response.msg && response.msg != '操作成功') { if (response.msg && response.msg != '操作成功') {
this.$message.warning(response.msg) this.$message.warning(response.msg)
} }
this.maForm = response.data.leaseApplyInfo Object.assign(this.maForm, response.data.leaseApplyInfo)
this.maForm.teamId = response.data.leaseApplyInfo.teamId this.maForm.projectId = response.data.leaseApplyInfo.proId
this.maForm.projectId = response.data.leaseApplyInfo.projectId
// this.unitId = this.treeParentsById(this.uniteList, this.maForm.unitId)
// this.projectId = this.treeParentsById(this.projectList, this.maForm.projectId)
this.equipmentList = response.data.leaseApplyDetailsList || [] this.equipmentList = response.data.leaseApplyDetailsList || []
if (this.equipmentList.length > 0) { if (this.equipmentList.length > 0) {
this.equipmentList.forEach(item => { this.equipmentList.forEach(item => {
@ -734,7 +758,7 @@ export default {
// //
handleOutCode(row) { handleOutCode(row) {
this.rowData = row this.rowData = row
this.$refs.outCode.handleOpenCode({ ...row, teamId: this.maForm.teamId, proId: this.maForm.projectId }) this.$refs.outCode.handleOpenCode({ ...row, teamId: this.maForm.teamId, proId: this.maForm.proId })
}, },
// //
selectOutCode(val) { selectOutCode(val) {

View File

@ -85,7 +85,6 @@
type="primary" type="primary"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-if="scope.row.taskStatus == 1" v-if="scope.row.taskStatus == 1"
v-hasPermi="['purchase:info:edit']"
> >
出库 出库
</el-button> </el-button>
@ -97,7 +96,6 @@
type="danger" type="danger"
@click="handleDeletePurchase(scope.row)" @click="handleDeletePurchase(scope.row)"
v-if="scope.row.taskStatus == 1" v-if="scope.row.taskStatus == 1"
v-hasPermi="['purchase:info:remove']"
> >
删除 删除
</el-button> </el-button>

View File

@ -1,20 +1,20 @@
<template> <template>
<div> <div>
<el-form :model="maForm" ref="maForm" size="small" :inline="true" label-width="120px"> <el-form :model="maForm" ref="maForm" size="small" :inline="true" label-width="120px">
<el-form-item label="租赁单位" prop="teamName"> <el-form-item label="租赁工程" prop="projectId">
<el-input <el-input
v-model="maForm.teamName" v-model="maForm.projectName"
placeholder="租赁单位" placeholder="租赁工程"
clearable clearable
maxlength="50" maxlength="50"
style="width: 240px" style="width: 240px"
readonly readonly
/> />
</el-form-item> </el-form-item>
<el-form-item label="租赁工程" prop="projectId"> <el-form-item label="领用班组" prop="teamName">
<el-input <el-input
v-model="maForm.projectName" v-model="maForm.teamName"
placeholder="租赁工程" placeholder="领用班组"
clearable clearable
maxlength="50" maxlength="50"
style="width: 240px" style="width: 240px"
@ -33,9 +33,9 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="联系电话" prop="phone"> <el-form-item label="联系电话" prop="relPhone">
<el-input <el-input
v-model="maForm.phone" v-model="maForm.relPhone"
placeholder="联系电话" placeholder="联系电话"
clearable clearable
maxlength="50" maxlength="50"