代码提交
This commit is contained in:
parent
28eb3f2fab
commit
ebe21dfd11
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="upload-file">
|
||||
<el-upload
|
||||
<z
|
||||
multiple
|
||||
:action="uploadFileUrl"
|
||||
:before-upload="handleBeforeUpload"
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
|
||||
的文件
|
||||
</div>
|
||||
</el-upload>
|
||||
</z>
|
||||
|
||||
<!-- 文件列表 -->
|
||||
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,379 @@
|
|||
<template>
|
||||
<!-- 修复标题模板字符串语法错误,规范属性顺序 -->
|
||||
<el-dialog
|
||||
title="新增装备"
|
||||
:visible.sync="isVisible"
|
||||
width="70%"
|
||||
style="z-index: 3000 !important;"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
:before-close="handleClose"
|
||||
destroy-on-close
|
||||
>
|
||||
<!-- 弹窗内容区域 -->
|
||||
<div class="app-content">
|
||||
<el-form
|
||||
label-width="180px"
|
||||
ref="formRef"
|
||||
label-position="right"
|
||||
:model="form"
|
||||
:rules="equipRules"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="装备名称:" prop="deviceName">
|
||||
<el-input
|
||||
autocomplete="off"
|
||||
maxlength="30"
|
||||
v-model="form.deviceName"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="装备类目:" prop="deviceTypeList">
|
||||
<el-cascader
|
||||
v-model="form.deviceTypeList"
|
||||
:show-all-levels="true"
|
||||
:options="deviceTypeTree"
|
||||
:props="partTypeTreeProps"
|
||||
placeholder="请选择装备类目"
|
||||
ref="dialogTypeCascader"
|
||||
@change="dialogTypeChange"
|
||||
style="width: 100%"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="装备单位:" prop="unitName">
|
||||
<el-input
|
||||
autocomplete="off"
|
||||
maxlength="20"
|
||||
v-model="form.unitName"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="装备品牌" prop="brand">
|
||||
<el-input
|
||||
v-model="form.brand"
|
||||
autocomplete="off"
|
||||
maxlength="20"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="出厂日期:" prop="productionDate">
|
||||
<el-date-picker
|
||||
v-model="form.productionDate"
|
||||
placeholder="请选择出厂日期"
|
||||
value-format="yyyy-MM-DD"
|
||||
type="date"
|
||||
style="width: 100%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="租赁价格(天/元):" prop="dayLeasePrice">
|
||||
<el-input
|
||||
@input="handlePriceInput"
|
||||
clearable
|
||||
maxlength="20"
|
||||
placeholder="请输入租赁价格"
|
||||
v-model="form.dayLeasePrice"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系人:" prop="person">
|
||||
<el-input
|
||||
v-model="form.person"
|
||||
placeholder="请输入联系人"
|
||||
clearable
|
||||
maxlength="10"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话:" prop="personPhone">
|
||||
<el-input
|
||||
v-model="form.personPhone"
|
||||
placeholder="请输入联系电话"
|
||||
clearable
|
||||
maxlength="11"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="装备数量:" prop="deviceCount">
|
||||
<el-input
|
||||
v-model="form.deviceCount"
|
||||
placeholder="请输入装备数量"
|
||||
type="number"
|
||||
clearable
|
||||
maxlength="10"
|
||||
:disabled="form.deviceType == 0"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 临时录入使用 - start -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="原值:" prop="buyPrice">
|
||||
<el-input-number
|
||||
v-model="form.buyPrice"
|
||||
placeholder="请输入原值"
|
||||
clearable
|
||||
maxlength="20"
|
||||
:controls="false"
|
||||
align="left"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="管理方式:" prop="deviceType">
|
||||
<!-- 0 编码 1 数量 -->
|
||||
<el-select
|
||||
v-model="form.deviceType"
|
||||
placeholder="请选择管理方式"
|
||||
clearable
|
||||
@change="deviceTypeChange"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option label="编码" :value="0"/>
|
||||
<el-option label="数量" :value="1"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="标准使用时间:" prop="expirationTime">
|
||||
<el-date-picker
|
||||
type="date"
|
||||
style="width: 100%"
|
||||
value-format="yyyy-MM-DD"
|
||||
placeholder="请选择标准使用时间"
|
||||
v-model="form.expirationTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<!-- 底部按钮区域 -->
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">确认</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { equipmentAddApiNew, getEquipmentAddIdApi, getEquipmentTypeApi } from '@/api/EquipmentEntryApply'
|
||||
|
||||
export default {
|
||||
name: 'EquipmentEntryEditDialog', // 明确组件名称
|
||||
props: {
|
||||
// 重命名prop,避免与内置属性冲突
|
||||
isVisible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
description: '控制弹窗显示与隐藏'
|
||||
},
|
||||
orderId: {
|
||||
type: String,
|
||||
default: '',
|
||||
description: '关联的订单ID字符串'
|
||||
}
|
||||
},
|
||||
emits: ['update:isVisible', 'submit', 'getOrderId'], // 声明事件
|
||||
data() {
|
||||
return {
|
||||
deviceTypeTree: [],
|
||||
partTypeTreeProps: {
|
||||
children: 'children',
|
||||
label: 'name',
|
||||
value: 'id'
|
||||
|
||||
},
|
||||
orderId: '',
|
||||
form: {
|
||||
deviceName: '',
|
||||
deviceTypeList: [],
|
||||
deviceCount: 1,
|
||||
originaValue: '',
|
||||
itemTypeModel: '',
|
||||
deviceType: '',
|
||||
buyPrice: '',
|
||||
unitName: '',
|
||||
code: '',
|
||||
brand: '',
|
||||
typeId: '',
|
||||
companyId: '',
|
||||
productionDate: '',
|
||||
dayLeasePrice: '',
|
||||
person: '',
|
||||
personPhone: '',
|
||||
deviceWeight: '',
|
||||
checkDate: '',
|
||||
checkCycle: '',
|
||||
devInfoProperties: [],
|
||||
tableList: [],
|
||||
isZone: true,
|
||||
zoneId: '',
|
||||
expirationTime: '',
|
||||
orderId: ''
|
||||
},// 表单校验规则(已移除文件相关校验)
|
||||
equipRules: {
|
||||
originaValue: [
|
||||
{ required: true, message: '请输入原值', trigger: 'blur' }
|
||||
],
|
||||
buyPrice: [
|
||||
{ required: true, message: '请输入原值', trigger: 'blur' }
|
||||
],
|
||||
itemTypeModel: [
|
||||
{ required: true, message: '请输入规格型号', trigger: 'blur' }
|
||||
],
|
||||
deviceType: [
|
||||
{ required: false, message: '请选择管理方式', trigger: 'change' }
|
||||
],
|
||||
deviceName: [
|
||||
{ required: true, message: '请输入装备名称', trigger: 'blur' }
|
||||
],
|
||||
deviceTypeList: [
|
||||
{ required: true, message: '请选择装备类目', trigger: 'change' }
|
||||
],
|
||||
deviceCount: [
|
||||
{ required: true, message: '请输入装备数量', trigger: 'blur' }
|
||||
],
|
||||
unitName: [
|
||||
{ required: true, message: '装备单位不可为空', trigger: 'blur' }
|
||||
],
|
||||
brand: [
|
||||
{ required: true, message: '请输入装备品牌', trigger: 'blur' }
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: '请输入装备编号', trigger: 'change' }
|
||||
],
|
||||
companyId: [
|
||||
{ required: true, message: '请选择所属公司', trigger: 'change' }
|
||||
],
|
||||
productionDate: [
|
||||
{ required: true, message: '请选择出厂日期', trigger: 'change' }
|
||||
],
|
||||
dayLeasePrice: [
|
||||
{ required: true, message: '请输入日租金', trigger: 'blur' }
|
||||
],
|
||||
expirationTime: [
|
||||
{ required: true, trigger: 'change', message: '请选择标准使用时间' }
|
||||
],
|
||||
person: [
|
||||
{ required: true, message: '联系人不能为空', trigger: 'blur' }
|
||||
],
|
||||
checkDate: [
|
||||
{ required: true, message: '校验日期不能为空', trigger: 'blur' }
|
||||
],
|
||||
checkCycle: [
|
||||
{ required: true, message: '校验周期不能为空', trigger: 'blur' }
|
||||
],
|
||||
personPhone: [
|
||||
{ required: true, message: '联系电话不能为空', trigger: 'blur' },
|
||||
{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: '请输入正确的手机号码', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isVisible(val) {
|
||||
if (val) {
|
||||
this.getTypeTreeData()
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
deviceTypeChange(val) {
|
||||
if (val === 0) {
|
||||
this.form.deviceCount = '1'
|
||||
}
|
||||
},
|
||||
async dialogTypeChange() {
|
||||
this.options = []
|
||||
const cascader = this.$refs.dialogTypeCascader
|
||||
const deviceTypeList = cascader.getCheckedNodes()
|
||||
if (deviceTypeList.length > 0) {
|
||||
this.form.unitName = deviceTypeList[0].data.unitName
|
||||
this.form.dayLeasePrice = deviceTypeList[0].data.leasePrice
|
||||
}
|
||||
},
|
||||
// 价格输入处理
|
||||
handlePriceInput(v) {
|
||||
this.form.dayLeasePrice = v.replace(/[^\d.]/g, '')
|
||||
},
|
||||
// 获取设备类型树
|
||||
async getTypeTreeData() {
|
||||
const res = await getEquipmentTypeApi()
|
||||
this.deviceTypeTree = res.data
|
||||
},
|
||||
/**
|
||||
* 处理弹窗关闭
|
||||
*/
|
||||
handleClose() {
|
||||
this.$refs.formRef.resetFields()
|
||||
this.$emit('update:isVisible', false)
|
||||
},
|
||||
|
||||
/**
|
||||
* 处理表单提交
|
||||
*/
|
||||
async handleSubmit() {
|
||||
this.$refs['formRef'].validate(async valid => {
|
||||
if (valid) {
|
||||
if (!this.orderId) {
|
||||
const result = await getEquipmentAddIdApi()
|
||||
this.orderId = result.data.id
|
||||
}
|
||||
this.form.orderId = this.orderId
|
||||
// 获取数组最后一个元素(最末级分类ID)
|
||||
this.form.typeId = this.form.deviceTypeList[this.form.deviceTypeList.length - 1]
|
||||
const res = await equipmentAddApiNew(this.form)
|
||||
if (res.code === 200) {
|
||||
// 可添加表单验证逻辑
|
||||
this.$emit('getOrderId', {
|
||||
orderId: this.orderId
|
||||
})
|
||||
this.handleClose()
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dialog-content {
|
||||
padding: 10px 0;
|
||||
min-height: 200px; // 确保有足够高度
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 10px; // 按钮间距
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,349 @@
|
|||
<template>
|
||||
<!-- 修复标题模板字符串语法错误,规范属性顺序 -->
|
||||
<el-dialog
|
||||
title="装备录入"
|
||||
:visible.sync="isVisible"
|
||||
width="70%"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
:before-close="handleClose"
|
||||
destroy-on-close
|
||||
>
|
||||
<!-- 弹窗内容区域 -->
|
||||
<div class="app-content">
|
||||
<!-- 商品管理 -->
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
inline
|
||||
label-width="auto"
|
||||
size="small"
|
||||
>
|
||||
<!-- 表单搜索 -->
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="装备名称" prop="deviceName">
|
||||
<el-input
|
||||
v-model.trim="queryParams.deviceName"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
placeholder="请输入装备名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="5" style="float: right">
|
||||
<el-form-item>
|
||||
<el-button class="primary-lease" type="primary" @click="queryTableList">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button
|
||||
class="primary-lease"
|
||||
type="primary"
|
||||
@click="resetTableList"
|
||||
>
|
||||
重置
|
||||
</el-button>
|
||||
<el-button
|
||||
class="primary-lease"
|
||||
type="primary"
|
||||
@click="equipmentDeployment"
|
||||
v-show="!isAddVisible"
|
||||
>
|
||||
新增装备
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
:data="tableData"
|
||||
style="width: auto"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<el-table-column label="序号" align="center" width="80" type="index"></el-table-column>
|
||||
<el-table-column align="center" label="装备名称">
|
||||
<template scope="{ row }">
|
||||
{{ `${row.deviceName}` }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="code" label="装备编号"/>
|
||||
<el-table-column align="center" prop="typeName" label="装备类目">
|
||||
<template scope="{ row }">
|
||||
<span>
|
||||
{{ row.proType }} <span v-show="row.proType">/</span>
|
||||
{{ row.mainGx }}<span v-show="row.mainGx">/</span>
|
||||
{{ row.childGx }}<span v-show="row.childGx">/</span>
|
||||
{{ row.devCategory }}<span v-show="row.devCategory">/</span>
|
||||
{{ row.devSubcategory }}<span v-show="row.devSubcategory">/</span>
|
||||
{{ row.devName }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="devModel" label="装备型号"/>
|
||||
<el-table-column align="center" prop="nextCheckDate" label="下次检验日期">
|
||||
<template scope="{ row }">
|
||||
<span>{{
|
||||
row.nextCheckDate
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="装备状态">
|
||||
<template scope="{ row }">
|
||||
<el-tag v-if="row.entryStatus == 0" size="small" type="info">待审批</el-tag>
|
||||
<el-tag v-if="row.entryStatus == 1" size="small" type="warning">已审批</el-tag>
|
||||
<el-tag v-if="row.entryStatus == 2" size="small" type="success">审批驳回</el-tag>
|
||||
<el-tag v-if="row.entryStatus == 3" size="small" type="danger">草稿</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="操作"
|
||||
min-width="160px"
|
||||
align="center"
|
||||
v-if="!isAddVisible"
|
||||
>
|
||||
<template scope="{ row }">
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="editRowInfo(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="danger"
|
||||
@click="deleteRowInfo(row)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="操作"
|
||||
min-width="160px"
|
||||
align="center"
|
||||
v-if="!isApprovalVisible"
|
||||
>
|
||||
<template scope="{ row }">
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="approval(row,1)"
|
||||
>
|
||||
通过
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="approval(row,2)"
|
||||
>
|
||||
驳回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 底部按钮区域 -->
|
||||
<template #footer>
|
||||
<div class="dialog-footer" v-show="!isAddVisible">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit" :disabled="tableData.length==0">确认提交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<EquipmentEntryEditDialog
|
||||
:is-visible.sync="isEditVisible"
|
||||
:order-id="orderId"
|
||||
@getOrderId="getOrderId"
|
||||
/>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import EquipmentEntryEditDialog from '@/views/EquipmentEntryApply/equipmentInput/edit.vue'
|
||||
|
||||
// 使用defineComponent规范组件定义
|
||||
import {
|
||||
equipmentDraftListApiNew,
|
||||
equipmentPassAndRejectApiNew,
|
||||
equipmentSubmitApiNew,
|
||||
removeDeviceApi
|
||||
} from '@/api/EquipmentEntryApply'
|
||||
|
||||
export default {
|
||||
name: 'EquipmentEntryDialog',
|
||||
components: { EquipmentEntryEditDialog },
|
||||
// 明确组件名称
|
||||
props: {
|
||||
// 重命名prop,避免与内置属性冲突
|
||||
isVisible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
description: '控制弹窗显示与隐藏'
|
||||
},
|
||||
isAddVisible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
orderId: {
|
||||
type: String,
|
||||
default: '',
|
||||
description: '关联的订单ID字符串'
|
||||
},
|
||||
isApprovalVisible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
emits: ['update:isVisible', 'submit'], // 声明事件
|
||||
data() {
|
||||
return {
|
||||
isEditVisible: false,
|
||||
// 表格数据
|
||||
tableData: [],
|
||||
total: 0,
|
||||
queryParams: {
|
||||
orderId: '',
|
||||
deviceName: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
// 可添加表单数据
|
||||
formData: {
|
||||
// 示例字段,可根据实际需求修改
|
||||
equipmentName: '',
|
||||
model: '',
|
||||
quantity: 1
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isVisible(val) {
|
||||
if (val) {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async approval(row, status) {
|
||||
equipmentPassAndRejectApiNew({ devIds: row.maId, status: status, id: this.orderId }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功'
|
||||
})
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取列表数据
|
||||
async getList() {
|
||||
try {
|
||||
this.queryParams.orderId = this.orderId
|
||||
const res = await equipmentDraftListApiNew(this.queryParams)
|
||||
this.tableData = res.data.rows
|
||||
this.total = res.data.total
|
||||
} catch (error) {
|
||||
console.error('获取列表失败:', error)
|
||||
}
|
||||
},
|
||||
|
||||
getOrderId(data) {
|
||||
this.orderId = data.orderId
|
||||
this.queryTableList()
|
||||
},
|
||||
|
||||
// 查询表格数据
|
||||
queryTableList() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
equipmentDeployment() {
|
||||
this.isEditVisible = true
|
||||
},
|
||||
|
||||
// 删除按钮
|
||||
async deleteRowInfo(row) {
|
||||
this.$confirm('是否确定删除?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
return removeDeviceApi([row.maId])
|
||||
})
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功'
|
||||
})
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
// 重置表格查询
|
||||
resetTableList() {
|
||||
this.$refs.queryFormRef.resetFields()
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
* 处理弹窗关闭
|
||||
*/
|
||||
handleClose() {
|
||||
this.$emit('update:isVisible', false)
|
||||
},
|
||||
|
||||
/**
|
||||
* 处理表单提交
|
||||
*/
|
||||
handleSubmit() {
|
||||
equipmentSubmitApiNew({ id: this.orderId, status: 0 }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '提交成功'
|
||||
})
|
||||
this.handleClose()
|
||||
this.$emit('submit', {
|
||||
orderId: this.orderId
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dialog-content {
|
||||
padding: 10px 0;
|
||||
min-height: 200px; // 确保有足够高度
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 10px; // 按钮间距
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,19 +1,15 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<template v-if="!isEquipmentInputShow">
|
||||
<el-form :model="queryParams" ref="queryFormRef" inline label-width="auto" size="small">
|
||||
<template>
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
inline
|
||||
label-width="auto"
|
||||
size="small"
|
||||
>
|
||||
<!-- 表单搜索 -->
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="关键字" prop="keyWord">
|
||||
<el-input
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请输入关键字"
|
||||
v-model.trim="queryParams.keyWord"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="审批状态" prop="status">
|
||||
<el-select
|
||||
|
|
@ -35,32 +31,24 @@
|
|||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择申请时间"
|
||||
v-model="queryParams.applyTime"
|
||||
>
|
||||
</el-date-picker>
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<el-form-item prop="code">
|
||||
<el-button class="primary-lease" type="primary" @click="onHandleSQuery()">
|
||||
<el-col :span="5" style="float:right;">
|
||||
<el-form-item>
|
||||
<el-button class="primary-lease" type="primary" @click="getEquipmentApplyList">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button class="primary-lease" type="primary" @click="onHandleReset()">
|
||||
<el-button class="primary-lease" type="primary" @click="resetForm">
|
||||
重置
|
||||
</el-button>
|
||||
<el-button
|
||||
class="primary-lease"
|
||||
type="primary"
|
||||
@click="onHandleEquipmentInput()"
|
||||
@click="showEquipmentInput()"
|
||||
>
|
||||
装备录入
|
||||
</el-button>
|
||||
<el-button
|
||||
class="primary-lease"
|
||||
type="primary"
|
||||
@click="onHandleBatchImport()"
|
||||
>
|
||||
批量导入
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -80,25 +68,25 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<el-button type="primary" size="small" @click="onHandleView(row)">
|
||||
<el-button type="primary" size="small" @click="showEquipmentInput(row.id, true)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="onHandleEdit(row)"
|
||||
v-if="row.status == 3"
|
||||
@click="showEquipmentInput(row.id, false)"
|
||||
v-if="row.status == '3'"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" @click="onHandleDelete(row)">
|
||||
<!-- <el-button type="primary" size="small" v-if="row.status == '0'" @click="deleteItem(row)">
|
||||
删除
|
||||
</el-button>
|
||||
</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination
|
||||
:total="total"
|
||||
@pagination="handlePageChange"
|
||||
|
|
@ -107,27 +95,31 @@
|
|||
/>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<EquipmentInput :order-ids="orderIds" :is-view="isView" v-else @backList="onHandleBackList"/>
|
||||
<EquipmentEntryDialog
|
||||
:is-visible.sync="isVisible"
|
||||
:order-id="orderId"
|
||||
:is-add-visible="isAddVisible"
|
||||
:is-approval-visible="true"
|
||||
@submit="getEquipmentApplyList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getEquipmentApplyListApi, equipmentDelApiNew } from '@/api/EquipmentEntryApply/index'
|
||||
import EquipmentInput from '@/views/EquipmentEntryApply/equipmentInput/index.vue'
|
||||
import EquipmentEntryDialog from '@/views/EquipmentEntryApply/equipmentInput/index1.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
EquipmentInput
|
||||
EquipmentEntryDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
total: 0,
|
||||
orderIds: '',
|
||||
isView: false,
|
||||
isEquipmentInputShow: false,
|
||||
orderId: '',
|
||||
isVisible: false,
|
||||
isAddVisible: false,
|
||||
queryParams: {
|
||||
keyWord: '',
|
||||
status: '',
|
||||
applyTime: '',
|
||||
pageNum: 1,
|
||||
|
|
@ -140,106 +132,72 @@ export default {
|
|||
this.getEquipmentApplyList()
|
||||
},
|
||||
methods: {
|
||||
// 获取装备申请列表
|
||||
/**
|
||||
* 获取装备申请列表
|
||||
*/
|
||||
getEquipmentApplyList() {
|
||||
getEquipmentApplyListApi(this.queryParams).then((res) => {
|
||||
console.log('获取装备申请列表***', res)
|
||||
this.tableData = res.data.rows
|
||||
this.total = res.data.total
|
||||
}).catch(error => {
|
||||
console.error('获取装备申请列表失败:', error)
|
||||
})
|
||||
getEquipmentApplyListApi(this.queryParams)
|
||||
.then(res => {
|
||||
this.tableData = res.data.rows
|
||||
this.total = res.data.total
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('获取装备申请列表失败:', error)
|
||||
})
|
||||
},
|
||||
|
||||
// 分页相关方法
|
||||
handlePageChange(pageNum) {
|
||||
this.queryParams.pageNum = pageNum
|
||||
/**
|
||||
* 分页变化处理
|
||||
*/
|
||||
handlePageChange() {
|
||||
this.getEquipmentApplyList()
|
||||
},
|
||||
|
||||
handleSizeChange(pageSize) {
|
||||
this.queryParams.pageSize = pageSize
|
||||
this.getEquipmentApplyList()
|
||||
},
|
||||
|
||||
onHandleSQuery() {
|
||||
console.log('查询')
|
||||
this.getEquipmentApplyList()
|
||||
},
|
||||
|
||||
onHandleReset() {
|
||||
console.log('重置')
|
||||
this.queryParams = {
|
||||
keyWord: '',
|
||||
status: '',
|
||||
applyTime: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
/**
|
||||
* 重置表单
|
||||
*/
|
||||
resetForm() {
|
||||
this.$refs.queryFormRef.resetFields()
|
||||
this.queryParams.pageNum = 1
|
||||
this.getEquipmentApplyList()
|
||||
},
|
||||
|
||||
onHandleEquipmentInput() {
|
||||
this.orderIds = ''
|
||||
this.isView = false
|
||||
this.isEquipmentInputShow = true
|
||||
/**
|
||||
* 显示装备录入/编辑/查看界面
|
||||
*/
|
||||
showEquipmentInput(orderId, isAddVisible) {
|
||||
this.orderId = orderId
|
||||
this.isVisible = true
|
||||
this.isAddVisible = isAddVisible
|
||||
|
||||
},
|
||||
|
||||
onHandleBatchImport() {
|
||||
console.log('批量导入')
|
||||
},
|
||||
|
||||
onHandleView(row) {
|
||||
console.log('查看', row)
|
||||
this.orderIds = row.id
|
||||
this.isView = true
|
||||
this.isEquipmentInputShow = true
|
||||
},
|
||||
|
||||
onHandleEdit(row) {
|
||||
this.orderIds = row.id
|
||||
this.isView = false
|
||||
this.isEquipmentInputShow = true
|
||||
console.log('编辑', row)
|
||||
},
|
||||
|
||||
onHandleDelete(row) {
|
||||
/**
|
||||
* 删除项目
|
||||
*/
|
||||
deleteItem(row) {
|
||||
this.$confirm('是否确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
console.log('删除', row)
|
||||
equipmentDelApiNew({ id: row.id }).then((res) => {
|
||||
console.log('删除结果', res)
|
||||
})
|
||||
.then(() => equipmentDelApiNew({ id: row.id }))
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功',
|
||||
duration: 1000
|
||||
})
|
||||
this.$message.success('删除成功')
|
||||
this.getEquipmentApplyList()
|
||||
} else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '删除失败',
|
||||
duration: 1000
|
||||
})
|
||||
this.$message.error('删除失败')
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
if (error !== 'cancel') { // 排除取消操作的错误
|
||||
console.error('删除失败:', error)
|
||||
this.$message.error('删除失败,请重试')
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('删除失败:', error)
|
||||
this.$message.error('删除失败,请重试')
|
||||
})
|
||||
}).catch(() => {
|
||||
// 取消删除
|
||||
})
|
||||
},
|
||||
|
||||
onHandleBackList() {
|
||||
this.isEquipmentInputShow = false
|
||||
this.getEquipmentApplyList()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,19 +1,15 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<template v-if="!isEquipmentInputShow">
|
||||
<el-form :model="queryParams" ref="queryFormRef" inline label-width="auto" size="small">
|
||||
<template>
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
inline
|
||||
label-width="auto"
|
||||
size="small"
|
||||
>
|
||||
<!-- 表单搜索 -->
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="关键字" prop="keyWord">
|
||||
<el-input
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请输入关键字"
|
||||
v-model.trim="queryParams.keyWord"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="审批状态" prop="status">
|
||||
<el-select
|
||||
|
|
@ -22,8 +18,8 @@
|
|||
placeholder="请选择审批状态"
|
||||
v-model="queryParams.status"
|
||||
>
|
||||
<el-option label="待审批" value="0" />
|
||||
<el-option label="已审批" value="1" />
|
||||
<el-option label="待审批" value="0"/>
|
||||
<el-option label="已审批" value="1"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -35,53 +31,51 @@
|
|||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择申请时间"
|
||||
v-model="queryParams.applyTime"
|
||||
>
|
||||
</el-date-picker>
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<el-form-item prop="code">
|
||||
<el-button class="primary-lease" type="primary" @click="onHandleSQuery()">
|
||||
<el-col :span="5" style="float:right;">
|
||||
<el-form-item>
|
||||
<el-button class="primary-lease" type="primary" @click="getEquipmentApplyList">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button class="primary-lease" type="primary" @click="onHandleReset()">
|
||||
<el-button class="primary-lease" type="primary" @click="resetForm">
|
||||
重置
|
||||
</el-button>
|
||||
<el-button
|
||||
class="primary-lease"
|
||||
type="primary"
|
||||
@click="onHandleBatchImport()"
|
||||
>
|
||||
批量导入
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table :data="tableData">
|
||||
<el-table-column label="序号" align="center" width="55" type="index" />
|
||||
<el-table-column prop="createUser" label="申请人" align="center" />
|
||||
<el-table-column prop="createTime" label="申请时间" align="center" />
|
||||
<el-table-column prop="devCount" label="设备数量" align="center" />
|
||||
<el-table-column label="序号" align="center" width="55" type="index"/>
|
||||
<el-table-column prop="createUser" label="申请人" align="center"/>
|
||||
<el-table-column prop="createTime" label="申请时间" align="center"/>
|
||||
<el-table-column prop="devCount" label="设备数量" align="center"/>
|
||||
<el-table-column prop="status" align="center" label="审批状态">
|
||||
<template slot-scope="{ row }">
|
||||
<el-tag v-if="row.status == 0" size="small" type="info">待审批</el-tag>
|
||||
<el-tag v-if="row.status == 1" size="small" type="warning">已完成</el-tag>
|
||||
<el-tag v-if="row.status == 3" size="small" type="success">草稿</el-tag>
|
||||
<el-tag v-if="row.status == 1" size="small" type="warning">已审批</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<el-button type="primary" size="small" @click="onHandleView(row)">
|
||||
<el-button type="primary" size="small" @click="showEquipmentInput(row.id, true)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" @click="onHandleAuditing(row)">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="showEquipmentInput(row.id, false)"
|
||||
v-if="row.status == '0'"
|
||||
>
|
||||
审批
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination
|
||||
:total="total"
|
||||
@pagination="handlePageChange"
|
||||
|
|
@ -90,31 +84,35 @@
|
|||
/>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<!-- <EquipmentInput :order-ids="orderIds" :is-view="isView" v-else @backList="onHandleBackList" />-->
|
||||
<EquipmentEntryDialog
|
||||
:is-visible.sync="isVisible"
|
||||
:order-id="orderId"
|
||||
:is-add-visible="true"
|
||||
:is-approval-visible="isApprovalVisible"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getEquipmentApplyListApi, equipmentDelApiNew } from '@/api/EquipmentEntryApply/index'
|
||||
|
||||
import EquipmentEntryDialog from '@/views/EquipmentEntryApply/equipmentInput/index1.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
/* EquipmentInput */
|
||||
EquipmentEntryDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
total: 0,
|
||||
orderIds: '',
|
||||
isView: false,
|
||||
isEquipmentInputShow: false,
|
||||
orderId: '',
|
||||
isVisible: false,
|
||||
isAddVisible: false,
|
||||
isApprovalVisible: false,
|
||||
queryParams: {
|
||||
keyWord: '',
|
||||
status: '0',
|
||||
applyTime: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 10
|
||||
},
|
||||
tableData: []
|
||||
}
|
||||
|
|
@ -123,106 +121,79 @@ export default {
|
|||
this.getEquipmentApplyList()
|
||||
},
|
||||
methods: {
|
||||
// 获取装备申请列表
|
||||
/**
|
||||
* 获取装备申请列表
|
||||
*/
|
||||
getEquipmentApplyList() {
|
||||
getEquipmentApplyListApi(this.queryParams).then((res) => {
|
||||
console.log('获取装备申请列表***', res)
|
||||
this.tableData = res.data.rows
|
||||
this.total = res.data.total
|
||||
}).catch(error => {
|
||||
console.error('获取装备申请列表失败:', error)
|
||||
})
|
||||
getEquipmentApplyListApi(this.queryParams)
|
||||
.then(res => {
|
||||
this.tableData = res.data.rows
|
||||
this.total = res.data.total
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('获取装备申请列表失败:', error)
|
||||
})
|
||||
},
|
||||
|
||||
// 分页处理
|
||||
handlePageChange(pageNum) {
|
||||
this.queryParams.pageNum = pageNum
|
||||
/**
|
||||
* 分页变化处理
|
||||
*/
|
||||
handlePageChange() {
|
||||
this.getEquipmentApplyList()
|
||||
},
|
||||
|
||||
handleSizeChange(pageSize) {
|
||||
this.queryParams.pageSize = pageSize
|
||||
this.getEquipmentApplyList()
|
||||
},
|
||||
|
||||
onHandleSQuery() {
|
||||
console.log('查询')
|
||||
this.getEquipmentApplyList()
|
||||
},
|
||||
|
||||
onHandleReset() {
|
||||
console.log('重置')
|
||||
this.queryParams = {
|
||||
keyWord: '',
|
||||
status: '0',
|
||||
applyTime: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
}
|
||||
/**
|
||||
* 重置表单
|
||||
*/
|
||||
resetForm() {
|
||||
this.$refs.queryFormRef.resetFields()
|
||||
this.queryParams.pageNum = 1
|
||||
this.getEquipmentApplyList()
|
||||
},
|
||||
|
||||
onHandleEquipmentInput() {
|
||||
this.orderIds = ''
|
||||
this.isView = false
|
||||
this.isEquipmentInputShow = true
|
||||
/**
|
||||
* 显示装备录入/编辑/查看界面
|
||||
*/
|
||||
showEquipmentInput(orderId, isApprovalVisible) {
|
||||
this.orderId = orderId
|
||||
this.isVisible = true
|
||||
this.isApprovalVisible = isApprovalVisible
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量导入
|
||||
*/
|
||||
onHandleBatchImport() {
|
||||
console.log('批量导入')
|
||||
},
|
||||
|
||||
onHandleView(row) {
|
||||
console.log('查看', row)
|
||||
this.orderIds = row.id
|
||||
this.isView = true
|
||||
this.isEquipmentInputShow = true
|
||||
},
|
||||
|
||||
onHandleAuditing(row) {
|
||||
this.orderIds = row.id
|
||||
this.isView = false
|
||||
this.isEquipmentInputShow = true
|
||||
console.log('审批', row)
|
||||
},
|
||||
|
||||
onHandleDelete(row) {
|
||||
/**
|
||||
* 删除项目
|
||||
*/
|
||||
deleteItem(row) {
|
||||
this.$confirm('是否确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
console.log('删除', row)
|
||||
equipmentDelApiNew({ id: row.id }).then((res) => {
|
||||
console.log('删除结果', res)
|
||||
})
|
||||
.then(() => equipmentDelApiNew({ id: row.id }))
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功',
|
||||
duration: 1000,
|
||||
})
|
||||
this.$message.success('删除成功')
|
||||
this.getEquipmentApplyList()
|
||||
} else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '删除失败',
|
||||
duration: 1000,
|
||||
})
|
||||
this.$message.error('删除失败')
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
if (error !== 'cancel') { // 排除取消操作的错误
|
||||
console.error('删除失败:', error)
|
||||
this.$message.error('删除失败,请重试')
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('删除失败:', error)
|
||||
this.$message.error('删除失败,请重试')
|
||||
})
|
||||
}).catch(() => {
|
||||
// 取消删除
|
||||
})
|
||||
},
|
||||
|
||||
onHandleBackList() {
|
||||
this.isEquipmentInputShow = false
|
||||
this.getEquipmentApplyList()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -241,4 +212,3 @@ export default {
|
|||
margin-right: 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue