领用-撤回功能

This commit is contained in:
bb_pan 2025-09-14 23:34:15 +08:00
parent e87def46f9
commit c3765dac48
4 changed files with 94 additions and 41 deletions

View File

@ -226,3 +226,12 @@ export function getCodePDF(id) {
method: 'get' method: 'get'
}) })
} }
// 撤回
export function revokeApi(data) {
return request({
url: '/material/leaseTask/revoke',
method: 'get',
params: data
})
}

View File

@ -70,14 +70,14 @@
align="center" align="center"
> >
<!-- 插槽 --> <!-- 插槽 -->
<template v-slot="{row}" v-if="column.prop == 'taskStatus'"> <template v-slot="{ row }" v-if="column.prop == 'taskStatus'">
<!-- <dict-tag :options="dict.type.lease_apply_task_status" :value="scope.row.taskStatus" /> --> <!-- <dict-tag :options="dict.type.lease_apply_task_status" :value="scope.row.taskStatus" /> -->
<el-tag v-if="row.taskStatus == 0">{{ row.taskStatusName }}</el-tag> <el-tag v-if="row.taskStatus == 0">{{ row.taskStatusName }}</el-tag>
<el-tag v-else-if="row.taskStatus == 3" type="success">{{ row.taskStatusName }}</el-tag> <el-tag v-else-if="row.taskStatus == 3" type="success">{{ row.taskStatusName }}</el-tag>
<el-tag v-else-if="row.taskStatus == 5" type="info">{{ row.taskStatusName }}</el-tag> <el-tag v-else-if="row.taskStatus == 5" type="info">{{ row.taskStatusName }}</el-tag>
<el-tag v-else-if="row.taskStatus == 6" type="warning">{{ row.taskStatusName }}</el-tag> <el-tag v-else-if="row.taskStatus == 6" type="warning">{{ row.taskStatusName }}</el-tag>
<el-tag v-else-if="row.taskStatus == 2" type="danger">{{ row.taskStatusName }}</el-tag> <el-tag v-else-if="row.taskStatus == 2" type="danger">{{ row.taskStatusName }}</el-tag>
<el-tag v-else-if="row.taskStatus == 1" type="success">{{ row.taskStatusName }}</el-tag> <el-tag v-else-if="row.taskStatus == 1" type="success">{{ row.taskStatusName }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<!-- 操作 --> <!-- 操作 -->
@ -114,6 +114,16 @@
> >
删除 删除
</el-button> </el-button>
<el-button
v-show="scope.row.taskStatus != 5 && scope.row.publishNum == 0"
type="text"
size="mini"
icon="el-icon-refresh"
style="color: #f56c6c"
@click="handleRefresh(scope.row)"
>
撤回
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -170,7 +180,7 @@
</span> </span>
进行架线施工需要现需领用以下工具器详见附件一 进行架线施工需要现需领用以下工具器详见附件一
<!-- dialogForm.maTypeNames --> <!-- dialogForm.maTypeNames -->
<div>{{ dialogForm.maTypeNames }}</div> <div>{{ dialogForm.maTypeNames }}</div>
</div> </div>
</div> </div>
<!-- 说明 --> <!-- 说明 -->
@ -273,7 +283,7 @@
<script> <script>
import printJS from 'print-js' import printJS from 'print-js'
import { getLeaseTaskList, deleteLeaseTask, getLeaseTask, getCodePDF } from '@/api/business/index' import { getLeaseTaskList, deleteLeaseTask, getLeaseTask, getCodePDF, revokeApi } from '@/api/business/index'
import html2canvas from 'html2canvas' import html2canvas from 'html2canvas'
import jsPDF from 'jspdf' import jsPDF from 'jspdf'
import request from '@/utils/request' import request from '@/utils/request'
@ -302,14 +312,14 @@ export default {
total: 0, // total: 0, //
// //
tableColumns: [ tableColumns: [
{ label: '申请时间', prop: 'createTime', width: '100', }, { label: '申请时间', prop: 'createTime', width: '100' },
{ label: '申请人', prop: 'createBy', width: '80' }, { label: '申请人', prop: 'createBy', width: '80' },
{ label: '领用单位', prop: 'leaseUnit', width: '180' }, { label: '领用单位', prop: 'leaseUnit', width: '180' },
{ label: '领用工程', prop: 'leaseProject', width: '180' }, { label: '领用工程', prop: 'leaseProject', width: '180' },
{ label: '领料物资类型', prop: 'maTypeNames', showTooltip: true }, { label: '领料物资类型', prop: 'maTypeNames', showTooltip: true },
{ label: '协议号', prop: 'agreementCode', }, { label: '协议号', prop: 'agreementCode' },
{ label: '业务单号', prop: 'code', }, { label: '业务单号', prop: 'code' },
{ label: '领料人', prop: 'leasePerson', width: '80', }, { label: '领料人', prop: 'leasePerson', width: '80' },
{ label: '领料人电话', prop: 'phone' }, { label: '领料人电话', prop: 'phone' },
{ label: '状态', prop: 'taskStatus', width: '80' } { label: '状态', prop: 'taskStatus', width: '80' }
], ],
@ -401,6 +411,31 @@ export default {
}) })
}) })
}, },
//
handleRefresh(row) {
console.log('🚀 ~ 撤回 ~ row:', row)
//
this.$confirm('是否确定撤回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
try {
this.loading = true
const res = await revokeApi({ taskId: row.taskId })
console.log('🚀 ~ 撤回 ~ res:', res)
this.$message({
type: 'success',
message: '撤回成功!'
})
this.getList()
} catch (error) {
console.log('🚀 ~ handleRefresh ~ error:', error)
} finally {
this.loading = false
}
})
},
// //
/*handleExport() { /*handleExport() {
try { try {

View File

@ -13,7 +13,7 @@
<el-form-item label="项目部" prop="departName"> <el-form-item label="项目部" prop="departName">
<el-input <el-input
v-model="queryParams.departName" v-model="queryParams.departName"
placeholder="请输入分公司" placeholder="请输入项目部"
clearable clearable
:maxlength="50" :maxlength="50"
style="width: 240px" style="width: 240px"

View File

@ -288,7 +288,7 @@ export default {
standardConfig: undefined, standardConfig: undefined,
bmFileInfos: [], bmFileInfos: [],
proId: undefined, proId: undefined,
relPhone: '', relPhone: ''
}, },
standardConfigList: [], standardConfigList: [],
// //
@ -379,15 +379,19 @@ export default {
} }
}, },
watch: { watch: {
maForm: { 'maForm.teamId'(newVal) {
handler(newVal, oldVal) { if (newVal && this.maForm.proId) {
if (newVal.teamId && newVal.proId) { this.getAgreementId()
this.getAgreementId() } else {
} else { this.equipmentTypeList = []
this.equipmentTypeList = [] }
} },
}, 'maForm.proId'(newVal) {
deep: true if (newVal && this.maForm.teamId) {
this.getAgreementId()
} else {
this.equipmentTypeList = []
}
} }
}, },
methods: { methods: {
@ -424,6 +428,7 @@ export default {
try { try {
const idCard = sessionStorage.getItem('idCard') const idCard = sessionStorage.getItem('idCard')
const res = await getBmTeamApi({ isAll: 0, idCard, projectId: this.maForm.projectId }) const res = await getBmTeamApi({ isAll: 0, idCard, projectId: this.maForm.projectId })
// console.log('🚀 ~ getBmTeam ~ res:', res)
if (!res.data || res.data.length === 0) return if (!res.data || res.data.length === 0) return
this.uniteList = res.data this.uniteList = res.data
const userName = sessionStorage.getItem('userName') const userName = sessionStorage.getItem('userName')
@ -450,7 +455,7 @@ export default {
}, },
changePro(e) { changePro(e) {
console.log('🚀 ~ changePro ~ e:', e) console.log('🚀 ~ changePro ~ e:', e)
this.maForm.proId = e this.maForm.proId = e
this.maForm.projectId = this.projectList.find(item => item.proId === e)?.projectId this.maForm.projectId = this.projectList.find(item => item.proId === e)?.projectId
this.getBmTeam() this.getBmTeam()
}, },
@ -486,21 +491,23 @@ export default {
proId: this.maForm.proId, proId: this.maForm.proId,
// teamId: this.maForm.teamId, // teamId: this.maForm.teamId,
teamName: this.maForm.teamName teamName: this.maForm.teamName
}).then(response => {
this.equipmentTypeList = response.data
//
this.flattenTypeOptions = this.processTypeData(response.data)
debugger
//
this.filteredOptions = [...this.flattenTypeOptions]
//
if (this.equipmentList.length > 0) {
this.deviceType = this.equipmentList.map(item => item.typeId)
}
}).finally(() => {
loading.close()
}) })
.then(response => {
this.equipmentTypeList = response.data
//
this.flattenTypeOptions = this.processTypeData(response.data)
debugger
//
this.filteredOptions = [...this.flattenTypeOptions]
//
if (this.equipmentList.length > 0) {
this.deviceType = this.equipmentList.map(item => item.typeId)
}
})
.finally(() => {
loading.close()
})
}, },
// //
processTypeData(data) { processTypeData(data) {
@ -540,8 +547,9 @@ export default {
}, },
// //
handleSearchImpl(query) { handleSearchImpl(query) {
console.log('🚀 ~ handleSearchImpl ~ query:', query)
if (!query) { if (!query) {
// this.filteredOptions = [...this.flattenTypeOptions] this.filteredOptions = [...this.flattenTypeOptions]
return return
} }
@ -602,6 +610,7 @@ export default {
this.maForm.projectId = response.data.leaseApplyInfo.proId this.maForm.projectId = response.data.leaseApplyInfo.proId
this.maForm.proId = response.data.leaseApplyInfo.proId this.maForm.proId = response.data.leaseApplyInfo.proId
this.maForm.relPhone = response.data.leaseApplyInfo.phone || response.data.leaseApplyInfo.relPhone || '' this.maForm.relPhone = response.data.leaseApplyInfo.phone || response.data.leaseApplyInfo.relPhone || ''
// this.getBmTeam()
this.equipmentList = response.data.leaseApplyDetailsList || [] this.equipmentList = response.data.leaseApplyDetailsList || []
if (this.equipmentList.length > 0) { if (this.equipmentList.length > 0) {
this.equipmentList.forEach(item => { this.equipmentList.forEach(item => {