直转申请

This commit is contained in:
bb_pan 2025-02-18 19:25:17 +08:00
parent 2db82be6a0
commit 0f587e9a4f
3 changed files with 372 additions and 178 deletions

View File

@ -59,4 +59,66 @@ export function deleteLeaseTask(id) {
url: '/material/leaseTask/' + id, url: '/material/leaseTask/' + id,
method: 'delete' method: 'delete'
}) })
}
// 根据协议id查再用列表
export function getUseringData(query) {
return request({
url: '/material/directRotation/getUseringData',
method: 'get',
params: query
})
}
// 领用申请提交-新增
export function receiveSubmit(data) {
return request({
url: '/material/directRotation/submit',
method: 'post',
data
})
}
// 领用申请提交-编辑
export function receiveEdit(data) {
return request({
url: '/material/directRotation/edit',
method: 'post',
data
})
}
// 领用申请提交-详情
export function receiveDetail(query) {
return request({
url: '/material/directRotation/getInfo',
method: 'get',
params: query
})
}
// 领用申请提交-删除
export function receiveDelete(id) {
return request({
url: '/material/directRotation/' + id,
method: 'delete'
})
}
// 领用申请查询-列表
export function getReceiveList(query) {
return request({
url: '/material/directRotation/list',
method: 'get',
params: query
})
}
// 物资类型-3级tree
export function getEquipmentThreeTypes(query) {
return request({
url: '/material/ma_type/equipmentThreeTypes',
method: 'get',
params: query
})
} }

View File

