材料站-优化
This commit is contained in:
parent
2ca86860de
commit
acea73bb8a
|
|
@ -1,6 +1,6 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 登录方法
|
||||
// 登录方法 - 调试使用 - 产线环境需注释
|
||||
export function login(data) {
|
||||
return request({
|
||||
url: '/auth/login',
|
||||
|
|
|
|||
|
|
@ -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 => {
|
||||
return request({
|
||||
|
|
@ -285,7 +294,7 @@ export function equipmentTypeTree(data) {
|
|||
// 领料申请租赁工程下拉框
|
||||
export function getListProject(data) {
|
||||
return request({
|
||||
url: '/material/select/getProjectList',
|
||||
url: '/material/select/getProjectInfo',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
|
|
|
|||
|
|
@ -511,8 +511,9 @@ export default {
|
|||
this.getCompanyAndProjectFun()
|
||||
this.getCardListFun()
|
||||
this.getPie_1DataFun()
|
||||
await Promise.all([this.getUserInfoByUserName(), this.projectInfoList()])
|
||||
this.getUserInfoByIdCard()
|
||||
this.getUserInfoByUserName()
|
||||
// await Promise.all([this.getUserInfoByUserName(), this.projectInfoList()])
|
||||
// this.getUserInfoByIdCard()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -10,8 +10,21 @@
|
|||
label-width="100px"
|
||||
>
|
||||
<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-select
|
||||
v-if="backId == ''"
|
||||
v-model="queryParams.teamId"
|
||||
:disabled="backId != ''"
|
||||
placeholder="请选择班组"
|
||||
|
|
@ -28,23 +41,7 @@
|
|||
:data-key="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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-input v-else v-model="queryParams.teamName" disabled style="width: 240px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班组长" prop="backPerson">
|
||||
<el-input v-model="queryParams.backPerson" placeholder="请输入班组长" disabled style="width: 240px" />
|
||||
|
|
@ -257,14 +254,14 @@
|
|||
|
||||
<script>
|
||||
import {
|
||||
getProjectList,
|
||||
getListProject,
|
||||
getAgreementInfoByIdBackApi,
|
||||
getDeviceTreeByAgreementId,
|
||||
addBackApply,
|
||||
getBackApplyInfo,
|
||||
editBackApply,
|
||||
getMachineById,
|
||||
getBmTeamApi
|
||||
getTeamListApi
|
||||
} from '@/api/materialsStation'
|
||||
import { mapState } from 'vuex'
|
||||
import { getToken } from '@/utils/auth'
|
||||
|
|
@ -422,7 +419,8 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
this.GetUnitData()
|
||||
// this.GetUnitData()
|
||||
this.GetProData()
|
||||
if (this.backId) {
|
||||
//编辑
|
||||
this.rowId = this.backId
|
||||
|
|
@ -438,25 +436,33 @@ export default {
|
|||
const team = this.teamList.find(item => item.id === val)
|
||||
this.queryParams.backPerson = team ? team.relName : ''
|
||||
this.queryParams.teamName = team ? team.teamName : ''
|
||||
this.GetProData()
|
||||
},
|
||||
handleProChange(val) {
|
||||
console.log('🚀 ~ handleProChange ~ val:', val, this.queryParams)
|
||||
this.queryParams.relName = team ? team.relName : ''
|
||||
this.queryParams.phone = team ? team.relPhone : ''
|
||||
// this.GetProData()
|
||||
setTimeout(() => {
|
||||
this.GetAgreementInfoById()
|
||||
}, 300)
|
||||
},
|
||||
handleProChange(val) {
|
||||
console.log('🚀 ~ handleProChange ~ val:', val, this.queryParams)
|
||||
this.GetUnitData()
|
||||
},
|
||||
// 获取 来往单位 列表数据
|
||||
async GetUnitData() {
|
||||
const res = await getBmTeamApi({ isAll: 0 })
|
||||
this.teamList = res.data
|
||||
try {
|
||||
const res = await getTeamListApi({ isAll: 0, proId: this.queryParams.proId })
|
||||
this.teamList = res.data
|
||||
this.GetAgreementInfoById()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ GetUnitData ~ error:', error)
|
||||
}
|
||||
},
|
||||
// 获取 工程名称 列表数据
|
||||
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.queryParams.proId = null
|
||||
this.GetAgreementInfoById()
|
||||
// this.queryParams.proId = null
|
||||
// this.GetAgreementInfoById()
|
||||
},
|
||||
// 获取 设备树结构数据
|
||||
async GetDeviceTypeTreeFn(agreementId) {
|
||||
|
|
|
|||
|
|
@ -10,32 +10,31 @@
|
|||
label-width="100px"
|
||||
>
|
||||
<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-input
|
||||
v-model="queryParams.proName"
|
||||
placeholder="退料工程"
|
||||
clearable
|
||||
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 label="班组长" prop="backPerson">
|
||||
<el-input
|
||||
v-model="queryParams.backPerson"
|
||||
placeholder="请输入班组长"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
:disabled="isView"
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组长电话" prop="phone">
|
||||
|
|
@ -45,7 +44,7 @@
|
|||
clearable
|
||||
style="width: 240px"
|
||||
:maxlength="11"
|
||||
:disabled="isView"
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
|
|
@ -55,7 +54,7 @@
|
|||
placeholder="请输入备注"
|
||||
clearable
|
||||
rows="1"
|
||||
:disabled="isView"
|
||||
readonly
|
||||
type="textarea"
|
||||
maxlength="100"
|
||||
style="width: 240px"
|
||||
|
|
@ -64,47 +63,8 @@
|
|||
</el-row>
|
||||
<el-row></el-row>
|
||||
</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-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="类型名称" align="center" prop="typeName" :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">
|
||||
{{ scope.row.preNum }}
|
||||
</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>
|
||||
</template>
|
||||
</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="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 label="附件" align="center" prop="file">
|
||||
<!-- <el-table-column label="附件" align="center" prop="file">
|
||||
<template slot-scope="scope">
|
||||
<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
|
||||
size="mini"
|
||||
type="text"
|
||||
|
|
@ -181,38 +103,12 @@
|
|||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</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>
|
||||
|
||||
<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-column label="序号" type="index" width="55" align="center" />
|
||||
<el-table-column
|
||||
|
|
@ -228,11 +124,11 @@
|
|||
: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">
|
||||
<dict-tag :options="dict.type.ma_machine_status" :value="scope.row.maStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
label="损坏价值判定"
|
||||
prop="apDetection"
|
||||
|
|
@ -240,23 +136,10 @@
|
|||
width="160"
|
||||
: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 label="附件" align="center" width="100">
|
||||
<!-- <el-table-column label="附件" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<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
|
||||
size="mini"
|
||||
type="text"
|
||||
|
|
@ -267,13 +150,8 @@
|
|||
</el-button>
|
||||
</div>
|
||||
</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>
|
||||
<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> -->
|
||||
|
|
|
|||
|
|
@ -2,6 +2,19 @@
|
|||
<!-- 新增工机具 -->
|
||||
<div>
|
||||
<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-select
|
||||
v-if="!isEdit"
|
||||
|
|
@ -21,18 +34,6 @@
|
|||
</el-select>
|
||||
<el-input v-else v-model="maForm.teamName" disabled maxlength="50" style="width: 240px" />
|
||||
</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-input
|
||||
v-model="maForm.leasePerson"
|
||||
|
|
@ -43,9 +44,9 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-form-item label="联系电话" prop="relPhone">
|
||||
<el-input
|
||||
v-model="maForm.phone"
|
||||
v-model="maForm.relPhone"
|
||||
placeholder="请输入联系电话"
|
||||
clearable
|
||||
maxlength="11"
|
||||
|
|
@ -89,11 +90,11 @@
|
|||
@visible-change="handleVisibleChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in filteredOptions"
|
||||
:key="item.typeId"
|
||||
v-for="(item, index) in filteredOptions"
|
||||
:key="index"
|
||||
:label="item.fullPath"
|
||||
:value="item.typeId"
|
||||
:data-key="item.typeId"
|
||||
:data-key="index"
|
||||
>
|
||||
<span v-html="highlightText(item.fullPath, searchKeyword)"></span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">库存:{{ item.storageNum }}</span>
|
||||
|
|
@ -281,7 +282,8 @@ export default {
|
|||
purchaseNumber: '',
|
||||
standardConfig: undefined,
|
||||
bmFileInfos: [],
|
||||
fitNum: 1
|
||||
fitNum: 1,
|
||||
proId: undefined,
|
||||
},
|
||||
lastFitNum: 1,
|
||||
standardConfigList: [],
|
||||
|
|
@ -301,7 +303,7 @@ export default {
|
|||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
phone: [
|
||||
relPhone: [
|
||||
// { required: true, message: '联系电话不能为空', trigger: 'blur' },
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
|
|
@ -350,7 +352,8 @@ export default {
|
|||
this.id = this.editId
|
||||
this.getTaskInfo()
|
||||
} else {
|
||||
this.getBmTeam()
|
||||
// this.getBmTeam()
|
||||
this.projectInfoList()
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.fitNum = this.maForm.fitNum
|
||||
|
|
@ -386,7 +389,8 @@ export default {
|
|||
if (!this.maForm.teamId || !this.maForm.projectId) return
|
||||
getAgreement({
|
||||
teamId: this.maForm.teamId,
|
||||
projectId: this.maForm.projectId
|
||||
// projectId: this.maForm.projectId,
|
||||
proId: this.maForm.proId
|
||||
}).then(res => {
|
||||
console.log('🚀 ~ getAgreementId ~ res:', res)
|
||||
if (!res.data || !Array.isArray(res.data)) {
|
||||
|
|
@ -413,13 +417,27 @@ export default {
|
|||
async getBmTeam() {
|
||||
try {
|
||||
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
|
||||
this.uniteList = res.data
|
||||
this.maForm.teamId = res.data[0].id
|
||||
this.maForm.teamName = res.data[0].teamName
|
||||
this.maForm.leasePerson = res.data[0].relName
|
||||
this.projectInfoList()
|
||||
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.teamName = res.data[0].teamName
|
||||
this.maForm.leasePerson = res.data[0].relName
|
||||
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) {
|
||||
console.log('🚀 ~ getBmTeam ~ error:', error)
|
||||
}
|
||||
|
|
@ -433,23 +451,33 @@ export default {
|
|||
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) {
|
||||
console.log('🚀 ~ changeTeam ~ e:', e)
|
||||
this.maForm.projectId = null
|
||||
this.maForm.projectName = null
|
||||
// this.maForm.projectId = null
|
||||
// this.maForm.projectName = null
|
||||
// 查找对应的teamName
|
||||
const team = this.uniteList.find(item => item.id === e)
|
||||
this.maForm.teamName = team ? team.teamName : ''
|
||||
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)
|
||||
this.projectInfoList()
|
||||
// this.projectInfoList()
|
||||
},
|
||||
/** 机具类型 */
|
||||
equipmentType() {
|
||||
equipmentTypeTree({
|
||||
agreementIdList: this.agreementId,
|
||||
proId: this.maForm.projectId,
|
||||
teamId: this.maForm.teamId
|
||||
proId: this.maForm.proId,
|
||||
// teamId: this.maForm.teamId,
|
||||
teamName: this.maForm.teamName
|
||||
}).then(response => {
|
||||
this.equipmentTypeList = response.data
|
||||
// 处理并扁平化所有类型数据
|
||||
|
|
@ -554,9 +582,8 @@ export default {
|
|||
async getTaskInfo() {
|
||||
// this.loading = true;
|
||||
await getApplyInfo(this.id).then(response => {
|
||||
this.maForm = response.data.leaseApplyInfo
|
||||
this.maForm.teamId = response.data.leaseApplyInfo.teamId
|
||||
this.maForm.projectId = response.data.leaseApplyInfo.projectId
|
||||
Object.assign(this.maForm, response.data.leaseApplyInfo)
|
||||
this.maForm.projectId = response.data.leaseApplyInfo.proId
|
||||
this.equipmentList = response.data.leaseApplyDetailsList || []
|
||||
// 如果 bmFileInfos有值
|
||||
if (this.maForm.bmFileInfos.length > 0) {
|
||||
|
|
|
|||
|
|
@ -92,7 +92,6 @@
|
|||
type="primary"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-if="scope.row.taskStatus == 1"
|
||||
v-hasPermi="['purchase:info:edit']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
|
|
@ -105,7 +104,6 @@
|
|||
type="danger"
|
||||
@click="handleDeletePurchase(scope.row)"
|
||||
v-if="scope.row.taskStatus == 1"
|
||||
v-hasPermi="['purchase:info:remove']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
|
|
|
|||
|
|
@ -7,20 +7,20 @@
|
|||
:inline="true"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-form-item label="租赁单位" prop="teamName">
|
||||
<el-form-item label="租赁工程" prop="projectId">
|
||||
<el-input
|
||||
v-model="maForm.teamName"
|
||||
placeholder="租赁单位"
|
||||
v-model="maForm.projectName"
|
||||
placeholder="租赁工程"
|
||||
clearable
|
||||
maxlength="50"
|
||||
style="width: 240px"
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="租赁工程" prop="projectId">
|
||||
<el-form-item label="领用班组" prop="teamName">
|
||||
<el-input
|
||||
v-model="maForm.projectName"
|
||||
placeholder="租赁工程"
|
||||
v-model="maForm.teamName"
|
||||
placeholder="领用班组"
|
||||
clearable
|
||||
maxlength="50"
|
||||
style="width: 240px"
|
||||
|
|
@ -39,9 +39,9 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-form-item label="联系电话" prop="relPhone">
|
||||
<el-input
|
||||
v-model="maForm.phone"
|
||||
v-model="maForm.relPhone"
|
||||
placeholder="联系电话"
|
||||
clearable
|
||||
maxlength="50"
|
||||
|
|
|
|||
|
|
@ -2,6 +2,20 @@
|
|||
<!-- 新增工机具 -->
|
||||
<div>
|
||||
<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-select
|
||||
v-if="!isEdit"
|
||||
|
|
@ -21,19 +35,6 @@
|
|||
</el-select>
|
||||
<el-input v-else v-model="maForm.teamName" disabled maxlength="50" style="width: 240px" />
|
||||
</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-input
|
||||
v-model="maForm.leasePerson"
|
||||
|
|
@ -44,9 +45,9 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-form-item label="联系电话" prop="relPhone">
|
||||
<el-input
|
||||
v-model="maForm.phone"
|
||||
v-model="maForm.relPhone"
|
||||
placeholder="请输入联系电话"
|
||||
:disabled="isEdit"
|
||||
clearable
|
||||
|
|
@ -91,11 +92,11 @@
|
|||
@visible-change="handleVisibleChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in filteredOptions"
|
||||
:key="item.typeId"
|
||||
v-for="(item, index) in filteredOptions"
|
||||
:key="index"
|
||||
:label="item.fullPath"
|
||||
:value="item.typeId"
|
||||
:data-key="item.typeId"
|
||||
:data-key="index"
|
||||
>
|
||||
<span v-html="highlightText(item.fullPath, searchKeyword)"></span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">库存:{{ item.storageNum }}</span>
|
||||
|
|
@ -286,7 +287,8 @@ export default {
|
|||
remark: '',
|
||||
purchaseNumber: '',
|
||||
standardConfig: undefined,
|
||||
bmFileInfos: []
|
||||
bmFileInfos: [],
|
||||
proId: undefined,
|
||||
},
|
||||
standardConfigList: [],
|
||||
// 表单参数
|
||||
|
|
@ -311,7 +313,7 @@ export default {
|
|||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
phone: [
|
||||
relPhone: [
|
||||
// { required: true, message: '联系电话不能为空', trigger: 'blur' },
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
|
|
@ -373,7 +375,7 @@ export default {
|
|||
this.id = this.editId
|
||||
this.getTaskInfo()
|
||||
} else {
|
||||
this.getBmTeam()
|
||||
this.projectInfoList()
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
@ -393,7 +395,8 @@ export default {
|
|||
getAgreementId() {
|
||||
getAgreement({
|
||||
teamId: this.maForm.teamId,
|
||||
projectId: this.maForm.projectId
|
||||
// projectId: this.maForm.projectId,
|
||||
proId: this.maForm.proId
|
||||
}).then(res => {
|
||||
console.log('🚀 ~ getAgreementId ~ res:', res)
|
||||
if (!res.data || !Array.isArray(res.data)) {
|
||||
|
|
@ -419,28 +422,51 @@ export default {
|
|||
// 获取班组
|
||||
async getBmTeam() {
|
||||
try {
|
||||
const teamLeaderIdCard = sessionStorage.getItem('idCard')
|
||||
const res = await getBmTeamApi({ isAll: 0, teamLeaderIdCard })
|
||||
const idCard = sessionStorage.getItem('idCard')
|
||||
const res = await getBmTeamApi({ isAll: 0, idCard, projectId: this.maForm.projectId })
|
||||
if (!res.data || res.data.length === 0) return
|
||||
this.uniteList = res.data
|
||||
this.maForm.teamId = res.data[0].id
|
||||
this.maForm.teamName = res.data[0].teamName
|
||||
this.maForm.leasePerson = res.data[0].relName
|
||||
this.projectInfoList()
|
||||
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.teamName = res.data[0].teamName
|
||||
this.maForm.leasePerson = res.data[0].relName
|
||||
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) {
|
||||
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) {
|
||||
console.log('🚀 ~ changeTeam ~ e:', e)
|
||||
this.maForm.projectId = null
|
||||
this.maForm.projectName = null
|
||||
// this.maForm.projectId = null
|
||||
// this.maForm.projectName = null
|
||||
// 查找对应的teamName
|
||||
const team = this.uniteList.find(item => item.id === e)
|
||||
this.maForm.teamName = team ? team.teamName : ''
|
||||
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)
|
||||
this.projectInfoList()
|
||||
// this.projectInfoList()
|
||||
},
|
||||
/** 租赁单位和工程-下拉选 */
|
||||
async projectInfoList() {
|
||||
|
|
@ -455,8 +481,9 @@ export default {
|
|||
equipmentType() {
|
||||
equipmentTypeTree({
|
||||
agreementIdList: this.agreementId,
|
||||
proId: this.maForm.projectId,
|
||||
teamId: this.maForm.teamId
|
||||
proId: this.maForm.proId,
|
||||
// teamId: this.maForm.teamId,
|
||||
teamName: this.maForm.teamName
|
||||
}).then(response => {
|
||||
this.equipmentTypeList = response.data
|
||||
// 处理并扁平化所有类型数据
|
||||
|
|
@ -567,11 +594,8 @@ export default {
|
|||
if (response.msg && response.msg != '操作成功') {
|
||||
this.$message.warning(response.msg)
|
||||
}
|
||||
this.maForm = response.data.leaseApplyInfo
|
||||
this.maForm.teamId = response.data.leaseApplyInfo.teamId
|
||||
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)
|
||||
Object.assign(this.maForm, response.data.leaseApplyInfo)
|
||||
this.maForm.projectId = response.data.leaseApplyInfo.proId
|
||||
this.equipmentList = response.data.leaseApplyDetailsList || []
|
||||
if (this.equipmentList.length > 0) {
|
||||
this.equipmentList.forEach(item => {
|
||||
|
|
@ -734,7 +758,7 @@ export default {
|
|||
// 打开出库编码弹窗
|
||||
handleOutCode(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) {
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@
|
|||
type="primary"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-if="scope.row.taskStatus == 1"
|
||||
v-hasPermi="['purchase:info:edit']"
|
||||
>
|
||||
出库
|
||||
</el-button>
|
||||
|
|
@ -97,7 +96,6 @@
|
|||
type="danger"
|
||||
@click="handleDeletePurchase(scope.row)"
|
||||
v-if="scope.row.taskStatus == 1"
|
||||
v-hasPermi="['purchase:info:remove']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
|
|
|
|||
|
|
@ -1,20 +1,20 @@
|
|||
<template>
|
||||
<div>
|
||||
<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
|
||||
v-model="maForm.teamName"
|
||||
placeholder="租赁单位"
|
||||
v-model="maForm.projectName"
|
||||
placeholder="租赁工程"
|
||||
clearable
|
||||
maxlength="50"
|
||||
style="width: 240px"
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="租赁工程" prop="projectId">
|
||||
<el-form-item label="领用班组" prop="teamName">
|
||||
<el-input
|
||||
v-model="maForm.projectName"
|
||||
placeholder="租赁工程"
|
||||
v-model="maForm.teamName"
|
||||
placeholder="领用班组"
|
||||
clearable
|
||||
maxlength="50"
|
||||
style="width: 240px"
|
||||
|
|
@ -33,9 +33,9 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-form-item label="联系电话" prop="relPhone">
|
||||
<el-input
|
||||
v-model="maForm.phone"
|
||||
v-model="maForm.relPhone"
|
||||
placeholder="联系电话"
|
||||
clearable
|
||||
maxlength="50"
|
||||
|
|
|
|||
Loading…
Reference in New Issue