直转申请
This commit is contained in:
parent
2db82be6a0
commit
0f587e9a4f
|
|
@ -59,4 +59,66 @@ export function deleteLeaseTask(id) {
|
|||
url: '/material/leaseTask/' + id,
|
||||
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
|
||||
})
|
||||
}
|
||||
|
|
@ -5,9 +5,9 @@
|
|||
<el-col :span="7" :offset="0">
|
||||
<el-card shadow="always" :body-style="{ padding: '20px' }" style="min-width: 400px">
|
||||
<!-- card body -->
|
||||
<el-form-item label="转出单位" prop="unitId">
|
||||
<el-form-item label="转出单位" prop="backUnitId">
|
||||
<treeselect
|
||||
v-model="maForm.unitId"
|
||||
v-model="maForm.backUnitId"
|
||||
:disabled="isEdit || isDetail"
|
||||
:options="uniteList"
|
||||
:normalizer="normalizer"
|
||||
|
|
@ -21,9 +21,9 @@
|
|||
@select="uniteChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="转出工程" prop="projectId">
|
||||
<el-form-item label="转出工程" prop="backProId">
|
||||
<treeselect
|
||||
v-model="maForm.projectId"
|
||||
v-model="maForm.backProId"
|
||||
:disabled="isEdit || isDetail"
|
||||
:options="projectList"
|
||||
:normalizer="normalizer"
|
||||
|
|
@ -37,9 +37,9 @@
|
|||
@select="projectChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="转出人" prop="leasePerson">
|
||||
<el-form-item label="转出人" prop="backMan">
|
||||
<el-input
|
||||
v-model="maForm.leasePerson"
|
||||
v-model="maForm.backMan"
|
||||
placeholder="请输入转出人"
|
||||
clearable
|
||||
maxlength="50"
|
||||
|
|
@ -47,9 +47,9 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-form-item label="联系电话" prop="backPhone">
|
||||
<el-input
|
||||
v-model="maForm.phone"
|
||||
v-model="maForm.backPhone"
|
||||
placeholder="请输入联系电话"
|
||||
clearable
|
||||
maxlength="11"
|
||||
|
|
@ -71,11 +71,11 @@
|
|||
<el-col :span="7" :offset="0">
|
||||
<el-card shadow="always" :body-style="{ padding: '20px' }" style="min-width: 400px">
|
||||
<!-- card body -->
|
||||
<el-form-item label="转入单位" prop="unitIdTo">
|
||||
<el-form-item label="转入单位" prop="leaseUnitId">
|
||||
<treeselect
|
||||
v-model="maForm.unitIdTo"
|
||||
v-model="maForm.leaseUnitId"
|
||||
:disabled="isDetail"
|
||||
:options="uniteList"
|
||||
:options="lessUniteList"
|
||||
:normalizer="normalizer"
|
||||
:show-count="true"
|
||||
style="width: 240px"
|
||||
|
|
@ -84,14 +84,14 @@
|
|||
noOptionsText="没有数据"
|
||||
noResultsText="没有搜索结果"
|
||||
placeholder="请选择转入单位"
|
||||
@select="uniteChange"
|
||||
@select="leaseUniteChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="转入工程" prop="projectIdTo">
|
||||
<el-form-item label="转入工程" prop="leaseProId">
|
||||
<treeselect
|
||||
v-model="maForm.projectIdTo"
|
||||
v-model="maForm.leaseProId"
|
||||
:disabled="isDetail"
|
||||
:options="projectList"
|
||||
:options="leaseProjectList"
|
||||
:normalizer="normalizer"
|
||||
:show-count="true"
|
||||
style="width: 240px"
|
||||
|
|
@ -100,12 +100,12 @@
|
|||
noOptionsText="没有数据"
|
||||
noResultsText="没有搜索结果"
|
||||
placeholder="请选择转入工程"
|
||||
@select="projectChange"
|
||||
@select="leaseProjectChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="转入人" prop="leasePersonTo">
|
||||
<el-form-item label="转入人" prop="leaseMan">
|
||||
<el-input
|
||||
v-model="maForm.leasePersonTo"
|
||||
v-model="maForm.leaseMan"
|
||||
placeholder="请输入转入人"
|
||||
clearable
|
||||
maxlength="50"
|
||||
|
|
@ -113,9 +113,9 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="phoneTo">
|
||||
<el-form-item label="联系电话" prop="leasePhone">
|
||||
<el-input
|
||||
v-model="maForm.phoneTo"
|
||||
v-model="maForm.leasePhone"
|
||||
placeholder="请输入联系电话"
|
||||
clearable
|
||||
maxlength="11"
|
||||
|
|
@ -127,10 +127,10 @@
|
|||
</el-col>
|
||||
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="" prop="bmFileInfos">
|
||||
<el-form-item label="" prop="dirUrls">
|
||||
<el-upload
|
||||
:action="uploadUrl"
|
||||
:file-list="maForm.bmFileInfos"
|
||||
:file-list="maForm.dirUrls"
|
||||
:show-file-list="true"
|
||||
:auto-upload="true"
|
||||
:key="uploadKey"
|
||||
|
|
@ -175,15 +175,25 @@
|
|||
</el-row>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-form v-show="showSearch" :model="queryParams" ref="queryForm" size="small" inline>
|
||||
<el-form-item label="物资类型" prop="materialType">
|
||||
<el-select v-model="queryParams.materialType" placeholder="请选择物资类型" clearable filterable>
|
||||
<el-option v-for="item in materialTypeOpts" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<el-form-item label="物资类型" prop="maId">
|
||||
<treeselect
|
||||
v-model="queryParams.maId"
|
||||
: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 label="规格型号" prop="typeModelName">
|
||||
<el-select v-model="queryParams.typeModelName" placeholder="请选择规格型号" clearable filterable>
|
||||
<el-option v-for="item in typeModelNameOpts" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-form-item label="规格型号" prop="typeId">
|
||||
<el-select v-model="queryParams.typeId" placeholder="请选择规格型号" clearable filterable>
|
||||
<el-option v-for="item in typeModelNameOpts" :key="item.typeId" :label="item.name" :value="item.typeId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字" prop="keyWord">
|
||||
|
|
@ -210,7 +220,7 @@
|
|||
</el-row>
|
||||
</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 align="center" label="序号" type="index" width="55" />
|
||||
<el-table-column
|
||||
|
|
@ -221,9 +231,9 @@
|
|||
align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template v-slot="scope" v-if="column.prop == 'preNum'">
|
||||
<template v-slot="scope" v-if="column.prop == 'directNum'">
|
||||
<el-input-number
|
||||
v-model="scope.row.preNum"
|
||||
v-model="scope.row.directNum"
|
||||
controls-position="right"
|
||||
:precision="0"
|
||||
style="width: 100%"
|
||||
|
|
@ -245,15 +255,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { equipmentTypeTree } from '@/api/purchase/goodsArrived'
|
||||
import { getMaTypeOpt } from '@/api/ma/base'
|
||||
import { getListProject, getListUnite, getAgreement } from '@/api/lease/apply'
|
||||
import {
|
||||
getStandardConfigList,
|
||||
getListsByConfigId,
|
||||
addLeaseTask,
|
||||
editLeaseTask,
|
||||
getLeaseTaskDetail
|
||||
} from '@/api/business/index'
|
||||
import { getUseringData, receiveSubmit, receiveEdit, receiveDetail, getEquipmentThreeTypes } from '@/api/business/index'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
|
|
@ -270,6 +274,8 @@ export default {
|
|||
loadingTwo: false,
|
||||
// 选中数组
|
||||
multipleSelection: [],
|
||||
// 回显选中数据
|
||||
multipleSelectionTemp: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
|
|
@ -287,65 +293,25 @@ export default {
|
|||
},
|
||||
//租赁单位
|
||||
uniteList: [],
|
||||
lessUniteList: [],
|
||||
//租赁工程
|
||||
projectList: [],
|
||||
leaseProjectList: [],
|
||||
// 物资类型
|
||||
materialTypeOpts: [
|
||||
{ label: '物资类型1', value: '1' },
|
||||
{ label: '物资类型2', value: '2' },
|
||||
{ label: '物资类型3', value: '3' }
|
||||
],
|
||||
materialTypeOpts: [],
|
||||
// 类型规格
|
||||
typeModelNameOpts: [
|
||||
{ label: '规格型号1', value: '1' },
|
||||
{ label: '规格型号2', value: '2' },
|
||||
{ label: '规格型号3', value: '3' }
|
||||
],
|
||||
typeModelNameOpts: [],
|
||||
// 表格数据
|
||||
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
|
||||
}
|
||||
],
|
||||
equipmentList: [],
|
||||
// 表头
|
||||
tableColumns: [
|
||||
{ label: '直转数量', prop: 'preNum' },
|
||||
{ label: '类型名称', prop: 'maTypeName' },
|
||||
{ label: '规格型号', prop: 'typeName' },
|
||||
{ label: '直转数量', prop: 'directNum' },
|
||||
{ label: '类型名称', prop: 'typeName' },
|
||||
{ label: '规格型号', prop: 'typeModelName' },
|
||||
{ label: '计量单位', prop: 'unitName' },
|
||||
{ label: '领料数量', prop: 'applyNum' },
|
||||
{ label: '领料数量', prop: 'useNum' },
|
||||
{ label: '领料人', prop: 'leasePerson' },
|
||||
{ label: '领料日期', prop: 'arrivalTime' }
|
||||
{ label: '领料日期', prop: 'startTime' }
|
||||
],
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
|
|
@ -356,16 +322,24 @@ export default {
|
|||
projectId: null,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
materialType: '', // 物资类型
|
||||
typeModelName: '', // 类型规格
|
||||
maId: undefined, // 物资类型
|
||||
typeId: '', // 类型规格
|
||||
keyWord: ''
|
||||
},
|
||||
maForm: {
|
||||
unitId: undefined,
|
||||
projectId: undefined,
|
||||
arrivalTime: '',
|
||||
applyCode: '', // 采购申请编号
|
||||
bmFileInfos: [] // 附件
|
||||
backUnitId: undefined,
|
||||
backProId: undefined,
|
||||
backMan: '', // 转出人
|
||||
backPhone: '', // 联系电话
|
||||
backAgreementId: '', // 转出协议id
|
||||
backAgreementCode: '', // 转出协议编号
|
||||
leaseUnitId: undefined, // 转入单位
|
||||
leaseProId: undefined, // 转入工程
|
||||
leaseMan: '', // 转入人
|
||||
leasePhone: '', // 联系电话
|
||||
leaseAgreementId: '', // 转入协议id
|
||||
leaseAgreementCode: '', // 转入协议编号
|
||||
dirUrls: [] // 附件
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
|
|
@ -375,28 +349,28 @@ export default {
|
|||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
unitId: [
|
||||
backUnitId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择转出单位',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
projectId: [
|
||||
backProId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择转出工程',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
leasePerson: [
|
||||
backMan: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入转出人',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
phone: [
|
||||
backPhone: [
|
||||
{ required: true, message: '联系电话不能为空', trigger: 'blur' },
|
||||
{
|
||||
pattern: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/,
|
||||
|
|
@ -404,28 +378,28 @@ export default {
|
|||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
unitIdTo: [
|
||||
leaseUnitId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择转入单位',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
projectIdTo: [
|
||||
leaseProId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择转入工程',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
leasePersonTo: [
|
||||
leaseMan: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入转入人',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
phoneTo: [
|
||||
leasePhone: [
|
||||
{ required: true, message: '联系电话不能为空', trigger: 'blur' },
|
||||
{
|
||||
pattern: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/,
|
||||
|
|
@ -433,7 +407,7 @@ export default {
|
|||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
bmFileInfos: [
|
||||
dirUrls: [
|
||||
{
|
||||
required: true, // 是否分包商(是:合同编号必填)
|
||||
message: '请上传图片',
|
||||
|
|
@ -441,8 +415,6 @@ export default {
|
|||
}
|
||||
]
|
||||
},
|
||||
//是否是分包商
|
||||
isFileFbs: false,
|
||||
urlTemp: '',
|
||||
delBusinessFileIdList: [],
|
||||
//图片查看弹窗
|
||||
|
|
@ -455,7 +427,7 @@ export default {
|
|||
computed: {
|
||||
//图片上传1张后,隐藏上传框
|
||||
uploadDisabled() {
|
||||
return this.maForm.bmFileInfos && this.maForm.bmFileInfos.length == 3
|
||||
return this.maForm.dirUrls && this.maForm.dirUrls.length == 3
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
@ -478,7 +450,7 @@ export default {
|
|||
const obj = Object.assign({}, this.$route, { title: '直转申请' })
|
||||
this.$tab.updatePage(obj)
|
||||
}
|
||||
this.projectInfoList() //单位工程下拉选
|
||||
this.projectInfoList() // 单位工程下拉选
|
||||
if (this.isEdit || this.isDetail) {
|
||||
console.log('isEdit', this.isEdit)
|
||||
this.getTaskInfo()
|
||||
|
|
@ -486,13 +458,113 @@ export default {
|
|||
console.log(this.$store, 'this.$store.getters')
|
||||
console.log(this.$route.query, 'this.$route.query')
|
||||
},
|
||||
watch:{
|
||||
// this.maForm.backAgreementId 变化时执行
|
||||
'maForm.backAgreementId': {
|
||||
handler: function (val, oldVal) {
|
||||
this.getMaTypeOpt()
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
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() {
|
||||
this.$router.push({ path: '/business/businessHandlingRecord/directApplyRecord' })
|
||||
|
|
@ -508,27 +580,52 @@ export default {
|
|||
children: node.children
|
||||
}
|
||||
},
|
||||
uniteChange(val) {
|
||||
if (val.typeKey == 'fbs') {
|
||||
this.isFileFbs = true
|
||||
this.rules['bmFileInfos'][0].required = true
|
||||
} else {
|
||||
this.isFileFbs = false
|
||||
this.rules['bmFileInfos'][0].required = false
|
||||
normalizer2(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children
|
||||
}
|
||||
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(() => {
|
||||
getListProject({ unitId: this.maForm.unitId }).then(response => {
|
||||
getListProject({ unitId: this.maForm.backUnitId }).then(response => {
|
||||
this.projectList = response.data
|
||||
this.maForm.projectId = null
|
||||
this.maForm.backProId = null
|
||||
})
|
||||
}, 500)
|
||||
},
|
||||
projectChange(val) {
|
||||
setTimeout(() => {
|
||||
// projectId: this.maForm.projectId
|
||||
getListUnite({}).then(response => {
|
||||
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)
|
||||
},
|
||||
/** 租赁单位和工程-下拉选 */
|
||||
|
|
@ -536,33 +633,35 @@ export default {
|
|||
if (!this.isEdit) {
|
||||
getListUnite({ projectId: null }).then(response => {
|
||||
this.uniteList = response.data
|
||||
this.lessUniteList = response.data
|
||||
})
|
||||
getListProject({ unitId: null }).then(response => {
|
||||
this.projectList = response.data
|
||||
this.leaseProjectList = response.data
|
||||
})
|
||||
} else {
|
||||
getListUnite({ projectId: null }).then(response => {
|
||||
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
|
||||
})
|
||||
getListProject({ unitId: this.maForm.leaseUnitId }).then(response => {
|
||||
this.leaseProjectList = response.data
|
||||
})
|
||||
}
|
||||
},
|
||||
//获取任务详情--- 编辑回显数据
|
||||
async getTaskInfo() {
|
||||
try {
|
||||
const loading = this.$loading()
|
||||
const res = await getLeaseTaskDetail(this.id)
|
||||
const res = await receiveDetail({ id: this.id })
|
||||
console.log('🚀 ~ getTaskInfo ~ res:', res)
|
||||
this.maForm = res.data.leaseApplyInfo
|
||||
this.maForm.unitId = res.data.leaseApplyInfo.leaseUnitId
|
||||
this.maForm.projectId = res.data.leaseApplyInfo.leaseProjectId
|
||||
this.equipmentList = res.data.leaseApplyDetailsList
|
||||
// 如果 bmFileInfos有值
|
||||
if (this.maForm.bmFileInfos && this.maForm.bmFileInfos.length > 0) {
|
||||
this.isFileFbs = true
|
||||
}
|
||||
this.maForm = res.data
|
||||
this.multipleSelectionTemp = res.data.directApplyDetails
|
||||
this.getList()
|
||||
console.log('🚀 ~ getTaskInfo ~ this.equipmentList:', this.equipmentList)
|
||||
loading.close()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ error:', error)
|
||||
|
|
@ -583,25 +682,59 @@ export default {
|
|||
},
|
||||
/** 保存按钮操作 */
|
||||
handleSave() {
|
||||
// console.log(this.equipmentList)
|
||||
console.log('maForm', this.maForm)
|
||||
console.log('选中数据', this.multipleSelection)
|
||||
// if (this.equipmentList.length > 0) {
|
||||
// this.$refs['maForm'].validate(async valid => {
|
||||
// if (valid) {
|
||||
// }
|
||||
// })
|
||||
// } else {
|
||||
// this.$modal.msgError('请先添加类型规格')
|
||||
// }
|
||||
if (this.multipleSelection.length > 0) {
|
||||
this.$refs['maForm'].validate(valid => {
|
||||
if (valid) {
|
||||
this.$modal.confirm('是否确认申请').then(async () => {
|
||||
const isPass = this.multipleSelection.every(item => {
|
||||
return item.directNum
|
||||
})
|
||||
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) {
|
||||
const fileListTemp = fileList.filter(item => {
|
||||
return item.uid != file.uid
|
||||
})
|
||||
const parts = file.name.split('.')
|
||||
const extension = parts.pop().toLowerCase()
|
||||
const parts = file.name?.split('.')
|
||||
const extension = parts?.pop().toLowerCase()
|
||||
if (fileList.length > 3) {
|
||||
this.$message.warning('最多上传3张附件')
|
||||
fileList = fileList.filter(item => {
|
||||
|
|
@ -633,10 +766,10 @@ export default {
|
|||
this.urlTemp = require('@/assets/file.png')
|
||||
}
|
||||
})
|
||||
this.maForm.bmFileInfos = fileList
|
||||
console.log('🚀 ~ handleChangeBusinessList ~ this.bmFileInfos:', this.bmFileInfos)
|
||||
this.maForm.dirUrls = fileList
|
||||
console.log('🚀 ~ handleChangeBusinessList ~ this.dirUrls:', this.dirUrls)
|
||||
// 手动触发表单验证
|
||||
this.$refs.maForm.validateField('bmFileInfos')
|
||||
this.$refs.maForm.validateField('dirUrls')
|
||||
},
|
||||
// 判断文件类型
|
||||
isImage(file) {
|
||||
|
|
@ -650,16 +783,16 @@ export default {
|
|||
// 判断文件类型,图片预览,文件下载
|
||||
updataIf(e) {
|
||||
if (e.fileName) {
|
||||
const parts = e.fileName.split('.')
|
||||
const extension = parts.pop().toLowerCase()
|
||||
const parts = e.fileName?.split('.')
|
||||
const extension = parts?.pop().toLowerCase()
|
||||
if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
} else {
|
||||
const parts = e.name.split('.').toLowerCase()
|
||||
const extension = parts.pop()
|
||||
const parts = e.name?.split('.')
|
||||
const extension = parts?.pop().toLowerCase()
|
||||
if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') {
|
||||
return false
|
||||
} else {
|
||||
|
|
@ -670,8 +803,8 @@ export default {
|
|||
//上传组件-图片查看
|
||||
picturePreviewFbs(file) {
|
||||
this.dialogImageUrl = file.url.replaceAll('#', '%23')
|
||||
const parts = file.name.split('.')
|
||||
const extension = parts.pop()
|
||||
const parts = file.name?.split('.')
|
||||
const extension = parts?.pop()
|
||||
if (extension === 'pdf') {
|
||||
const windowName = file.name
|
||||
window.open(file.url, windowName)
|
||||
|
|
@ -682,12 +815,12 @@ export default {
|
|||
//上传组件-图片删除
|
||||
handleRemoveElectricianImgList(file, fileList) {
|
||||
let sum = 0
|
||||
this.maForm.bmFileInfos.forEach((item, index) => {
|
||||
this.maForm.dirUrls.forEach((item, index) => {
|
||||
if (item.uid == file.uid) {
|
||||
sum = index
|
||||
}
|
||||
})
|
||||
this.maForm.bmFileInfos.splice(sum, 1)
|
||||
this.maForm.dirUrls.splice(sum, 1)
|
||||
if (file.status == 'success') {
|
||||
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' })
|
||||
} else if (file.status === 'success') {
|
||||
downloadFileData({ fileName: file.name, fileUrl: file.url })
|
||||
// downloadFileData({ fileName: file.name,fileUrl:file.url })
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="taskStatus">
|
||||
<el-select v-model="queryParams.taskStatus" placeholder="请选择审核状态" clearable>
|
||||
<el-form-item label="审核状态" prop="status">
|
||||
<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-select>
|
||||
</el-form-item>
|
||||
|
|
@ -64,12 +64,12 @@
|
|||
align="center"
|
||||
>
|
||||
<!-- 插槽 -->
|
||||
<template v-slot="scope" v-if="column.prop == 'taskStatus'">
|
||||
<el-tag v-if="scope.row.taskStatus == '0'" type="warning" size="mini" style="margin-right: 5px">
|
||||
<template v-slot="scope" v-if="column.prop == 'status'">
|
||||
<el-tag v-if="scope.row.status == '0'" type="warning" size="mini" style="margin-right: 5px">
|
||||
待审核
|
||||
</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.taskStatus == '2'" type="success" size="mini" style="margin-right: 5px">
|
||||
<el-tag v-else-if="scope.row.status == '1'" size="mini" style="margin-right: 5px">审核中</el-tag>
|
||||
<el-tag v-else-if="scope.row.status == '2'" type="success" size="mini" style="margin-right: 5px">
|
||||
已完成
|
||||
</el-tag>
|
||||
</template>
|
||||
|
|
@ -79,7 +79,7 @@
|
|||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" icon="el-icon-search" @click="handleEdit(scope.row, 1)">查看</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.taskStatus == '0'"
|
||||
v-if="scope.row.status == '0'"
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-edit"
|
||||
|
|
@ -88,7 +88,7 @@
|
|||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.taskStatus == '0'"
|
||||
v-if="scope.row.status == '0'"
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
|
|
@ -113,7 +113,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getLeaseTaskList, deleteLeaseTask } from '@/api/business/index'
|
||||
import { getReceiveList, receiveDelete } from '@/api/business/index'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -123,7 +123,7 @@ export default {
|
|||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
keyWord: '', // 关键字
|
||||
taskStatus: '', // 审核状态
|
||||
status: '', // 审核状态
|
||||
timeRange: [] // 日期范围
|
||||
},
|
||||
// 考勤状态
|
||||
|
|
@ -136,13 +136,13 @@ export default {
|
|||
// 表头
|
||||
tableColumns: [
|
||||
{ label: '申请时间', prop: 'createTime' },
|
||||
{ label: '申请人', prop: 'createBy' },
|
||||
{ label: '转出单位', prop: 'leaseUnit' },
|
||||
{ label: '转出工程', prop: 'leaseProject' },
|
||||
{ label: '转入单位', prop: 'leaseUnitTo' },
|
||||
{ label: '转入工程', prop: 'leaseProjectTo' },
|
||||
{ label: '物资类型', prop: 'maTypeNames' },
|
||||
{ label: '状态', prop: 'taskStatus' }
|
||||
{ label: '申请人', prop: 'leaseMan' },
|
||||
{ label: '转出单位', prop: 'backUnitName' },
|
||||
{ label: '转出工程', prop: 'backProName' },
|
||||
{ label: '转入单位', prop: 'leaseUnitName' },
|
||||
{ label: '转入工程', prop: 'leaseProName' },
|
||||
{ label: '物资类型', prop: 'typeName' },
|
||||
{ label: '状态', prop: 'status' }
|
||||
],
|
||||
// 表格数据
|
||||
tableList: []
|
||||
|
|
@ -172,10 +172,10 @@ export default {
|
|||
startTime: this.queryParams.timeRange[0] || '',
|
||||
endTime: this.queryParams.timeRange[1] || ''
|
||||
}
|
||||
const res = await getLeaseTaskList(params)
|
||||
const res = await getReceiveList(params)
|
||||
console.log('🚀 ~ 获取列表 ~ res:', res)
|
||||
this.tableList = res.data.rows
|
||||
this.total = res.data.total || 0
|
||||
this.tableList = res.rows
|
||||
this.total = res.total || 0
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ 获取列表 ~ error:', error)
|
||||
this.tableList = []
|
||||
|
|
@ -209,7 +209,7 @@ export default {
|
|||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const res = await deleteLeaseTask(row.id)
|
||||
const res = await receiveDelete(row.id)
|
||||
console.log('🚀 ~ 删除 ~ res:', res)
|
||||
this.getList()
|
||||
this.$message({
|
||||
|
|
|
|||
Loading…
Reference in New Issue