@ -5,9 +5,9 @@
<el-col :span="7" :offset="0"> <el-col :span="7" :offset="0">
<el-card shadow="always" :body-style="{ padding: '20px' }" style="min-width: 400px"> <el-card shadow="always" :body-style="{ padding: '20px' }" style="min-width: 400px">
<!-- card body --> <!-- card body -->
<el-form-item label="转出单位" prop="unitId"> <el-form-item label="转出单位" prop="backUnitId">
<treeselect <treeselect
v-model="maForm.unitId" v-model="maForm.backUnitId"
:disabled="isEdit || isDetail" :disabled="isEdit || isDetail"
:options="uniteList" :options="uniteList"
:normalizer="normalizer" :normalizer="normalizer"
@ -21,9 +21,9 @@
@select="uniteChange" @select="uniteChange"
/> />
</el-form-item> </el-form-item>
<el-form-item label="转出工程" prop="projectId"> <el-form-item label="转出工程" prop="backProId">
<treeselect <treeselect
v-model="maForm.projectId" v-model="maForm.backProId"
:disabled="isEdit || isDetail" :disabled="isEdit || isDetail"
:options="projectList" :options="projectList"
:normalizer="normalizer" :normalizer="normalizer"
@ -37,9 +37,9 @@
@select="projectChange" @select="projectChange"
/> />
</el-form-item> </el-form-item>
<el-form-item label="转出人" prop="leasePerson"> <el-form-item label="转出人" prop="backMan">
<el-input <el-input
v-model="maForm.leasePerson" v-model="maForm.backMan"
placeholder="请输入转出人" placeholder="请输入转出人"
clearable clearable
maxlength="50" maxlength="50"
@ -47,9 +47,9 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="联系电话" prop="phone"> <el-form-item label="联系电话" prop="backPhone">
<el-input <el-input
v-model="maForm.phone" v-model="maForm.backPhone"
placeholder="请输入联系电话" placeholder="请输入联系电话"
clearable clearable
maxlength="11" maxlength="11"
@ -71,11 +71,11 @@
<el-col :span="7" :offset="0"> <el-col :span="7" :offset="0">
<el-card shadow="always" :body-style="{ padding: '20px' }" style="min-width: 400px"> <el-card shadow="always" :body-style="{ padding: '20px' }" style="min-width: 400px">
<!-- card body --> <!-- card body -->
<el-form-item label="转入单位" prop="unitIdTo"> <el-form-item label="转入单位" prop="leaseUnitId">
<treeselect <treeselect
v-model="maForm.unitIdTo" v-model="maForm.leaseUnitId"
:disabled="isDetail" :disabled="isDetail"
:options="uniteList" :options="lessUniteList"
:normalizer="normalizer" :normalizer="normalizer"
:show-count="true" :show-count="true"
style="width: 240px" style="width: 240px"
@ -84,14 +84,14 @@
noOptionsText="没有数据" noOptionsText="没有数据"
noResultsText="没有搜索结果" noResultsText="没有搜索结果"
placeholder="请选择转入单位" placeholder="请选择转入单位"
@select="uniteChange" @select="leaseUniteChange"
/> />
</el-form-item> </el-form-item>
<el-form-item label="转入工程" prop="projectIdTo"> <el-form-item label="转入工程" prop="leaseProId">
<treeselect <treeselect
v-model="maForm.projectIdTo" v-model="maForm.leaseProId"
:disabled="isDetail" :disabled="isDetail"
:options="projectList" :options="leaseProjectList"
:normalizer="normalizer" :normalizer="normalizer"
:show-count="true" :show-count="true"
style="width: 240px" style="width: 240px"
@ -100,12 +100,12 @@
noOptionsText="没有数据" noOptionsText="没有数据"
noResultsText="没有搜索结果" noResultsText="没有搜索结果"
placeholder="请选择转入工程" placeholder="请选择转入工程"
@select="projectChange" @select="leaseProjectChange"
/> />
</el-form-item> </el-form-item>
<el-form-item label="转入人" prop="leasePersonTo"> <el-form-item label="转入人" prop="leaseMan">
<el-input <el-input
v-model="maForm.leasePersonTo" v-model="maForm.leaseMan"
placeholder="请输入转入人" placeholder="请输入转入人"
clearable clearable
maxlength="50" maxlength="50"
@ -113,9 +113,9 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="联系电话" prop="phoneTo"> <el-form-item label="联系电话" prop="leasePhone">
<el-input <el-input
v-model="maForm.phoneTo" v-model="maForm.leasePhone"
placeholder="请输入联系电话" placeholder="请输入联系电话"
clearable clearable
maxlength="11" maxlength="11"
@ -127,10 +127,10 @@
</el-col> </el-col>
<el-col :span="8" :offset="0"> <el-col :span="8" :offset="0">
<el-form-item label="" prop="bmFileInfos"> <el-form-item label="" prop="dirUrls">
<el-upload <el-upload
:action="uploadUrl" :action="uploadUrl"
:file-list="maForm.bmFileInfos" :file-list="maForm.dirUrls"
:show-file-list="true" :show-file-list="true"
:auto-upload="true" :auto-upload="true"
:key="uploadKey" :key="uploadKey"
@ -175,15 +175,25 @@
</el-row> </el-row>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-form v-show="showSearch" :model="queryParams" ref="queryForm" size="small" inline> <el-form v-show="showSearch" :model="queryParams" ref="queryForm" size="small" inline>
<el-form-item label="物资类型" prop="materialType"> <el-form-item label="物资类型" prop="maId">
<el-select v-model="queryParams.materialType" placeholder="请选择物资类型" clearable filterable> <treeselect
<el-option v-for="item in materialTypeOpts" :key="item.value" :label="item.label" :value="item.value" /> v-model="queryParams.maId"
</el-select> :options="materialTypeOpts"
:normalizer="normalizer2"
:show-count="true"
style="width: 240px"
:disable-branch-nodes="true"
noChildrenText="没有数据了"
noOptionsText="没有数据"
noResultsText="没有搜索结果"
placeholder="请选择物资类型"
@select="selectMaType"
/>
</el-form-item> </el-form-item>
<el-form-item label="规格型号" prop="typeModelName"> <el-form-item label="规格型号" prop="typeId">
<el-select v-model="queryParams.typeModelName" placeholder="请选择规格型号" clearable filterable> <el-select v-model="queryParams.typeId" placeholder="请选择规格型号" clearable filterable>
<el-option v-for="item in typeModelNameOpts" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in typeModelNameOpts" :key="item.typeId" :label="item.name" :value="item.typeId" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="关键字" prop="keyWord"> <el-form-item label="关键字" prop="keyWord">
@ -210,7 +220,7 @@
</el-row> </el-row>
</el-form> </el-form>
<el-table v-loading="loading" :data="equipmentList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" ref="equipmentList" :data="equipmentList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column align="center" label="序号" type="index" width="55" /> <el-table-column align="center" label="序号" type="index" width="55" />
<el-table-column <el-table-column
@ -221,9 +231,9 @@
align="center" align="center"
show-overflow-tooltip show-overflow-tooltip
> >
<template v-slot="scope" v-if="column.prop == 'preNum'"> <template v-slot="scope" v-if="column.prop == 'directNum'">
<el-input-number <el-input-number
v-model="scope.row.preNum" v-model="scope.row.directNum"
controls-position="right" controls-position="right"
:precision="0" :precision="0"
style="width: 100%" style="width: 100%"
@ -245,15 +255,9 @@
</template> </template>
<script> <script>
import { equipmentTypeTree } from '@/api/purchase/goodsArrived' import { getMaTypeOpt } from '@/api/ma/base'
import { getListProject, getListUnite, getAgreement } from '@/api/lease/apply' import { getListProject, getListUnite, getAgreement } from '@/api/lease/apply'
import { import { getUseringData, receiveSubmit, receiveEdit, receiveDetail, getEquipmentThreeTypes } from '@/api/business/index'
getStandardConfigList,
getListsByConfigId,
addLeaseTask,
editLeaseTask,
getLeaseTaskDetail
} from '@/api/business/index'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@ -270,6 +274,8 @@ export default {
loadingTwo: false, loadingTwo: false,
// //
multipleSelection: [], multipleSelection: [],
//
multipleSelectionTemp: [],
// //
single: true, single: true,
// //
@ -287,65 +293,25 @@ export default {
}, },
// //
uniteList: [], uniteList: [],
lessUniteList: [],
// //
projectList: [], projectList: [],
leaseProjectList: [],
// //
materialTypeOpts: [ materialTypeOpts: [],
{ label: '物资类型1', value: '1' },
{ label: '物资类型2', value: '2' },
{ label: '物资类型3', value: '3' }
],
// //
typeModelNameOpts: [ typeModelNameOpts: [],
{ label: '规格型号1', value: '1' },
{ label: '规格型号2', value: '2' },
{ label: '规格型号3', value: '3' }
],
// //
equipmentList: [ equipmentList: [],
{
id: 1,
preNum: 0,
maTypeName: '物资类型1',
typeName: '规格型号1',
unitName: '计量单位1',
applyNum: 0,
leasePerson: '领料人1',
arrivalTime: '2021-08-01',
isActive: false
},
{
id: 2,
preNum: 0,
maTypeName: '物资类型2',
typeName: '规格型号2',
unitName: '计量单位2',
applyNum: 0,
leasePerson: '领料人2',
arrivalTime: '2021-08-02',
isActive: false
},
{
id: 3,
preNum: 0,
maTypeName: '物资类型3',
typeName: '规格型号3',
unitName: '计量单位3',
applyNum: 0,
leasePerson: '领料人3',
arrivalTime: '2021-08-03',
isActive: false
}
],
// //
tableColumns: [ tableColumns: [
{ label: '直转数量', prop: 'preNum' }, { label: '直转数量', prop: 'directNum' },
{ label: '类型名称', prop: 'maTypeName' }, { label: '类型名称', prop: 'typeName' },
{ label: '规格型号', prop: 'typeName' }, { label: '规格型号', prop: 'typeModelName' },
{ label: '计量单位', prop: 'unitName' }, { label: '计量单位', prop: 'unitName' },
{ label: '领料数量', prop: 'applyNum' }, { label: '领料数量', prop: 'useNum' },
{ label: '领料人', prop: 'leasePerson' }, { label: '领料人', prop: 'leasePerson' },
{ label: '领料日期', prop: 'arrivalTime' } { label: '领料日期', prop: 'startTime' }
], ],
// //
title: '', title: '',
@ -356,16 +322,24 @@ export default {
projectId: null, projectId: null,
// //
queryParams: { queryParams: {
materialType: '', // maId: undefined, //
typeModelName: '', // typeId: '', //
keyWord: '' keyWord: ''
}, },
maForm: { maForm: {
unitId: undefined, backUnitId: undefined,
projectId: undefined, backProId: undefined,
arrivalTime: '', backMan: '', //
applyCode: '', // backPhone: '', //
bmFileInfos: [] // backAgreementId: '', // id
backAgreementCode: '', //
leaseUnitId: undefined, //
leaseProId: undefined, //
leaseMan: '', //
leasePhone: '', //
leaseAgreementId: '', // id
leaseAgreementCode: '', //
dirUrls: [] //
}, },
// //
form: {}, form: {},
@ -375,28 +349,28 @@ export default {
}, },
// //
rules: { rules: {
unitId: [ backUnitId: [
{ {
required: true, required: true,
message: '请选择转出单位', message: '请选择转出单位',
trigger: 'blur' trigger: 'blur'
} }
], ],
projectId: [ backProId: [
{ {
required: true, required: true,
message: '请选择转出工程', message: '请选择转出工程',
trigger: 'blur' trigger: 'blur'
} }
], ],
leasePerson: [ backMan: [
{ {
required: true, required: true,
message: '请输入转出人', message: '请输入转出人',
trigger: 'blur' trigger: 'blur'
} }
], ],
phone: [ backPhone: [
{ required: true, message: '联系电话不能为空', trigger: 'blur' }, { required: true, message: '联系电话不能为空', trigger: 'blur' },
{ {
pattern: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/, pattern: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/,
@ -404,28 +378,28 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
unitIdTo: [ leaseUnitId: [
{ {
required: true, required: true,
message: '请选择转入单位', message: '请选择转入单位',
trigger: 'blur' trigger: 'blur'
} }
], ],
projectIdTo: [ leaseProId: [
{ {
required: true, required: true,
message: '请选择转入工程', message: '请选择转入工程',
trigger: 'blur' trigger: 'blur'
} }
], ],
leasePersonTo: [ leaseMan: [
{ {
required: true, required: true,
message: '请输入转入人', message: '请输入转入人',
trigger: 'blur' trigger: 'blur'
} }
], ],
phoneTo: [ leasePhone: [
{ required: true, message: '联系电话不能为空', trigger: 'blur' }, { required: true, message: '联系电话不能为空', trigger: 'blur' },
{ {
pattern: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/, pattern: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/,
@ -433,7 +407,7 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
bmFileInfos: [ dirUrls: [
{ {
required: true, // () required: true, // ()
message: '请上传图片', message: '请上传图片',
@ -441,8 +415,6 @@ export default {
} }
] ]
}, },
//
isFileFbs: false,
urlTemp: '', urlTemp: '',
delBusinessFileIdList: [], delBusinessFileIdList: [],
// //
@ -455,7 +427,7 @@ export default {
computed: { computed: {
//1 //1
uploadDisabled() { uploadDisabled() {
return this.maForm.bmFileInfos && this.maForm.bmFileInfos.length == 3 return this.maForm.dirUrls && this.maForm.dirUrls.length == 3
} }
}, },
created() { created() {
@ -478,7 +450,7 @@ export default {
const obj = Object.assign({}, this.$route, { title: '直转申请' }) const obj = Object.assign({}, this.$route, { title: '直转申请' })
this.$tab.updatePage(obj) this.$tab.updatePage(obj)
} }
this.projectInfoList() // this.projectInfoList() //
if (this.isEdit || this.isDetail) { if (this.isEdit || this.isDetail) {
console.log('isEdit', this.isEdit) console.log('isEdit', this.isEdit)
this.getTaskInfo() this.getTaskInfo()
@ -486,13 +458,113 @@ export default {
console.log(this.$store, 'this.$store.getters') console.log(this.$store, 'this.$store.getters')
console.log(this.$route.query, 'this.$route.query') console.log(this.$route.query, 'this.$route.query')
}, },
watch:{
// this.maForm.backAgreementId
'maForm.backAgreementId': {
handler: function (val, oldVal) {
this.getMaTypeOpt()
},
deep: true
}
},
methods: { methods: {
// //
handleQuery() {}, handleQuery() {
this.getList()
},
// //
handleReset() {}, handleReset() {
this.$refs.queryForm.resetFields()
this.getList()
},
// //
getList() {}, async getList() {
try {
const params = {
agreementId: this.maForm.backAgreementId,
...this.queryParams
}
const res = await getUseringData(params)
console.log('🚀 ~ 获取列表 ~ res:', res)
this.equipmentList = res.data
if (this.isEdit || this.isDetail) {
this.$nextTick(() => {
this.multipleSelection = this.multipleSelectionTemp
console.log('🚀 ~ 获取列表 ~ this.equipmentList:', this.multipleSelection)
this.multipleSelection.forEach(row => {
const foundRow = this.equipmentList.find(item => item.typeId === row.typeId)
console.log('🚀 ~ getList ~ foundRow:', foundRow)
if (foundRow) {
// directNum foundRow
foundRow.directNum = row.directNum
// toggleRowSelection
this.$refs.equipmentList.toggleRowSelection(foundRow)
}
})
})
}
} catch (error) {
console.log('🚀 ~ 获取列表 ~ error:', error)
this.tableList = []
}
},
//
async getMaTypeOpt() {
try {
const params = {
agreementId: this.maForm.backAgreementId
}
console.log('🚀 ~ getMaTypeOpt ~ params:', params)
const res = await getEquipmentThreeTypes(params)
console.log('🚀 ~ getMaTypeOpt ~ res:', res)
this.materialTypeOpts = res.data
} catch (error) {
console.log('🚀 ~ getMaTypeOpt ~ error:', error)
}
},
//
async getTypeModelNameOpt(type) {
try {
const params = {
typeId: type.typeId
}
const res = await getMaTypeOpt(params)
console.log('🚀 ~ getTypeModelNameOpt ~ res:', res)
this.typeModelNameOpts = res.data
} catch (error) {
console.log('🚀 ~ getTypeModelNameOpt ~ error:', error)
}
},
// id
async getAgreementId() {
try {
const params = {
unitId: this.maForm.backUnitId,
projectId: this.maForm.backProId
}
const res = await getAgreement(params)
console.log('🚀 ~ getAgreementId ~ res:', res)
this.maForm.backAgreementId = res.data.agreementId
this.maForm.backAgreementCode = res.data.agreementCode
this.getList()
} catch (error) {
console.log('🚀 ~ getAgreementId ~ error:', error)
}
},
async getLeaseAgreementId() {
try {
const params = {
unitId: this.maForm.leaseUnitId,
projectId: this.maForm.leaseProId
}
const res = await getAgreement(params)
console.log('🚀 ~ getAgreementId ~ res:', res)
this.maForm.leaseAgreementId = res.data.agreementId
this.maForm.leaseAgreementCode = res.data.agreementCode
} catch (error) {
console.log('🚀 ~ getAgreementId ~ error:', error)
}
},
// //
handleApplyRecord() { handleApplyRecord() {
this.$router.push({ path: '/business/businessHandlingRecord/directApplyRecord' }) this.$router.push({ path: '/business/businessHandlingRecord/directApplyRecord' })
@ -508,27 +580,52 @@ export default {
children: node.children children: node.children
} }
}, },
uniteChange(val) { normalizer2(node) {
if (val.typeKey == 'fbs') { if (node.children && !node.children.length) {
this.isFileFbs = true delete node.children
this.rules['bmFileInfos'][0].required = true
} else {
this.isFileFbs = false
this.rules['bmFileInfos'][0].required = false
} }
return {
id: node.typeId,
label: node.typeName,
children: node.children
}
},
selectMaType(val) {
console.log('val', val)
this.queryParams.typeModelName = ''
this.typeModelNameOpts = []
this.getTypeModelNameOpt(val)
},
uniteChange(val) {
setTimeout(() => { setTimeout(() => {
getListProject({ unitId: this.maForm.unitId }).then(response => { getListProject({ unitId: this.maForm.backUnitId }).then(response => {
this.projectList = response.data this.projectList = response.data
this.maForm.projectId = null this.maForm.backProId = null
}) })
}, 500) }, 500)
}, },
projectChange(val) { projectChange(val) {
setTimeout(() => { setTimeout(() => {
// projectId: this.maForm.projectId
getListUnite({}).then(response => { getListUnite({}).then(response => {
this.uniteList = response.data this.uniteList = response.data
}) })
this.getAgreementId()
}, 500)
},
leaseUniteChange(val) {
setTimeout(() => {
getListProject({ unitId: this.maForm.leaseUnitId }).then(res => {
this.leaseProjectList = res.data
this.maForm.leaseProId = null
})
}, 500)
},
leaseProjectChange(val) {
setTimeout(() => {
getListUnite({}).then(res => {
this.leaseUniteList = res.data
})
this.getLeaseAgreementId()
}, 500) }, 500)
}, },
/** 租赁单位和工程-下拉选 */ /** 租赁单位和工程-下拉选 */
@ -536,33 +633,35 @@ export default {
if (!this.isEdit) { if (!this.isEdit) {
getListUnite({ projectId: null }).then(response => { getListUnite({ projectId: null }).then(response => {
this.uniteList = response.data this.uniteList = response.data
this.lessUniteList = response.data
}) })
getListProject({ unitId: null }).then(response => { getListProject({ unitId: null }).then(response => {
this.projectList = response.data this.projectList = response.data
this.leaseProjectList = response.data
}) })
} else { } else {
getListUnite({ projectId: null }).then(response => { getListUnite({ projectId: null }).then(response => {
this.uniteList = response.data this.uniteList = response.data
this.lessUniteList = response.data
}) })
getListProject({ unitId: this.maForm.unitId }).then(response => { getListProject({ unitId: this.maForm.backUnitId }).then(response => {
this.projectList = response.data this.projectList = response.data
}) })
getListProject({ unitId: this.maForm.leaseUnitId }).then(response => {
this.leaseProjectList = response.data
})
} }
}, },
//--- //---
async getTaskInfo() { async getTaskInfo() {
try { try {
const loading = this.$loading() const loading = this.$loading()
const res = await getLeaseTaskDetail(this.id) const res = await receiveDetail({ id: this.id })
console.log('🚀 ~ getTaskInfo ~ res:', res) console.log('🚀 ~ getTaskInfo ~ res:', res)
this.maForm = res.data.leaseApplyInfo this.maForm = res.data
this.maForm.unitId = res.data.leaseApplyInfo.leaseUnitId this.multipleSelectionTemp = res.data.directApplyDetails
this.maForm.projectId = res.data.leaseApplyInfo.leaseProjectId this.getList()
this.equipmentList = res.data.leaseApplyDetailsList console.log('🚀 ~ getTaskInfo ~ this.equipmentList:', this.equipmentList)
// bmFileInfos
if (this.maForm.bmFileInfos && this.maForm.bmFileInfos.length > 0) {
this.isFileFbs = true
}
loading.close() loading.close()
} catch (error) { } catch (error) {
console.log('🚀 ~ error:', error) console.log('🚀 ~ error:', error)
@ -583,25 +682,59 @@ export default {
}, },
/** 保存按钮操作 */ /** 保存按钮操作 */
handleSave() { handleSave() {
// console.log(this.equipmentList)
console.log('maForm', this.maForm) console.log('maForm', this.maForm)
console.log('选中数据', this.multipleSelection) console.log('选中数据', this.multipleSelection)
// if (this.equipmentList.length > 0) { if (this.multipleSelection.length > 0) {
// this.$refs['maForm'].validate(async valid => { this.$refs['maForm'].validate(valid => {
// if (valid) { if (valid) {
// } this.$modal.confirm('是否确认申请').then(async () => {
// }) const isPass = this.multipleSelection.every(item => {
// } else { return item.directNum
// this.$modal.msgError('') })
// } if (!isPass) {
this.$message.error('请填写直转数量且不能为0')
return
}
const loading = this.$loading()
try {
const params = {
directApplyInfo: this.maForm,
directApplyInfoDetails: this.multipleSelection
}
if (this.isEdit) {
delete params.directApplyInfo.directApplyDetails
console.log('🚀 ~ this.$modal.confirm ~ params:', params)
const res = await receiveEdit(params)
console.log('🚀 ~ handleSave ~ res:', res)
} else {
const res = await receiveSubmit(params)
console.log('🚀 ~ handleSave ~ res:', res)
}
this.$message.success('操作成功')
this.$refs['maForm'].resetFields()
this.equipmentList = []
this.multipleSelection = []
this.delBusinessFileIdList = []
loading.close()
} catch (error) {
console.log('🚀 ~ handleSave ~ error:', error)
loading.close()
}
})
}
})
} else {
this.$modal.msgError('请先选择转出数据')
}
}, },
// //
handleChangeBusinessList(file, fileList) { handleChangeBusinessList(file, fileList) {
const fileListTemp = fileList.filter(item => { const fileListTemp = fileList.filter(item => {
return item.uid != file.uid return item.uid != file.uid
}) })
const parts = file.name.split('.') const parts = file.name?.split('.')
const extension = parts.pop().toLowerCase() const extension = parts?.pop().toLowerCase()
if (fileList.length > 3) { if (fileList.length > 3) {
this.$message.warning('最多上传3张附件') this.$message.warning('最多上传3张附件')
fileList = fileList.filter(item => { fileList = fileList.filter(item => {
@ -633,10 +766,10 @@ export default {
this.urlTemp = require('@/assets/file.png') this.urlTemp = require('@/assets/file.png')
} }
}) })
this.maForm.bmFileInfos = fileList this.maForm.dirUrls = fileList
console.log('🚀 ~ handleChangeBusinessList ~ this.bmFileInfos:', this.bmFileInfos) console.log('🚀 ~ handleChangeBusinessList ~ this.dirUrls:', this.dirUrls)
// //
this.$refs.maForm.validateField('bmFileInfos') this.$refs.maForm.validateField('dirUrls')
}, },
// //
isImage(file) { isImage(file) {
@ -650,16 +783,16 @@ export default {
// , // ,
updataIf(e) { updataIf(e) {
if (e.fileName) { if (e.fileName) {
const parts = e.fileName.split('.') const parts = e.fileName?.split('.')
const extension = parts.pop().toLowerCase() const extension = parts?.pop().toLowerCase()
if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') { if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') {
return false return false
} else { } else {
return true return true
} }
} else { } else {
const parts = e.name.split('.').toLowerCase() const parts = e.name?.split('.')
const extension = parts.pop() const extension = parts?.pop().toLowerCase()
if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') { if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') {
return false return false
} else { } else {
@ -670,8 +803,8 @@ export default {
//- //-
picturePreviewFbs(file) { picturePreviewFbs(file) {
this.dialogImageUrl = file.url.replaceAll('#', '%23') this.dialogImageUrl = file.url.replaceAll('#', '%23')
const parts = file.name.split('.') const parts = file.name?.split('.')
const extension = parts.pop() const extension = parts?.pop()
if (extension === 'pdf') { if (extension === 'pdf') {
const windowName = file.name const windowName = file.name
window.open(file.url, windowName) window.open(file.url, windowName)
@ -682,12 +815,12 @@ export default {
//- //-
handleRemoveElectricianImgList(file, fileList) { handleRemoveElectricianImgList(file, fileList) {
let sum = 0 let sum = 0
this.maForm.bmFileInfos.forEach((item, index) => { this.maForm.dirUrls.forEach((item, index) => {
if (item.uid == file.uid) { if (item.uid == file.uid) {
sum = index sum = index
} }
}) })
this.maForm.bmFileInfos.splice(sum, 1) this.maForm.dirUrls.splice(sum, 1)
if (file.status == 'success') { if (file.status == 'success') {
this.delBusinessFileIdList.push(file.url) this.delBusinessFileIdList.push(file.url)
} }
@ -699,9 +832,8 @@ export default {
downloadFile({ fileName: file.name, fileData: file.raw, fileType: 'application/vnd.ms-excel;charset=utf-8' }) downloadFile({ fileName: file.name, fileData: file.raw, fileType: 'application/vnd.ms-excel;charset=utf-8' })
} else if (file.status === 'success') { } else if (file.status === 'success') {
downloadFileData({ fileName: file.name, fileUrl: file.url }) downloadFileData({ fileName: file.name, fileUrl: file.url })
// downloadFileData({ fileName: file.name,fileUrl:file.url })
} }
}, }
} }
} }
</script> </script>

View File

@ -22,8 +22,8 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="审核状态" prop="taskStatus"> <el-form-item label="审核状态" prop="status">
<el-select v-model="queryParams.taskStatus" placeholder="请选择审核状态" clearable> <el-select v-model="queryParams.status" placeholder="请选择审核状态" clearable>
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -64,12 +64,12 @@
align="center" align="center"
> >
<!-- 插槽 --> <!-- 插槽 -->
<template v-slot="scope" v-if="column.prop == 'taskStatus'"> <template v-slot="scope" v-if="column.prop == 'status'">
<el-tag v-if="scope.row.taskStatus == '0'" type="warning" size="mini" style="margin-right: 5px"> <el-tag v-if="scope.row.status == '0'" type="warning" size="mini" style="margin-right: 5px">
待审核 待审核
</el-tag> </el-tag>
<el-tag v-else-if="scope.row.taskStatus == '1'" size="mini" style="margin-right: 5px">审核中</el-tag> <el-tag v-else-if="scope.row.status == '1'" size="mini" style="margin-right: 5px">审核中</el-tag>
<el-tag v-else-if="scope.row.taskStatus == '2'" type="success" size="mini" style="margin-right: 5px"> <el-tag v-else-if="scope.row.status == '2'" type="success" size="mini" style="margin-right: 5px">
已完成 已完成
</el-tag> </el-tag>
</template> </template>
@ -79,7 +79,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="mini" icon="el-icon-search" @click="handleEdit(scope.row, 1)">查看</el-button> <el-button type="text" size="mini" icon="el-icon-search" @click="handleEdit(scope.row, 1)">查看</el-button>
<el-button <el-button
v-if="scope.row.taskStatus == '0'" v-if="scope.row.status == '0'"
type="text" type="text"
size="mini" size="mini"
icon="el-icon-edit" icon="el-icon-edit"
@ -88,7 +88,7 @@
编辑 编辑
</el-button> </el-button>
<el-button <el-button
v-if="scope.row.taskStatus == '0'" v-if="scope.row.status == '0'"
type="text" type="text"
size="mini" size="mini"
icon="el-icon-delete" icon="el-icon-delete"
@ -113,7 +113,7 @@
</template> </template>
<script> <script>
import { getLeaseTaskList, deleteLeaseTask } from '@/api/business/index' import { getReceiveList, receiveDelete } from '@/api/business/index'
export default { export default {
data() { data() {
@ -123,7 +123,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
keyWord: '', // keyWord: '', //
taskStatus: '', // status: '', //
timeRange: [] // timeRange: [] //
}, },
// //
@ -136,13 +136,13 @@ export default {
// //
tableColumns: [ tableColumns: [
{ label: '申请时间', prop: 'createTime' }, { label: '申请时间', prop: 'createTime' },
{ label: '申请人', prop: 'createBy' }, { label: '申请人', prop: 'leaseMan' },
{ label: '转出单位', prop: 'leaseUnit' }, { label: '转出单位', prop: 'backUnitName' },
{ label: '转出工程', prop: 'leaseProject' }, { label: '转出工程', prop: 'backProName' },
{ label: '转入单位', prop: 'leaseUnitTo' }, { label: '转入单位', prop: 'leaseUnitName' },
{ label: '转入工程', prop: 'leaseProjectTo' }, { label: '转入工程', prop: 'leaseProName' },
{ label: '物资类型', prop: 'maTypeNames' }, { label: '物资类型', prop: 'typeName' },
{ label: '状态', prop: 'taskStatus' } { label: '状态', prop: 'status' }
], ],
// //
tableList: [] tableList: []
@ -172,10 +172,10 @@ export default {
startTime: this.queryParams.timeRange[0] || '', startTime: this.queryParams.timeRange[0] || '',
endTime: this.queryParams.timeRange[1] || '' endTime: this.queryParams.timeRange[1] || ''
} }
const res = await getLeaseTaskList(params) const res = await getReceiveList(params)
console.log('🚀 ~ 获取列表 ~ res:', res) console.log('🚀 ~ 获取列表 ~ res:', res)
this.tableList = res.data.rows this.tableList = res.rows
this.total = res.data.total || 0 this.total = res.total || 0
} catch (error) { } catch (error) {
console.log('🚀 ~ 获取列表 ~ error:', error) console.log('🚀 ~ 获取列表 ~ error:', error)
this.tableList = [] this.tableList = []
@ -209,7 +209,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(async () => { }).then(async () => {
const res = await deleteLeaseTask(row.id) const res = await receiveDelete(row.id)
console.log('🚀 ~ 删除 ~ res:', res) console.log('🚀 ~ 删除 ~ res:', res)
this.getList() this.getList()
this.$message({ this.$message({