Merge branch 'material-ui' of http://192.168.0.75:3000/bonus/bonus-ui into material-ui

This commit is contained in:
hongchao 2025-02-19 13:40:42 +08:00
commit fb8c580fb8
7 changed files with 1731 additions and 228 deletions

124
src/api/business/index.js Normal file
View File

@ -0,0 +1,124 @@
import request from '@/utils/request'
// 获取标准配置下拉
export function getStandardConfigList(data = {}) {
return request({
url: '/material/select/getConfigList',
method: 'post',
data
})
}
// 获取当前标准配置-列表
export function getListsByConfigId(query) {
return request({
url: '/material/standardConfig/getListsByConfigId',
method: 'get',
params: query
})
}
// 领用申请
export function addLeaseTask(data) {
return request({
url: '/material/leaseTask',
method: 'post',
data
})
}
// 领用申请-编辑
export function editLeaseTask(data) {
return request({
url: '/material/leaseTask',
method: 'put',
data
})
}
// 领用记录查询-列表
export function getLeaseTaskList(query) {
return request({
url: '/material/leaseTask/list',
method: 'get',
params: query
})
}
// 领用记录编辑/查看-详情
export function getLeaseTaskDetail(id) {
return request({
url: '/material/leaseTask/' + id,
method: 'get'
})
}
// 领用记录-删除
export function deleteLeaseTask(id) {
return request({
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
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,18 @@
<template> <template>
<!-- 新增工机具 -->
<div class="app-container"> <div class="app-container">
<el-form :model="maForm" ref="maForm" size="small" :rules="rules" :inline="true" label-width="120px"> <el-form
:model="maForm"
ref="maForm"
size="small"
:rules="rules"
:inline="true"
label-width="120px"
:disabled="isDetail"
>
<el-form-item label="领用单位" prop="unitId"> <el-form-item label="领用单位" prop="unitId">
<treeselect <treeselect
v-model="maForm.unitId" v-model="maForm.unitId"
:disabled="isEdit" :disabled="isEdit || isDetail"
:options="uniteList" :options="uniteList"
:normalizer="normalizer" :normalizer="normalizer"
:show-count="true" :show-count="true"
@ -21,7 +28,7 @@
<el-form-item label="领用工程" prop="projectId"> <el-form-item label="领用工程" prop="projectId">
<treeselect <treeselect
v-model="maForm.projectId" v-model="maForm.projectId"
:disabled="isEdit" :disabled="isEdit || isDetail"
:options="projectList" :options="projectList"
:normalizer="normalizer" :normalizer="normalizer"
:show-count="true" :show-count="true"
@ -56,9 +63,9 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="采购申请编号" prop="purchaseReqNum"> <el-form-item label="采购申请编号" prop="applyCode">
<el-input <el-input
v-model="maForm.purchaseReqNum" v-model="maForm.applyCode"
placeholder="请输入采购申请编号" placeholder="请输入采购申请编号"
clearable clearable
maxlength="150" maxlength="150"
@ -69,11 +76,11 @@
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="标准配置" prop="projectId"> <el-form-item label="标准配置" prop="standardConfig">
<treeselect <treeselect
v-model="maForm.projectId" v-model="maForm.standardConfig"
:disabled="isEdit" :disabled="isDetail"
:options="projectList" :options="standardConfigList"
:normalizer="normalizer" :normalizer="normalizer"
:show-count="true" :show-count="true"
style="width: 240px" style="width: 240px"
@ -82,7 +89,7 @@
noOptionsText="没有数据" noOptionsText="没有数据"
noResultsText="没有搜索结果" noResultsText="没有搜索结果"
placeholder="请选择标准配置" placeholder="请选择标准配置"
@select="projectChange" @select="standardConfigChange"
/> />
</el-form-item> </el-form-item>
<el-form-item label="类型规格" prop="deviceType"> <el-form-item label="类型规格" prop="deviceType">
@ -136,13 +143,55 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item label="委托书" prop="bmFileInfos" v-if="isFileFbs">
<el-upload
:action="uploadUrl"
:file-list="maForm.bmFileInfos"
:show-file-list="true"
:auto-upload="true"
:key="uploadKey"
:limit="5"
list-type="picture-card"
accept=".png, .jpg, .jpeg, .pdf"
: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 v-if="updataIf(file)" class="el-upload-list__item-delete" @click="handleDownload(file)">
<i class="el-icon-download" />
</span>
<span v-else 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"></i>
</el-upload>
</el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleSave">发起申请</el-button> <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleSave" v-if="!isDetail">
{{ isEdit ? '保存' : '发起申请' }}
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-arrow-left" size="mini" @click="handleApplyRecord">领料记录查看</el-button> <el-button type="primary" plain icon="el-icon-arrow-left" size="mini" @click="handleApplyRecord">
领料记录查看
</el-button>
</el-col> </el-col>
</el-row> </el-row>
@ -159,7 +208,7 @@
controls-position="right" controls-position="right"
type="number" type="number"
style="width: 100%" style="width: 100%"
:disabled="scope.row.alNum && scope.row.alNum != 0 ? true : false" :disabled="isDetail"
:min="0" :min="0"
@input=" @input="
v => v =>
@ -171,22 +220,21 @@
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" label="当前库存" prop="storageNum" /> --> <!-- <el-table-column align="center" label="当前库存" prop="storageNum" /> -->
<el-table-column label="待出库数量" align="center" prop="alNum" show-overflow-tooltip /> <!-- <el-table-column label="待出库数量" align="center" prop="alNum" show-overflow-tooltip /> -->
<el-table-column label="备注" prop="remark" align="center" label-width="500px"> <el-table-column label="备注" prop="remark" align="center" label-width="500px">
<template v-slot="scope"> <template v-slot="scope">
<el-input v-model="scope.row.remark" controls-position="right" style="width: 100%"></el-input> <el-input
v-model="scope.row.remark"
controls-position="right"
:disabled="isDetail"
style="width: 100%"
></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center" v-if="!isDetail">
<template slot-scope="scope" v-if="scope.row.roleId !== 1"> <template slot-scope="scope">
<el-button <el-button size="mini" type="text" icon="el-icon-delete" style="color: red" @click="handleDelete(scope.row)">
size="mini"
type="text"
icon="el-icon-delete"
style="color: red"
@click="handleDelete(scope.row)"
>
删除 删除
</el-button> </el-button>
</template> </template>
@ -197,15 +245,14 @@
<script> <script>
import { equipmentTypeTree } from '@/api/purchase/goodsArrived' import { equipmentTypeTree } from '@/api/purchase/goodsArrived'
import { getListProject, getListUnite, getAgreement } from '@/api/lease/apply'
import { import {
getListProject, getStandardConfigList,
getListUnite, getListsByConfigId,
addApplyInfo, addLeaseTask,
updateApplyInfo, editLeaseTask,
getApplyInfo, getLeaseTaskDetail
getAgreement } from '@/api/business/index'
} from '@/api/lease/apply'
import { getToken } from '@/utils/auth'
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'
@ -214,7 +261,7 @@ export default {
components: { Treeselect }, components: { Treeselect },
data() { data() {
return { return {
taskId: '', id: '',
isEdit: false, // isEdit: false, //
isDetail: false, // isDetail: false, //
// //
@ -241,6 +288,7 @@ export default {
uniteList: [], uniteList: [],
// //
projectList: [], projectList: [],
standardConfigList: [], //
// //
equipmentTypeList: [], equipmentTypeList: [],
// //
@ -252,19 +300,12 @@ export default {
rowData: {}, rowData: {},
unitId: null, unitId: null,
projectId: null, projectId: null,
//
queryParams: {
equipmentId: undefined,
productionTime: ''
},
maForm: { maForm: {
unitId: undefined, unitId: undefined,
projectId: undefined, projectId: undefined,
arrivalTime: '', arrivalTime: '',
purchaser: '', applyCode: '', //
remark: '', bmFileInfos: [] //
purchaseNumber: '',
bmFileInfos: []
}, },
// //
form: {}, form: {},
@ -298,10 +339,24 @@ export default {
phone: [ phone: [
{ required: true, message: '联系电话不能为空', trigger: 'blur' }, { required: true, message: '联系电话不能为空', trigger: 'blur' },
{ {
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, pattern: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/,
message: '请输入正确的手机号码', message: '请输入正确的手机号码',
trigger: 'blur' trigger: 'blur'
} }
],
applyCode: [
{
required: true,
message: '请输入采购申请编号',
trigger: 'blur'
}
],
bmFileInfos: [
{
required: false, // ()
message: '请上传委托书',
trigger: 'change'
}
] ]
}, },
deviceTypeTreeProps: { deviceTypeTreeProps: {
@ -313,7 +368,6 @@ export default {
}, },
deviceType: [], deviceType: [],
propsKey: 1000, propsKey: 1000,
projectTemp: undefined,
unitTemp: undefined, unitTemp: undefined,
agreementId: undefined, agreementId: undefined,
// taxRate:0, // taxRate:0,
@ -340,7 +394,10 @@ export default {
isFileFbs: false, isFileFbs: false,
urlTemp: '', urlTemp: '',
delBusinessFileIdList: [], delBusinessFileIdList: [],
//
dialogImageUrl: '',
dialogVisible: false,
uploadKey: Date.now(),
uploadUrl: process.env.VUE_APP_BASE_API + '/file/upload' // uploadUrl: process.env.VUE_APP_BASE_API + '/file/upload' //
} }
}, },
@ -348,32 +405,52 @@ export default {
//1 //1
uploadDisabled() { uploadDisabled() {
return this.maForm.bmFileInfos && this.maForm.bmFileInfos.length == 5 return this.maForm.bmFileInfos && this.maForm.bmFileInfos.length == 5
},
pickerOptions() {
return {
disabledDate(time) {
const currentDate = new Date()
currentDate.setHours(0, 0, 0, 0)
return time.getTime() < currentDate.getTime()
}
}
} }
}, },
mounted() { 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() // this.projectInfoList() //
this.equipmentType() // this.equipmentType() //
if (this.isEdit) { this.getStandardConfigList() //
if (this.isEdit || this.isDetail) {
console.log('isEdit', this.isEdit) console.log('isEdit', this.isEdit)
this.taskId = this.editTaskId
this.id = this.editId
this.getTaskInfo() this.getTaskInfo()
this.equipmentType()
} }
console.log(this.$store, 'this.$store.getters')
console.log(this.$route.query, 'this.$route.query') console.log(this.$route.query, 'this.$route.query')
}, },
methods: { methods: {
//
async getStandardConfigList() {
try {
const res = await getStandardConfigList()
console.log('🚀 ~ getStandardConfigList ~ res:', res)
this.standardConfigList = res.data
} catch (error) {
console.log('🚀 ~ error:', error)
}
},
//
handleApplyRecord() { handleApplyRecord() {
this.$router.push({ path: '/business/businessHandlingRecord/businessHandlingRecord/index' }) this.$router.push({ path: '/business/businessHandlingRecord/index' })
}, },
/** 转换菜单数据结构 */ /** 转换菜单数据结构 */
normalizer(node) { normalizer(node) {
@ -387,12 +464,6 @@ export default {
} }
}, },
uniteChange(val) { uniteChange(val) {
// this.projectList = [];
// if (val && val.length > 0) {
// this.maForm.unitId = this.unitId[this.unitId.length - 1];
// } else if (val && val.length == 0) {
// this.maForm.unitId = "";
// }
if (val.typeKey == 'fbs') { if (val.typeKey == 'fbs') {
this.isFileFbs = true this.isFileFbs = true
this.rules['bmFileInfos'][0].required = true this.rules['bmFileInfos'][0].required = true
@ -408,11 +479,6 @@ export default {
}, 500) }, 500)
}, },
projectChange(val) { projectChange(val) {
// if (val && val.length > 0) {
// this.maForm.projectId = this.projectId[this.projectId.length - 1];
// } else if (val && val.length == 0) {
// this.maForm.projectId = "";
// }
setTimeout(() => { setTimeout(() => {
// projectId: this.maForm.projectId // projectId: this.maForm.projectId
getListUnite({}).then(response => { getListUnite({}).then(response => {
@ -420,6 +486,32 @@ export default {
}) })
}, 500) }, 500)
}, },
async standardConfigChange(val) {
console.log('🚀 ~ standardConfigChange ~ val:', val)
try {
const loading = this.$loading()
const params = {
configId: val.id
}
const res = await getListsByConfigId(params)
console.log('🚀 ~ standardConfigChange ~ res:', res)
// this.equipmentList.unshift(...res.data)
res.data.forEach(newItem => {
const existingItem = this.equipmentList.find(item => item.typeId === newItem.typeId)
if (existingItem) {
existingItem.preNum += newItem.preNum
} else {
this.equipmentList.unshift(newItem)
}
})
loading.close()
} catch (error) {
console.log('🚀 ~ error:', error)
loading.close()
}
},
/** 租赁单位和工程-下拉选 */ /** 租赁单位和工程-下拉选 */
projectInfoList() { projectInfoList() {
if (!this.isEdit) { if (!this.isEdit) {
@ -438,20 +530,6 @@ export default {
}) })
} }
}, },
// filterTree(nodes) {
// return nodes.map((node) => {
// if (node.children) {
// node.children = this.filterTree(node.children);
// }
// return node;
// });
// },
//
// changeSupplier(supplierId) {
// this.equipmentList.forEach((item) => {
// this.$set(item, 'supplierId', supplierId)
// })
// },
/** 机具类型 */ /** 机具类型 */
equipmentType() { equipmentType() {
equipmentTypeTree().then(response => { equipmentTypeTree().then(response => {
@ -547,29 +625,23 @@ export default {
}, },
//--- //---
async getTaskInfo() { async getTaskInfo() {
// this.loading = true; try {
await getApplyInfo(this.id).then(response => { const loading = this.$loading()
this.maForm = response.data.leaseApplyInfo const res = await getLeaseTaskDetail(this.id)
this.maForm.unitId = response.data.leaseApplyInfo.leaseUnitId console.log('🚀 ~ getTaskInfo ~ res:', res)
this.maForm.projectId = response.data.leaseApplyInfo.leaseProjectId this.maForm = res.data.leaseApplyInfo
this.unitId = this.treeParentsById(this.uniteList, this.maForm.unitId) this.maForm.unitId = res.data.leaseApplyInfo.leaseUnitId
this.projectId = this.treeParentsById(this.projectList, this.maForm.projectId) this.maForm.projectId = res.data.leaseApplyInfo.leaseProjectId
this.equipmentList = response.data.leaseApplyDetailsList this.equipmentList = res.data.leaseApplyDetailsList
// bmFileInfos // bmFileInfos
if (this.maForm.bmFileInfos.length > 0) { if (this.maForm.bmFileInfos && this.maForm.bmFileInfos.length > 0) {
this.isFileFbs = true this.isFileFbs = true
} }
// this.loading = false; loading.close()
}) } catch (error) {
// await this.projectInfoList(); console.log('🚀 ~ error:', error)
}, loading.close()
checkNum(row) { }
// let maxNum = row.storageNum
// if (row.preNum <= 1) {
// row.preNum = 1
// } else if (row.preNum > maxNum) {
// row.preNum = maxNum-1
// }
}, },
// //
treeParentsById(list, id) { treeParentsById(list, id) {
@ -595,10 +667,6 @@ export default {
// console.log(this.equipmentList) // console.log(this.equipmentList)
console.log('maForm', this.maForm) console.log('maForm', this.maForm)
if (this.equipmentList.length > 0) { if (this.equipmentList.length > 0) {
// if(this.bmFileInfos.length > 0){
// console.log(33333333333333333333333333333333333)
// this.$refs["maForm"].clearValidate('bmFileInfos');
// }
this.$refs['maForm'].validate(async valid => { this.$refs['maForm'].validate(async valid => {
if (valid) { if (valid) {
for (let i = 0; i < this.equipmentList.length; i++) { for (let i = 0; i < this.equipmentList.length; i++) {
@ -611,8 +679,6 @@ export default {
return return
} }
} }
console.log('projectId', this.projectTemp)
await getAgreement({ await getAgreement({
unitId: this.maForm.unitId, unitId: this.maForm.unitId,
projectId: this.maForm.projectId projectId: this.maForm.projectId
@ -620,47 +686,44 @@ export default {
this.agreementId = response.data.agreementId this.agreementId = response.data.agreementId
this.maForm.agreementId = this.agreementId this.maForm.agreementId = this.agreementId
}) })
this.maForm.taskId = this.taskId
// this.maForm.checkDetailsList = this.equipmentList
await this.$modal await this.$modal
.confirm('是否确认保存当前页面') .confirm('是否确认保存当前页面')
.then(function () {}) .then(async () => {
.then(() => {
if (this.isEdit) { if (this.isEdit) {
this.maForm.leaseUnitId = this.maForm.unitId try {
this.maForm.leaseProjectId = this.maForm.projectId const res = await editLeaseTask({
console.log('编辑')
this.loading = true
updateApplyInfo({
leaseApplyDetailsList: this.equipmentList, leaseApplyDetailsList: this.equipmentList,
leaseApplyInfo: this.maForm leaseApplyInfo: this.maForm
}).then(response => { })
if (response.code == 200) { if (res.code === 200) {
this.$modal.msgSuccess('编辑成功') this.$modal.msgSuccess('编辑成功')
// this.$tab.closeOpenPage({ //
// path: '/store/newBuy/newDevicesList', this.$tab.closePage()
// })
this.$emit('addToolsSuccess')
} }
this.loading = false this.loading = false
}) } catch (error) {
console.log('🚀 ~ error:', error)
this.loading = false
}
} else if (!this.isEdit) { } else if (!this.isEdit) {
console.log('新增') console.log('新增')
// console.log(this.equipmentList) console.log(this.equipmentList)
this.loading = true this.loading = true
addApplyInfo({ try {
const res = await addLeaseTask({
leaseApplyDetailsList: this.equipmentList, leaseApplyDetailsList: this.equipmentList,
leaseApplyInfo: this.maForm leaseApplyInfo: this.maForm
}).then(response => { })
if (response.code == 200) { if (res.code === 200) {
this.$modal.msgSuccess('新增成功') this.$modal.msgSuccess('新增成功')
// this.$tab.closeOpenPage({ this.$refs['maForm'].resetFields()
// path: '/store/newBuy/newDevicesList', this.equipmentList = []
// })
} }
this.loading = false this.loading = false
}) } catch (error) {
console.log('🚀 ~ error:', error)
this.loading = false
}
} }
}) })
.catch(() => {}) .catch(() => {})
@ -682,11 +745,64 @@ export default {
.catch(() => {}) .catch(() => {})
}, },
//
handleChangeBusinessList(file, fileList) {
const fileListTemp = fileList.filter(item => {
return item.uid != file.uid
})
const parts = file.name.split('.')
const extension = parts.pop().toLowerCase()
if (fileList.length > 5) {
this.$message.warning('最多上传5张附件')
fileList = fileList.filter(item => {
return item.uid != file.uid
})
} else if (!(extension === 'pdf' || 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) { updataIf(e) {
if (e.fileName) { if (e.fileName) {
const parts = e.fileName.split('.') const parts = e.fileName.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 {
@ -694,7 +810,7 @@ export default {
} }
} else { } else {
const parts = e.name.split('.') 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 {
@ -702,6 +818,44 @@ export default {
} }
} }
}, },
//-
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)
},
handleDownload(file) {
console.log(file)
if (file.status === 'ready') {
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 })
}
},
// //
highlightText(text, keyword) { highlightText(text, keyword) {
if (!keyword) return text if (!keyword) return text

View File

@ -0,0 +1,237 @@
<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="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>
<!-- 表单按钮 -->
<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 == '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.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>
</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
v-if="scope.row.status == '0'"
type="text"
size="mini"
icon="el-icon-edit"
@click="handleEdit(scope.row, 2)"
>
编辑
</el-button>
<el-button
v-if="scope.row.status == '0'"
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 { getReceiveList, receiveDelete } from '@/api/business/index'
export default {
data() {
return {
showSearch: true,
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: '', //
status: '', //
timeRange: [] //
},
//
statusOptions: [
{ label: '待审核', value: '1' },
{ label: '审核中', value: '2' },
{ label: '已完成', value: '3' }
],
total: 0, //
//
tableColumns: [
{ label: '申请时间', prop: 'createTime' },
{ label: '申请人', prop: 'leaseMan' },
{ label: '转出单位', prop: 'backUnitName' },
{ label: '转出工程', prop: 'backProName' },
{ label: '转入单位', prop: 'leaseUnitName' },
{ label: '转入工程', prop: 'leaseProName' },
{ label: '物资类型', prop: 'typeName' },
{ label: '状态', prop: 'status' }
],
//
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 getReceiveList(params)
console.log('🚀 ~ 获取列表 ~ res:', res)
this.tableList = res.rows
this.total = res.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 receiveDelete(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

@ -2,9 +2,9 @@
<!-- 基础页面 --> <!-- 基础页面 -->
<div class="app-container"> <div class="app-container">
<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="createTimeRange"> <el-form-item label="申请日期" prop="timeRange">
<el-date-picker <el-date-picker
v-model="queryParams.createTimeRange" v-model="queryParams.timeRange"
type="daterange" type="daterange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
@ -22,8 +22,8 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="审核状态" prop="status"> <el-form-item label="审核状态" prop="taskStatus">
<el-select v-model="queryParams.status" placeholder="请选择审核状态" clearable> <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-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,18 +64,31 @@
align="center" align="center"
> >
<!-- 插槽 --> <!-- 插槽 -->
<!-- <template v-slot="scope" v-if="column.prop == 'checkingInStatus'"> <template v-slot="scope" v-if="column.prop == 'taskStatus'">
<span> <el-tag v-if="scope.row.taskStatus == '0'" type="warning" size="mini" style="margin-right: 5px">
<el-switch v-model="scope.row.checkingInStatus" @change="changeSwitch(scope.row)"></el-switch> 待审核
</span> </el-tag>
</template> --> <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>
<!-- 操作 --> <!-- 操作 -->
<el-table-column label="操作" align="center" width="180"> <el-table-column label="操作" align="center" width="180">
<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 type="text" size="mini" icon="el-icon-edit" @click="handleEdit(scope.row, 2)">编辑</el-button>
<el-button <el-button
v-if="scope.row.taskStatus == '0'"
type="text"
size="mini"
icon="el-icon-edit"
@click="handleEdit(scope.row, 2)"
>
编辑
</el-button>
<el-button
v-if="scope.row.taskStatus == '0'"
type="text" type="text"
size="mini" size="mini"
icon="el-icon-delete" icon="el-icon-delete"
@ -100,7 +113,7 @@
</template> </template>
<script> <script>
// import { } from '' import { getLeaseTaskList, deleteLeaseTask } from '@/api/business/index'
export default { export default {
data() { data() {
@ -110,8 +123,8 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
keyWord: '', // keyWord: '', //
checkingInStatus: '', // taskStatus: '', //
createTimeRange: [] // timeRange: [] //
}, },
// //
statusOptions: [ statusOptions: [
@ -122,42 +135,19 @@ export default {
total: 0, // total: 0, //
// //
tableColumns: [ tableColumns: [
{ label: '申请时间', prop: 'applyTime' }, { label: '申请时间', prop: 'createTime' },
{ label: '申请人', prop: 'applyUser' }, { label: '申请人', prop: 'createBy' },
{ label: '租赁单位', prop: 'leaseUnit' }, { label: '领用单位', prop: 'leaseUnit' },
{ label: '租赁工程', prop: 'leaseProject' }, { label: '领用工程', prop: 'leaseProject' },
{ label: '领料物资类型', prop: 'materialType' }, { label: '领料物资类型', prop: 'maTypeNames' },
{ label: '协议号', prop: 'protocolNumber' }, { label: '协议号', prop: 'agreementCode' },
{ label: '租赁申请单号', prop: 'leaseApplicationNumber' }, { label: '采购申请单号', prop: 'applyCode' },
{ label: '领料人', prop: 'materialReceiver' }, { label: '领料人', prop: 'leasePerson' },
{ label: '领料人电话', prop: 'materialReceiverPhone' }, { label: '领料人电话', prop: 'phone' },
{ label: '状态', prop: 'status' }, { label: '状态', prop: 'taskStatus' }
{ label: '备注', prop: 'remark' }
], ],
// //
tableList: [ tableList: []
{
applyTime: '2021-08-01',
applyUser: '张三',
leaseUnit: '租赁单位',
leaseProject: '租赁工程',
materialType: '领料物资类型',
protocolNumber: '协议号',
leaseApplicationNumber: '租赁申请单号',
materialReceiver: '领料人',
materialReceiverPhone: '领料人电话',
status: '待审核',
remark: '备注'
}
],
dialogTitle: '新增',
dialogVisible: false,
dialogForm: {
hazardIssueCategories: '' //
},
dialogRules: {
hazardIssueCategories: [{ required: true, message: '请输入隐患问题类别', trigger: 'blur' }]
}
} }
}, },
created() { created() {
@ -179,11 +169,15 @@ export default {
async getList() { async getList() {
console.log('列表-查询', this.queryParams) console.log('列表-查询', this.queryParams)
try { try {
// const params = { ...this.queryParams } const params = {
// const res = await ...this.queryParams,
// console.log('🚀 ~ ~ res:', res) startTime: this.queryParams.timeRange[0] || '',
// this.tableList = res.rows endTime: this.queryParams.timeRange[1] || ''
// this.total = res.total }
const res = await getLeaseTaskList(params)
console.log('🚀 ~ 获取列表 ~ res:', res)
this.tableList = res.data.rows
this.total = res.data.total || 0
} catch (error) { } catch (error) {
console.log('🚀 ~ 获取列表 ~ error:', error) console.log('🚀 ~ 获取列表 ~ error:', error)
this.tableList = [] this.tableList = []
@ -196,18 +190,18 @@ export default {
}, },
handleAdd() { handleAdd() {
console.log('领料申请') console.log('领料申请')
this.$router.push({ path: '/business/businessHandling/businessHandling/index' }) this.$router.push({ path: '/business/businessHandling/index' })
}, },
// //
handleEdit(row, type) { handleEdit(row, type) {
console.log('编辑', row) console.log('编辑', row)
let params = {} let params = {}
if (type === 1) { if (type === 1) {
params = { type: 'detail' } params = { type: 'detail', id: row.id }
} else { } else {
params = { type: 'edit' } 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) { handleDelete(row) {
@ -217,18 +211,15 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(async () => { }).then(async () => {
// const params = { } const res = await deleteLeaseTask(row.id)
// const res = await console.log('🚀 ~ 删除 ~ res:', res)
this.getList()
this.$message({ this.$message({
type: 'success', type: 'success',
message: '删除成功!' message: '删除成功!'
}) })
}) })
}, },
//
changeSwitch(row) {
console.log('开关', row)
},
// //
handleExport() { handleExport() {
try { try {
@ -240,21 +231,6 @@ export default {
} catch (error) { } catch (error) {
console.log('导出数据失败', error) console.log('导出数据失败', error)
} }
},
//
dialogConfirm() {
console.log('dialogConfirm')
this.$refs.dialogForm.validate(valid => {
if (valid) {
this.dialogVisible = false
this.$message({
type: 'success',
message: '操作成功!'
})
} else {
return false
}
})
} }
} }
} }

View File

@ -90,7 +90,7 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="类型规格" prop="deviceType"> <el-form-item label="类型规格xx" prop="deviceType">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="15"> <el-col :span="15">
<el-select <el-select
@ -586,6 +586,7 @@ export default {
this.equipmentTypeList = response.data; this.equipmentTypeList = response.data;
// //
this.flattenTypeOptions = this.processTypeData(response.data); this.flattenTypeOptions = this.processTypeData(response.data);
debugger
// //
this.filteredOptions = [...this.flattenTypeOptions]; this.filteredOptions = [...this.flattenTypeOptions];
@ -612,7 +613,8 @@ export default {
maTypeName: parents[parents.length - 1] || '', maTypeName: parents[parents.length - 1] || '',
specificationType: node.typeName, specificationType: node.typeName,
unitName: node.unitName, unitName: node.unitName,
unitValue: node.unitValue unitValue: node.unitValue,
maxSortPriority: node.maxSortPriority
}); });
} }
@ -622,6 +624,10 @@ export default {
}; };
data.forEach(node => traverse(node)); data.forEach(node => traverse(node));
// ApiNode maxSortPriority
result.sort((a, b) => b.maxSortPriority - a.maxSortPriority);
return result; return result;
}, },
// //