检测项目排序

This commit is contained in:
许允枞 2024-11-14 09:11:07 +08:00
parent d769a595fe
commit fe21a5802d
3 changed files with 46 additions and 13 deletions
src
api/inspection/project
views/inspection/project

View File

@ -18,6 +18,15 @@ export function updateDlInspectionProject(data) {
})
}
// 更新检测项目排序
export function updateSort(data) {
return request({
url: '/inspection/dl-inspection-project/updateSort',
method: 'put',
data: data
})
}
// 删除检测项目
export function deleteDlInspectionProject(id) {
return request({

View File

@ -19,9 +19,9 @@
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" placeholder="请输入备注"/>
</el-form-item>
<el-form-item label="排序" prop="remark">
<el-input v-model="formData.sort" placeholder="请输入排序"/>
</el-form-item>
<!-- <el-form-item label="排序" prop="remark">-->
<!-- <el-input v-model="formData.sort" placeholder="请输入排序"/>-->
<!-- </el-form-item>-->
<el-form-item label="提成价格">
<el-table :data="tableData" style="width: 100%" height="250">
<el-table-column fixed prop="title" label="商品名称">

View File

@ -50,6 +50,17 @@
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="排序" align="center" prop="sort">
<template slot-scope="scope">
<el-input
v-model="scope.row.sort"
type="number"
style="width: 80px"
@blur="handleSortChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
@ -77,7 +88,7 @@
<script>
import * as DlInspectionProjectApi from '@/api/inspection/project';
import DlInspectionProjectForm from './DlInspectionProjectForm.vue';
import {getRole} from "@/api/inspection/project";
import {getRole, updateSort} from "@/api/inspection/project";
export default {
name: "DlInspectionProject",
@ -177,6 +188,19 @@ export default {
getRoleName(id) {
const role = this.roleList.find(item => item.id === id);
return role ? role.name : '';
},
/** 排序值变化处理函数*/
async handleSortChange(row) {
console.log('本行信息:', row)
//
console.log('排序值变化:', row.sort);
//
let data = {
id: row.id,
sort: row.sort
}
let res = await DlInspectionProjectApi.updateSort(data);
this.getList()
}
}
};