检测项目排序

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

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

@ -16,12 +16,12 @@
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="创建时间" prop="createTime">-->
<!-- <el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"-->
<!-- type="daterange"-->
<!-- range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"-->
<!-- :default-time="['00:00:00', '23:59:59']"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="创建时间" prop="createTime">-->
<!-- <el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"-->
<!-- type="daterange"-->
<!-- range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"-->
<!-- :default-time="['00:00:00', '23:59:59']"/>-->
<!-- </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="resetQuery">重置</el-button>
@ -32,7 +32,7 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)"
>新增
>新增
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
@ -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>
@ -58,10 +69,10 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
>修改
>修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
>删除
>删除
</el-button>
</template>
</el-table-column>
@ -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()
}
}
};