直转申请

This commit is contained in:
bb_pan 2025-02-18 10:45:22 +08:00
parent 91378c7e62
commit 088d784cbb
5 changed files with 1073 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -0,0 +1,840 @@
<template>
<div class="app-container">
<el-form :model="maForm" ref="maForm" size="small" :rules="rules" label-width="100px" :disabled="isDetail">
<el-row :gutter="20" class="cont-center" style="margin-bottom: 20px">
<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">
<treeselect
v-model="maForm.unitId"
:disabled="isEdit || isDetail"
:options="uniteList"
:normalizer="normalizer"
:show-count="true"
style="width: 240px"
:disable-branch-nodes="true"
noChildrenText="没有数据了"
noOptionsText="没有数据"
noResultsText="没有搜索结果"
placeholder="请选择转出单位"
@select="uniteChange"
/>
</el-form-item>
<el-form-item label="转出工程" prop="projectId">
<treeselect
v-model="maForm.projectId"
:disabled="isEdit || isDetail"
:options="projectList"
:normalizer="normalizer"
:show-count="true"
style="width: 240px"
:disable-branch-nodes="true"
noChildrenText="没有数据了"
noOptionsText="没有数据"
noResultsText="没有搜索结果"
placeholder="请选择转出工程"
@select="projectChange"
/>
</el-form-item>
<el-form-item label="转出人" prop="leasePerson">
<el-input
v-model="maForm.leasePerson"
placeholder="请输入转出人"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input
v-model="maForm.phone"
placeholder="请输入联系电话"
clearable
maxlength="11"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-card>
</el-col>
<el-col :span="2" :offset="0">
<div class="cont-center">
<el-image
style="width: 100px; height: 100px"
:src="require('@/assets/img/transform.png')"
fit="fit"
></el-image>
</div>
</el-col>
<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">
<treeselect
v-model="maForm.unitId"
:disabled="isDetail"
:options="uniteList"
:normalizer="normalizer"
:show-count="true"
style="width: 240px"
:disable-branch-nodes="true"
noChildrenText="没有数据了"
noOptionsText="没有数据"
noResultsText="没有搜索结果"
placeholder="请选择转入单位"
@select="uniteChange"
/>
</el-form-item>
<el-form-item label="转入工程" prop="projectId">
<treeselect
v-model="maForm.projectId"
:disabled="isDetail"
:options="projectList"
:normalizer="normalizer"
:show-count="true"
style="width: 240px"
:disable-branch-nodes="true"
noChildrenText="没有数据了"
noOptionsText="没有数据"
noResultsText="没有搜索结果"
placeholder="请选择转入工程"
@select="projectChange"
/>
</el-form-item>
<el-form-item label="转入人" prop="leasePerson">
<el-input
v-model="maForm.leasePerson"
placeholder="请输入转入人"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input
v-model="maForm.phone"
placeholder="请输入联系电话"
clearable
maxlength="11"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-card>
</el-col>
<el-col :span="8" :offset="0">
<el-form-item label="" prop="bmFileInfos">
<el-upload
:action="uploadUrl"
:file-list="maForm.bmFileInfos"
:show-file-list="true"
:auto-upload="true"
:key="uploadKey"
:limit="3"
list-type="picture-card"
accept="*/image"
:on-change="handleChangeBusinessList"
:class="{ disabledFbs: uploadDisabled }"
:on-preview="picturePreviewFbs"
:on-remove="handleRemoveElectricianImgList"
:disabled="isDetail"
>
<!-- 文件格式下载图片格式预览 -->
<div slot="file" slot-scope="{ file }">
<img v-if="isImage(file)" class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
<div v-else class="picture-card-container">
<img class="picture-card" :src="urlTemp" alt="" />
<p class="file-name">{{ file.name }}</p>
</div>
<span class="el-upload-list__item-actions">
<span class="el-upload-list__item-preview" @click="picturePreviewFbs(file)">
<i class="el-icon-zoom-in" />
</span>
<span
v-if="!isDetail"
class="el-upload-list__item-delete"
@click="handleRemoveElectricianImgList(file)"
>
<i class="el-icon-delete" />
</span>
</span>
</div>
<i class="el-icon-plus avatar-uploader-icon">
<div style="font-size: 14px; margin-top: 10px">上传图片</div>
</i>
</el-upload>
</el-form-item>
</el-col>
</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>
<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-select>
</el-form-item>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- 表单按钮 -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleSave" v-if="!isDetail">
{{ isEdit ? '保存' : '发起申请' }}
</el-button>
<el-button type="primary" plain icon="el-icon-arrow-left" size="mini" @click="handleApplyRecord">
直转记录查看
</el-button>
</el-form-item>
</el-form>
</el-row>
</el-form>
<el-table v-loading="loading" :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
v-for="(column, index) in tableColumns"
:key="column.prop"
:label="column.label"
:prop="column.prop"
align="center"
show-overflow-tooltip
>
<template v-slot="scope" v-if="column.prop == 'preNum'">
<el-input-number
v-model="scope.row.preNum"
controls-position="right"
:precision="0"
style="width: 100%"
:disabled="isDetail || !scope.row.isActive"
:min="0"
></el-input-number>
</template>
</el-table-column>
<!-- <el-table-column label="操作" align="center" v-if="!isDetail">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-delete" style="color: red" @click="handleDelete(scope.row)">
删除
</el-button>
</template>
</el-table-column> -->
</el-table>
</div>
</template>
<script>
import { equipmentTypeTree } from '@/api/purchase/goodsArrived'
import { getListProject, getListUnite, getAgreement } from '@/api/lease/apply'
import {
getStandardConfigList,
getListsByConfigId,
addLeaseTask,
editLeaseTask,
getLeaseTaskDetail
} from '@/api/business/index'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
dicts: ['purchase_task_status'],
components: { Treeselect },
data() {
return {
id: '',
isEdit: false, //
isDetail: false, //
//
loading: false,
loadingTwo: false,
//
multipleSelection: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
selectTreeProps: {
children: 'children',
label: 'name',
// multiple: false,
value: 'id'
// multiple: true,
},
//
uniteList: [],
//
projectList: [],
//
materialTypeOpts: [
{ label: '物资类型1', value: '1' },
{ label: '物资类型2', value: '2' },
{ label: '物资类型3', value: '3' }
],
//
typeModelNameOpts: [
{ label: '规格型号1', value: '1' },
{ label: '规格型号2', value: '2' },
{ label: '规格型号3', value: '3' }
],
//
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: [
{ label: '直转数量', prop: 'preNum' },
{ label: '类型名称', prop: 'maTypeName' },
{ label: '规格型号', prop: 'typeName' },
{ label: '计量单位', prop: 'unitName' },
{ label: '领料数量', prop: 'applyNum' },
{ label: '领料人', prop: 'leasePerson' },
{ label: '领料日期', prop: 'arrivalTime' }
],
//
title: '',
//
open: false,
rowData: {},
unitId: null,
projectId: null,
//
queryParams: {
materialType: '', //
typeModelName: '', //
keyWord: ''
},
maForm: {
unitId: undefined,
projectId: undefined,
arrivalTime: '',
applyCode: '', //
bmFileInfos: [] //
},
//
form: {},
defaultProps: {
children: 'children',
label: 'label'
},
//
rules: {
unitId: [
{
required: true,
message: '请选择租赁单位',
trigger: 'blur'
}
],
projectId: [
{
required: true,
message: '请选择租赁工程',
trigger: 'blur'
}
],
leasePerson: [
{
required: true,
message: '请输入领料人',
trigger: 'blur'
}
],
phone: [
{ required: true, message: '联系电话不能为空', trigger: 'blur' },
{
pattern: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/,
message: '请输入正确的手机号码',
trigger: 'blur'
}
],
applyCode: [
{
required: true,
message: '请输入采购申请编号',
trigger: 'blur'
}
],
bmFileInfos: [
{
required: true, // ()
message: '请上传图片',
trigger: 'change'
}
]
},
//
isFileFbs: false,
urlTemp: '',
delBusinessFileIdList: [],
//
dialogImageUrl: '',
dialogVisible: false,
uploadKey: Date.now(),
uploadUrl: process.env.VUE_APP_BASE_API + '/file/upload' //
}
},
computed: {
//1
uploadDisabled() {
return this.maForm.bmFileInfos && this.maForm.bmFileInfos.length == 3
}
},
created() {
if (this.$route.query.type == 'edit') {
this.isEdit = true
this.isDetail = false
this.id = this.$route.query.id
const obj = Object.assign({}, this.$route, { title: '直转申请编辑' })
this.$tab.updatePage(obj)
} else if (this.$route.query.type == 'detail') {
this.isEdit = false
this.isDetail = true
this.id = this.$route.query.id
const obj = Object.assign({}, this.$route, { title: '直转申请详情' })
this.$tab.updatePage(obj)
} else {
this.isEdit = false
this.isDetail = false
this.id = ''
const obj = Object.assign({}, this.$route, { title: '直转申请' })
this.$tab.updatePage(obj)
}
this.projectInfoList() //
if (this.isEdit || this.isDetail) {
console.log('isEdit', this.isEdit)
this.getTaskInfo()
}
console.log(this.$store, 'this.$store.getters')
console.log(this.$route.query, 'this.$route.query')
},
methods: {
//
handleQuery() {},
//
handleReset() {},
//
getList() {},
//
handleApplyRecord() {
this.$router.push({ path: '/business/businessHandlingRecord/directApplyRecord' })
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children
}
return {
id: node.id,
label: node.name,
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
}
setTimeout(() => {
getListProject({ unitId: this.maForm.unitId }).then(response => {
this.projectList = response.data
this.maForm.projectId = null
})
}, 500)
},
projectChange(val) {
setTimeout(() => {
// projectId: this.maForm.projectId
getListUnite({}).then(response => {
this.uniteList = response.data
})
}, 500)
},
/** 租赁单位和工程-下拉选 */
projectInfoList() {
if (!this.isEdit) {
getListUnite({ projectId: null }).then(response => {
this.uniteList = response.data
})
getListProject({ unitId: null }).then(response => {
this.projectList = response.data
})
} else {
getListUnite({ projectId: null }).then(response => {
this.uniteList = response.data
})
getListProject({ unitId: this.maForm.unitId }).then(response => {
this.projectList = response.data
})
}
},
//---
async getTaskInfo() {
try {
const loading = this.$loading()
const res = await getLeaseTaskDetail(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
}
loading.close()
} catch (error) {
console.log('🚀 ~ error:', error)
loading.close()
}
},
//
handleSelectionChange(row) {
console.log('选中了~', row)
this.multipleSelection = row
this.equipmentList.forEach(item => {
if (this.multipleSelection.some(val => val.id === item.id)) {
item.isActive = true
} else {
item.isActive = false
}
})
},
/** 保存按钮操作 */
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('')
// }
},
//
handleChangeBusinessList(file, fileList) {
const fileListTemp = fileList.filter(item => {
return item.uid != file.uid
})
const parts = file.name.split('.')
const extension = parts.pop()
if (fileList.length > 3) {
this.$message.warning('最多上传3张附件')
fileList = fileList.filter(item => {
return item.uid != file.uid
})
} else if (!(extension === 'png' || extension === 'jpg' || extension === 'jpeg')) {
this.$message.warning('文件格式不正确')
fileList = fileList.filter(item => {
return item.uid != file.uid
})
} else if (file.size > 1024 * 1024 * 10) {
this.$message.warning('文件大小不能超过10Mb')
fileList = fileList.filter(item => {
return item.uid != file.uid
})
} else if (file.name.length > 40) {
this.$message.warning('文件名长度不能超过40个字符')
fileList = fileList.filter(item => {
return item.uid != file.uid
})
} else if (fileListTemp.some(item => item.name === file.name)) {
this.$message.warning('文件名重复')
fileList = fileList.filter(item => {
return item.uid != file.uid
})
}
// fileList.forEach(file => {
// if (extension === 'pdf') {
// this.urlTemp = require('@/assets/file.png')
// }
// })
this.maForm.bmFileInfos = fileList
console.log('🚀 ~ handleChangeBusinessList ~ this.bmFileInfos:', this.bmFileInfos)
//
this.$refs.maForm.validateField('bmFileInfos')
},
//
isImage(file) {
this.urlTemp = require('@/assets/file.png')
if (this.updataIf(file)) {
return false
} else {
return true
}
},
// ,
updataIf(e) {
if (e.fileName) {
const parts = e.fileName.split('.')
const extension = parts.pop()
if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') {
return false
} else {
return true
}
} else {
const parts = e.name.split('.')
const extension = parts.pop()
if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') {
return false
} else {
return true
}
}
},
//-
picturePreviewFbs(file) {
this.dialogImageUrl = file.url.replaceAll('#', '%23')
const parts = file.name.split('.')
const extension = parts.pop()
if (extension === 'pdf') {
const windowName = file.name
window.open(file.url, windowName)
} else {
this.dialogVisible = true
}
},
//-
handleRemoveElectricianImgList(file, fileList) {
let sum = 0
this.maForm.bmFileInfos.forEach((item, index) => {
if (item.uid == file.uid) {
sum = index
}
})
this.maForm.bmFileInfos.splice(sum, 1)
if (file.status == 'success') {
this.delBusinessFileIdList.push(file.url)
}
console.log('delBusinessFileIdList', this.delBusinessFileIdList)
}
}
}
</script>
<style lang="scss" scoped>
//css
::v-deep .disabledFbs {
.el-upload--picture-card {
display: none;
width: 100px;
height: 100px;
}
}
::v-deep .el-upload--picture-card {
width: 100px;
height: 100px;
}
::v-deep .el-upload-list__item {
margin-bottom: 20px;
overflow: unset !important;
width: 103px;
height: 103px;
}
::v-deep .el-upload-list__item-actions {
overflow: unset !important;
width: 100px;
height: 100px;
}
.popper-select {
.el-cascader-panel .el-scrollbar .el-checkbox {
display: none;
}
.el-cascader-panel .el-scrollbar:nth-child(4) .el-checkbox {
display: block !important;
}
}
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
.el-icon-arrow-down.is-reverse {
transform: rotateZ(180deg);
}
// .el-tree {
// max-height: 300px;
// overflow-y: auto;
// }
.highlight-text {
background-color: #ffd04b;
color: #000;
}
::v-deep .el-input-group__append {
padding: 0;
.el-button {
padding: 0 10px;
border: none;
height: 100%;
&:first-child {
border-right: 1px solid #dcdfe6;
}
&[disabled] {
color: #c0c4cc;
}
}
}
.type-select-dropdown {
.el-select-dropdown__wrap {
max-height: 400px !important;
}
.el-select-dropdown__item {
height: auto;
padding: 8px 20px;
white-space: normal;
word-break: break-all;
}
}
.highlight-text {
background-color: #ffd04b;
color: #000;
}
.el-input-group__append {
padding: 0;
.el-button {
padding: 0 10px;
border: none;
height: 100%;
&:first-child {
border-right: 1px solid #dcdfe6;
}
&[disabled] {
color: #c0c4cc;
}
}
}
.el-upload-list__item-thumbnail {
/* height: 145px !important; */
width: 100px;
height: 100px;
}
.picture-card-container {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
}
.picture-card {
width: 100%;
height: 100%;
object-fit: cover;
justify-content: center;
// border: 1px solid #ddd;
// border-radius: 4px;
}
.file-name {
width: 90%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
position: absolute;
bottom: -35px;
margin-top: 8px;
text-align: center;
font-size: 12px;
color: #333;
z-index: 999999;
}
.file-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
color: #fff;
font-size: 20px;
}
//
.cont-center {
display: flex;
justify-content: center;
align-items: center;
}
</style>

