This commit is contained in:
parent
460ffd5787
commit
9426aea36f
|
|
@ -24,9 +24,9 @@
|
|||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="关键字" prop="typeName">
|
||||
<el-form-item label="关键字" prop="keyWord">
|
||||
<el-input
|
||||
v-model="queryParams.typeName"
|
||||
v-model="queryParams.keyWord"
|
||||
placeholder="请输入关键字"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
|
|
@ -49,6 +49,20 @@
|
|||
>
|
||||
</el-form-item>
|
||||
</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-row>
|
||||
<el-row :gutter="20" style="height: 93%">
|
||||
|
|
@ -77,7 +91,7 @@
|
|||
node.label.slice(0, 10) + '...'
|
||||
}}</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
|
||||
type="text"
|
||||
size="mini"
|
||||
|
|
@ -101,7 +115,7 @@
|
|||
v-if="data.id !== 0"
|
||||
@click.stop="() => removeTreeNode(data)"
|
||||
/>
|
||||
</span>
|
||||
</span>-->
|
||||
</div>
|
||||
</el-tree>
|
||||
</div>
|
||||
|
|
@ -112,24 +126,32 @@
|
|||
:data="typeList"
|
||||
border
|
||||
height="546"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="50" align="center"/>
|
||||
<el-table-column
|
||||
label="所属专业"
|
||||
label="专业"
|
||||
align="center"
|
||||
key="equipCategory"
|
||||
prop="equipCategory"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="主工序"
|
||||
align="center"
|
||||
key="major"
|
||||
prop="major"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="主工序"
|
||||
label="子工序"
|
||||
align="center"
|
||||
key="mainProcedure"
|
||||
prop="mainProcedure"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="子工序"
|
||||
label="装备类目"
|
||||
align="center"
|
||||
key="subProcedure"
|
||||
prop="subProcedure"
|
||||
|
|
@ -142,17 +164,23 @@
|
|||
prop="typeName"
|
||||
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">
|
||||
<!-- <el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="editTreeNode(scope.row)"
|
||||
v-hasPermi="['machinery:type:config']"
|
||||
>
|
||||
配置
|
||||
</el-button>-->
|
||||
<!– <el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="editTreeNode(scope.row)"
|
||||
v-hasPermi="['machinery:type:config']"
|
||||
>
|
||||
配置
|
||||
</el-button>–>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
|
|
@ -173,11 +201,11 @@
|
|||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>-->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
|
||||
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
|
|
@ -187,7 +215,8 @@
|
|||
</el-row>
|
||||
|
||||
<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"
|
||||
@refresh="refresh"
|
||||
/>
|
||||
|
|
@ -196,11 +225,41 @@
|
|||
@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>
|
||||
</template>
|
||||
|
||||
<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 EditNode from '@/views/lessor/equipment/equipType/child/editNode.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 {
|
||||
name: 'ToolsType',
|
||||
components: { AddNode, EditNode, AddChildNode, EditChildNode },
|
||||
components: {AddNode, EditNode, AddChildNode, EditChildNode},
|
||||
data() {
|
||||
return {
|
||||
editPriceForm: {
|
||||
leasePrice: ''
|
||||
},
|
||||
editLeasePriceVisible: false,
|
||||
|
||||
// 总条数
|
||||
total: 0,
|
||||
//列表数据
|
||||
|
|
@ -237,7 +301,7 @@ export default {
|
|||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
typeName: undefined,
|
||||
keyWord: undefined,
|
||||
level: 1
|
||||
},
|
||||
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,
|
||||
addTitle: '',
|
||||
showIsStateGrid: null
|
||||
showIsStateGrid: null,
|
||||
ids: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
@ -312,7 +391,7 @@ export default {
|
|||
this.queryParams.typeId = undefined
|
||||
this.queryParams.pageNum = 1
|
||||
this.queryParams.pageSize = 10
|
||||
this.queryParams.level = 0
|
||||
this.queryParams.level = 1
|
||||
this.$refs.tree.setCurrentKey(null)
|
||||
this.getList()
|
||||
},
|
||||
|
|
@ -399,7 +478,51 @@ export default {
|
|||
findNode(treeData, nodeId)
|
||||
console.log(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>
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@
|
|||
</el-table>
|
||||
|
||||
<pagination
|
||||
|
||||
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
|
|
|
|||
Loading…
Reference in New Issue