任务记录

master
wanglei 2 years ago
parent 83f360dc63
commit 473327dabb

@ -32,7 +32,7 @@
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
@ -73,35 +73,47 @@
@click="handleExport"
v-hasPermi="['dangan:task:export']"
>导出</el-button>
</el-col>
</el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="taskList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="任务id" align="center" prop="id" />
<el-table v-loading="loading" :data="taskList">
<!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="业务类型" align="center" prop="ywType" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">
<dict-tag :options="dict.type.yw_type" :value="scope.row.ywType"/>
</template>
</el-table-column>
<el-table-column label="档案目录路径" align="center" prop="muPath" />
<el-table-column label="总数量" align="center" prop="num" />
<el-table-column label="任务状态(字典)" align="center" prop="status" />
<el-table-column label="成功" align="center" prop="successNum" />
<el-table-column label="任务状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.task_status" :value="scope.row.status"/>
</template>
</el-table-column>
<!-- <el-table-column label="成功" align="center" prop="successNum" />
<el-table-column label="失败" align="center" prop="failNum" />
<el-table-column label="相关图片ids" align="center" prop="picIds" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="备注" align="center" prop="remark" />-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
v-if="scope.row.status==='2'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
@click="handleUpdate1(scope.row)"
v-hasPermi="['dangan:task:edit']"
>修改</el-button>
>查看任务详情</el-button>
<el-button
v-if="scope.row.status==='1'"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['dangan:task:remove']"
>删除</el-button>
@click="handleUpdate(scope.row)"
v-hasPermi="['dangan:task:edit']"
>查看任务进度</el-button>
</template>
</el-table-column>
</el-table>
@ -114,9 +126,22 @@
@pagination="getList"
/>
<!-- 添加或修改识别任务记录对话框 -->
<!-- 任务进度/任务详情 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<div class="rw_con">
<div class="num">总数量: {{ form.num }}</div>
<div class="num" v-if="form.status==='1'">: 10</div>
<div class="num" v-if="form.status==='2'">: {{ form.successNum }}</div>
<div class="num" v-if="form.status==='2'">: {{ form.failNum }}</div>
</div>
<div style="display:flex; justify-content: space-evenly;" v-if="form.status==='2'">
<el-link :underline="false" type="primary" style="font-size: 20px">成功图片</el-link>
<el-link :underline="false" type="primary" style="font-size: 20px">失败图片</el-link>
</div>
<!-- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="总数量" prop="num">
<el-input v-model="form.num" placeholder="请输入总数量" />
</el-form-item>
@ -132,11 +157,7 @@
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-form>-->
</el-dialog>
</div>
</template>
@ -146,16 +167,11 @@
export default {
name: "Task",
dicts: ['task_status', 'yw_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
@ -176,11 +192,7 @@
failNum: null,
picIds: null,
},
//
form: {},
//
rules: {
}
form: {}
};
},
created() {
@ -196,28 +208,6 @@
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
num: null,
status: null,
successNum: null,
failNum: null,
picIds: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
@ -228,64 +218,28 @@
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加识别任务记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getTask(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改识别任务记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateTask(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addTask(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
this.form = row;
this.open = true;
this.title = "任务进度";
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除识别任务记录编号为"' + ids + '"的数据项?').then(function() {
return delTask(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
handleUpdate1(row) {
this.form = row;
this.open = true;
this.title = "任务详情";
},
/** 导出按钮操作 */
handleExport() {
this.download('dangan/task/export', {
...this.queryParams
}, `task_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<style scoped lang="scss">
.rw_con{
padding: 0 20px;
font-size: 18px;
.num{
height: 40px;
}
}
</style>

Loading…
Cancel
Save