View File

@ -1,5 +1,4 @@
<template>
<!-- 新增工机具 -->
<div class="app-container">
<el-form
:model="maForm"
@ -301,11 +300,6 @@ export default {
rowData: {},
unitId: null,
projectId: null,
//
queryParams: {
equipmentId: undefined,
productionTime: ''
},
maForm: {
unitId: undefined,
projectId: undefined,
@ -456,7 +450,7 @@ export default {
},
//
handleApplyRecord() {
this.$router.push({ path: '/business/businessHandlingRecord/businessHandlingRecord/index' })
this.$router.push({ path: '/business/businessHandlingRecord/index' })
},
/** 转换菜单数据结构 */
normalizer(node) {

View File

@ -0,0 +1,230 @@
<template>
<!-- 基础页面 -->
<div class="app-container">
<el-form v-show="showSearch" :model="queryParams" ref="queryForm" size="small" inline>
<el-form-item label="申请日期" prop="timeRange">
<el-date-picker
v-model="queryParams.timeRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
clearable
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
/>
</el-form-item>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="审核状态" prop="taskStatus">
<el-select v-model="queryParams.taskStatus" placeholder="请选择审核状态" clearable>
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<!-- 表单按钮 -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<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">导出数据</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table :data="tableList" fit highlight-current-row style="width: 100%">
<!-- 多选 -->
<el-table-column type="selection" width="55" align="center" @selection-change="selectionChange" />
<el-table-column
type="index"
width="55"
label="序号"
align="center"
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
/>
<el-table-column
v-for="(column, index) in tableColumns"
show-overflow-tooltip
:key="column.prop"
:label="column.label"
:prop="column.prop"
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">
待审核
</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>
</template>
</el-table-column>
<!-- 操作 -->
<el-table-column label="操作" align="center" width="180">
<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-edit" @click="handleEdit(scope.row, 2)">编辑</el-button>
<el-button
type="text"
size="mini"
icon="el-icon-delete"
style="color: #f56c6c"
@click="handleDelete(scope.row)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { getLeaseTaskList, deleteLeaseTask } from '@/api/business/index'
export default {
data() {
return {
showSearch: true,
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: '', //
taskStatus: '', //
timeRange: [] //
},
//
statusOptions: [
{ label: '待审核', value: '1' },
{ label: '审核中', value: '2' },
{ label: '已完成', value: '3' }
],
total: 0, //
//
tableColumns: [
{ label: '申请时间', prop: 'createTime' },
{ label: '申请人', prop: 'createBy' },
{ label: '领用单位', prop: 'leaseUnit' },
{ label: '领用工程', prop: 'leaseProject' },
{ label: '领料物资类型', prop: 'maTypeNames' },
{ label: '协议号', prop: 'agreementCode' },
{ label: '采购申请单号', prop: 'applyCode' },
{ label: '领料人', prop: 'leasePerson' },
{ label: '领料人电话', prop: 'phone' },
{ label: '状态', prop: 'taskStatus' }
],
//
tableList: []
}
},
created() {
this.getList()
},
methods: {
//
handleQuery() {
this.getList()
},
//
handleReset() {
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.$refs.queryForm.resetFields()
this.getList()
},
//
async getList() {
console.log('列表-查询', this.queryParams)
try {
const params = {
...this.queryParams,
startTime: this.queryParams.timeRange[0] || '',
endTime: this.queryParams.timeRange[1] || ''
}
const res = await getLeaseTaskList(params)
console.log('🚀 ~ 获取列表 ~ res:', res)
this.tableList = res.data.rows
this.total = res.data.total || 0
} catch (error) {
console.log('🚀 ~ 获取列表 ~ error:', error)
this.tableList = []
this.total = 0
}
},
//
selectionChange(val) {
console.log('selectionChange', val)
},
handleAdd() {
console.log('领料申请')
this.$router.push({ path: '/business/businessHandling/directApply' })
},
//
handleEdit(row, type) {
console.log('编辑', row)
let params = {}
if (type === 1) {
params = { type: 'detail', id: row.id }
} else {
params = { type: 'edit', id: row.id }
}
this.$router.push({ path: '/business/businessHandling/directApply', query: params })
},
//
handleDelete(row) {
console.log('删除', row)
this.$confirm('是否删除该数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const res = await deleteLeaseTask(row.id)
console.log('🚀 ~ 删除 ~ res:', res)
this.getList()
this.$message({
type: 'success',
message: '删除成功!'
})
})
},
//
handleExport() {
try {
let fileName = `数据_${new Date().getTime()}.xLsx`
let url = ''
const params = { ...this.queryParams }
console.log('🚀 ~ 导出 ~ params:', params)
// this.derive(url, params, fileName)
} catch (error) {
console.log('导出数据失败', error)
}
}
}
}
</script>
<style lang="scss" scoped></style>

View File

@ -181,7 +181,7 @@ export default {
},
handleAdd() {
console.log('领料申请')
this.$router.push({ path: '/business/businessHandling/businessHandling/index' })
this.$router.push({ path: '/business/businessHandling/index' })
},
//
handleEdit(row, type) {
@ -192,7 +192,7 @@ export default {
} else {
params = { type: 'edit', id: row.id }
}
this.$router.push({ path: '/business/businessHandling/businessHandling/index', query: params })
this.$router.push({ path: '/business/businessHandling/index', query: params })
},
//
handleDelete(row) {