同步6/16
This commit is contained in:
@@ -63,7 +63,7 @@
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
></el-switch>
|
||||
<!-- 0关闭 1开启 -->
|
||||
<!-- 1关闭 0开启 -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="110" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
@@ -148,17 +148,21 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
/** 查询巡检计划列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listPlan(queryParams.value);
|
||||
planList.value = res.rows;
|
||||
planList.value.forEach((item) => {
|
||||
item.routeNames = item.routeList.map((item) => item.routeName).join(',');
|
||||
item.executeDayNames = item.executeDay
|
||||
.split(',')
|
||||
.sort((a, b) => Number(a) - Number(b))
|
||||
.map((item) => Number(item));
|
||||
});
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
listPlan(queryParams.value)
|
||||
.then((res) => {
|
||||
planList.value = res.rows;
|
||||
planList.value.forEach((item) => {
|
||||
item.routeNames = item.routeList.map((item) => item.routeName).join(',');
|
||||
item.executeDayNames = item.executeDay
|
||||
.split(',')
|
||||
.sort((a, b) => Number(a) - Number(b))
|
||||
.map((item) => Number(item));
|
||||
});
|
||||
total.value = res.total;
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
@@ -202,10 +206,12 @@ const handleAdd = () => {
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: PlanVO) => {
|
||||
const _ids = row?.id || ids.value[0];
|
||||
|
||||
router.push({
|
||||
path: '/inspection/editPlan',
|
||||
query: {
|
||||
id: row.id
|
||||
id: _ids
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -216,22 +222,6 @@ function handleChangeStatus(id: string, status: string) {
|
||||
getList();
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
planFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updatePlan(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addPlan(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: PlanVO) => {
|
||||
|
||||
Reference in New Issue
Block a user