This commit is contained in:
mashuai 2025-12-11 19:57:55 +08:00
parent 460ffd5787
commit 9426aea36f
2 changed files with 150 additions and 27 deletions

View File

@ -24,9 +24,9 @@
:inline="true" :inline="true"
label-width="68px" label-width="68px"
> >
<el-form-item label="关键字" prop="typeName"> <el-form-item label="关键字" prop="keyWord">
<el-input <el-input
v-model="queryParams.typeName" v-model="queryParams.keyWord"
placeholder="请输入关键字" placeholder="请输入关键字"
clearable clearable
style="width: 240px" style="width: 240px"
@ -49,6 +49,20 @@
> >
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-edit"
size="mini"
@click="onBatchEditPrice"
>批量修改租赁价
</el-button>
</el-col>
</el-row>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20" style="height: 93%"> <el-row :gutter="20" style="height: 93%">
@ -77,7 +91,7 @@
node.label.slice(0, 10) + '...' node.label.slice(0, 10) + '...'
}}</span> }}</span>
<span v-else>{{ node.label }}</span> <span v-else>{{ node.label }}</span>
<span class="btn-items" v-if="isMousemoveId === data.id"> <!-- <span class="btn-items" v-if="isMousemoveId === data.id">
<el-button <el-button
type="text" type="text"
size="mini" size="mini"
@ -101,7 +115,7 @@
v-if="data.id !== 0" v-if="data.id !== 0"
@click.stop="() => removeTreeNode(data)" @click.stop="() => removeTreeNode(data)"
/> />
</span> </span>-->
</div> </div>
</el-tree> </el-tree>
</div> </div>
@ -112,24 +126,32 @@
:data="typeList" :data="typeList"
border border
height="546" height="546"
@selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="50" align="center"/> <el-table-column type="selection" width="50" align="center"/>
<el-table-column <el-table-column
label="所属专业" label="专业"
align="center"
key="equipCategory"
prop="equipCategory"
show-overflow-tooltip
/>
<el-table-column
label="主工序"
align="center" align="center"
key="major" key="major"
prop="major" prop="major"
show-overflow-tooltip show-overflow-tooltip
/> />
<el-table-column <el-table-column
label="主工序" label="工序"
align="center" align="center"
key="mainProcedure" key="mainProcedure"
prop="mainProcedure" prop="mainProcedure"
show-overflow-tooltip show-overflow-tooltip
/> />
<el-table-column <el-table-column
label="子工序" label="装备类目"
align="center" align="center"
key="subProcedure" key="subProcedure"
prop="subProcedure" prop="subProcedure"
@ -142,17 +164,23 @@
prop="typeName" prop="typeName"
show-overflow-tooltip show-overflow-tooltip
/> />
<el-table-column label="操作" align="center" width="180"> <el-table-column
label="租赁价"
align="center"
prop="leasePrice"
show-overflow-tooltip
/>
<!-- <el-table-column label="操作" align="center" width="180">
<template slot-scope="scope" v-if="scope.row.typeId !== 1"> <template slot-scope="scope" v-if="scope.row.typeId !== 1">
<!-- <el-button &lt;!&ndash; <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="editTreeNode(scope.row)" @click="editTreeNode(scope.row)"
v-hasPermi="['machinery:type:config']" v-hasPermi="['machinery:type:config']"
> >
配置 配置
</el-button>--> </el-button>&ndash;&gt;
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -173,11 +201,11 @@
删除 删除
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>-->
</el-table> </el-table>
<pagination <pagination
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@ -187,7 +215,8 @@
</el-row> </el-row>
<AddNode :visible.sync="addOpen" :parentNode="addParentNode" :showIsStateGrid="showIsStateGrid" @refresh="refresh"/> <AddNode :visible.sync="addOpen" :parentNode="addParentNode" :showIsStateGrid="showIsStateGrid" @refresh="refresh"/>
<EditNode :visible.sync="editOpen" :parentNode="editParentNode" :showIsStateGrid="showIsStateGrid" @refresh="refresh"/> <EditNode :visible.sync="editOpen" :parentNode="editParentNode" :showIsStateGrid="showIsStateGrid"
@refresh="refresh"/>
<AddChildNode :visible.sync="addChildOpen" :parentNode="addChildNode" <AddChildNode :visible.sync="addChildOpen" :parentNode="addChildNode"
@refresh="refresh" @refresh="refresh"
/> />
@ -196,11 +225,41 @@
@refresh="refresh" @refresh="refresh"
/> />
<!-- 修改价格弹框 -->
<el-dialog
title="修改共享价"
:visible.sync="editLeasePriceVisible"
v-if="editLeasePriceVisible"
width="30%"
append-to-body
:close-on-click-modal="false"
>
<el-form
:inline="true"
:model="editPriceForm"
ref="editPriceFormRef"
:rules="editPriceFormRules"
>
<el-form-item label="修改后租赁价" prop="leasePrice">
<el-input v-model="editPriceForm.leasePrice"/>
</el-form-item>
<el-row style="text-align: right">
<el-form-item>
<el-button size="small" @click="onEditCancel"> </el-button>
<el-button size="small" type="primary" @click="onEditSubmit"
>
</el-button
>
</el-form-item>
</el-row>
</el-form>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getMaTypeList, delMaType, getList } from '@/api/lessor/equipType' import {getMaTypeList, delMaType, getList, updateLeasePriceApi} from '@/api/lessor/equipType'
import AddNode from '@/views/lessor/equipment/equipType/child/addNode.vue' import AddNode from '@/views/lessor/equipment/equipType/child/addNode.vue'
import EditNode from '@/views/lessor/equipment/equipType/child/editNode.vue' import EditNode from '@/views/lessor/equipment/equipType/child/editNode.vue'
import AddChildNode from '@/views/lessor/equipment/equipType/child/addChildNode.vue' import AddChildNode from '@/views/lessor/equipment/equipType/child/addChildNode.vue'
@ -208,9 +267,14 @@ import EditChildNode from '@/views/lessor/equipment/equipType/child/editChildNod
export default { export default {
name: 'ToolsType', name: 'ToolsType',
components: { AddNode, EditNode, AddChildNode, EditChildNode }, components: {AddNode, EditNode, AddChildNode, EditChildNode},
data() { data() {
return { return {
editPriceForm: {
leasePrice: ''
},
editLeasePriceVisible: false,
// //
total: 0, total: 0,
// //
@ -237,7 +301,7 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
typeName: undefined, keyWord: undefined,
level: 1 level: 1
}, },
addFormParamsRules: { addFormParamsRules: {
@ -249,9 +313,24 @@ export default {
} }
] ]
}, },
editPriceFormRules: {
leasePrice: [
{
required: true,
message: '请输入修改后共享价格',
trigger: 'blur'
},
{
pattern: /^(0(\.\d{0,2})?|([1-9]\d*)(\.\d{0,2})?)$/,
message: '请输入正确的费用金额,最多两位小数点',
trigger: 'blur'
}
]
},
addTitleVisible: false, addTitleVisible: false,
addTitle: '', addTitle: '',
showIsStateGrid: null showIsStateGrid: null,
ids: []
} }
}, },
watch: { watch: {
@ -312,7 +391,7 @@ export default {
this.queryParams.typeId = undefined this.queryParams.typeId = undefined
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.queryParams.pageSize = 10 this.queryParams.pageSize = 10
this.queryParams.level = 0 this.queryParams.level = 1
this.$refs.tree.setCurrentKey(null) this.$refs.tree.setCurrentKey(null)
this.getList() this.getList()
}, },
@ -399,7 +478,51 @@ export default {
findNode(treeData, nodeId) findNode(treeData, nodeId)
console.log(path) console.log(path)
return path return path
} },
//
onBatchEditPrice() {
this.$message.closeAll()
if (this.ids.length < 1) {
this.$message.error('请勾选改价的设备')
return
}
this.editPriceForm.leasePrice = ''
// this.batchEdit = true
this.editLeasePriceVisible = true
},
//
handleSelectionChange(val) {
console.log(val)
this.ids = val
},
onEditCancel() {
this.editLeasePriceVisible = false
this.$refs.editPriceFormRef.resetFields()
},
handleUpdateLeasePrice(row) {
this.editPriceForm.leasePrice = ''
// this.batchEdit = false
// this.editTypeIds = []
// this.editTypeIds.push(row.typeId)
this.editLeasePriceVisible = true
},
onEditSubmit() {
this.$refs.editPriceFormRef.validate(async (valid) => {
if (valid) {
const params = {
typeIds: this.ids.map((e) => e.typeId),
leasePrice: this.editPriceForm.leasePrice * 1
}
const res = await updateLeasePriceApi(params)
if (res.code === 200) {
this.$message.success('修改成功')
this.editLeasePriceVisible = false
this.getList()
}
}
})
},
} }
} }
</script> </script>

View File

@ -227,7 +227,7 @@
</el-table> </el-table>
<pagination <pagination
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"