|
@@ -18,13 +18,23 @@ const nav_template = `<ul id="nav_tab" class="nav nav-tabs nav-line-tabs nav-lin
|
|
|
tab_content_template = `<div class="tab-pane h-100" id="iwb_tab_{0}" role="tabpanel">{1}</div>`,
|
|
|
table_add_task_btn_template = `<button type="button" class="task_add_btn btn btn-primary btn-sm" onclick="Add('{0}')">添加任务</button>`,
|
|
|
table_add_quota_btn_template = `<button type="button" class="quota_add_btn btn btn-primary btn-sm" onclick="Add_Quota('{0}')">添加定额</button>`,
|
|
|
- table_collect_select_template = `<select class="form-select form-select-sm me-5" name="collect_status">
|
|
|
- <option value="">全部采集状态</option>
|
|
|
- <option value="0">未采集</option>
|
|
|
- <option value="1">采集中</option>
|
|
|
- <option value="2">已采集</option>
|
|
|
- <option value="3">采集失败</option>
|
|
|
- <option value="4">数据变更</option>
|
|
|
+ table_run_select_template = `<select class="form-select form-select-sm me-5" name="process_status">
|
|
|
+ <option value="">全部运行状态</option>
|
|
|
+ <option value="0">草稿</option>
|
|
|
+ <option value="1">等待运行</option>
|
|
|
+ <option value="2">运行中</option>
|
|
|
+ <option value="200">运行成功</option>
|
|
|
+ <option value="4">取消运行</option>
|
|
|
+ <option value="5">运行失败</option>
|
|
|
+ <!--<option value="4">已修改</option>-->
|
|
|
+ </select>`,
|
|
|
+ table_send_select_template = `<select class="form-select form-select-sm me-5" name="send_status">
|
|
|
+ <option value="">全部发送状态</option>
|
|
|
+ <option value="0">未发送</option>
|
|
|
+ <option value="1">发送中</option>
|
|
|
+ <option value="200">发送成功</option>
|
|
|
+ <option value="2">发送失败</option>
|
|
|
+ <option value="3">数据变更</option>
|
|
|
</select>`,
|
|
|
table_template = `<div class="table-box table-responsive" data-id="{0}" id="table_box_{0}">
|
|
|
<div class="d-flex justify-content-between my-5">
|
|
@@ -32,22 +42,6 @@ const nav_template = `<ul id="nav_tab" class="nav nav-tabs nav-line-tabs nav-lin
|
|
|
<form class="search-box d-flex">
|
|
|
<div class="d-flex">
|
|
|
{2}
|
|
|
-<!-- <select class="form-select form-select-sm me-5" name="process_status">-->
|
|
|
-<!-- <option value="">全部处理状态</option>-->
|
|
|
-<!-- <option value="0">未处理</option>-->
|
|
|
-<!-- <option value="1">处理中</option>-->
|
|
|
-<!-- <option value="2">已处理</option>-->
|
|
|
-<!-- <option value="3">处理失败</option>-->
|
|
|
-<!-- <option value="4">数据变更</option>-->
|
|
|
-<!-- </select>-->
|
|
|
- <select class="form-select form-select-sm me-5" name="send_status">
|
|
|
- <option value="">全部发送状态</option>
|
|
|
- <option value="0">未发送</option>
|
|
|
- <option value="1">发送中</option>
|
|
|
- <option value="2">已发送</option>
|
|
|
- <option value="3">发送失败</option>
|
|
|
- <option value="4">数据变更</option>
|
|
|
- </select>
|
|
|
<input type="text" class="form-control form-control-sm w-200px" placeholder="请输入关键字" name="keyword" />
|
|
|
</div>
|
|
|
<div class="btn-group ms-5">
|
|
@@ -230,7 +224,7 @@ function RenderRightBox(data){
|
|
|
$rightBoxHeader.find('.badge').text('任务列表').removeClass('badge-success').addClass('badge-primary')
|
|
|
$rightBoxHeader.find('#task_radio').prop("checked",true)
|
|
|
const budget_id =0
|
|
|
- $taskBox.html(table_template.format(budget_id,table_add_task_btn_template.format(budget_id),table_collect_select_template))
|
|
|
+ $taskBox.html(table_template.format(budget_id,table_add_task_btn_template.format(budget_id),table_run_select_template))
|
|
|
_taskTable(data)
|
|
|
}
|
|
|
function _taskTable(data){
|
|
@@ -251,8 +245,8 @@ function RenderRightBox(data){
|
|
|
},
|
|
|
{
|
|
|
title: '任务排序',
|
|
|
- data: 'sort',
|
|
|
- width: '100',
|
|
|
+ data: 'task_sort',
|
|
|
+ width: '100px',
|
|
|
},
|
|
|
{
|
|
|
title: '概算单元',
|
|
@@ -272,7 +266,8 @@ function RenderRightBox(data){
|
|
|
const file_paths = row.file_path ? row.file_path.split(',') : []
|
|
|
if(file_paths.length){
|
|
|
for (let i = 0; i < file_paths.length; i++) {
|
|
|
- const path = file_paths[i]
|
|
|
+ const path = file_paths[i] || ""
|
|
|
+ if (!path) continue
|
|
|
const names = path.split('/')
|
|
|
const file_name = names[names.length - 1]
|
|
|
str += `<a href="#" onclick="DownloadFile('/api/task/download?filename=${encodeURIComponent(path)}','${file_name}')" class="link link-info px-2">${file_name}</a>`
|
|
@@ -289,21 +284,21 @@ function RenderRightBox(data){
|
|
|
width: '180px',
|
|
|
render: (row) => {
|
|
|
let str = ``
|
|
|
- if (row.collect_status === 0) {
|
|
|
- str += `<span class="badge badge-light-primary">未采集</span>`
|
|
|
- } else if (row.collect_status === 1){
|
|
|
- str += `<span class="badge badge-light-warning">采集中</span>`
|
|
|
- } else if (row.collect_status === 2){
|
|
|
- str += `<span class="badge badge-light-success">采集完成</span>`
|
|
|
- if (row.send_status === 0) {
|
|
|
- str += `<span class="badge badge-light-primary ms-3">未发送</span>`
|
|
|
- } else if (row.send_status === 1){
|
|
|
- str += `<span class="badge badge-light-warning ms-3">发送中</span>`
|
|
|
- } else if (row.send_status === 2){
|
|
|
- str += `<span class="badge badge-light-success ms-3">发送完成</span>`
|
|
|
- } else if (row.send_status === 3){
|
|
|
- str += `<span class="badge badge-light-danger ms-3">发送失败</span>`
|
|
|
- }
|
|
|
+ if (row.process_status === 0) {
|
|
|
+ str += `<span class="badge badge-secondary">草稿</span>`
|
|
|
+ } else if (row.process_status === 1){
|
|
|
+ str += `<span class="badge badge-light-primary">等待运行</span>`
|
|
|
+ } else if (row.process_status === 2){
|
|
|
+ str += `<span class="badge badge-light-info">运行中</span>`
|
|
|
+ // if (row.send_status === 0) {
|
|
|
+ // str += `<span class="badge badge-light-primary ms-3">未发送</span>`
|
|
|
+ // } else if (row.send_status === 1){
|
|
|
+ // str += `<span class="badge badge-light-warning ms-3">发送中</span>`
|
|
|
+ // } else if (row.send_status === 2){
|
|
|
+ // str += `<span class="badge badge-light-success ms-3">发送完成</span>`
|
|
|
+ // } else if (row.send_status === 3){
|
|
|
+ // str += `<span class="badge badge-light-danger ms-3">发送失败</span>`
|
|
|
+ // }
|
|
|
// if (row.process_status === 0) {
|
|
|
// str += `<span class="badge badge-light-primary ms-3">未处理</span>`
|
|
|
// } else if (row.process_status === 1){
|
|
@@ -314,10 +309,12 @@ function RenderRightBox(data){
|
|
|
// } else if (row.process_status === 3){
|
|
|
// str += `<span class="badge badge-light-danger ms-3">处理失败</span>`
|
|
|
// }
|
|
|
- } else if (row.collect_status === 3){
|
|
|
- str += `<span class="badge badge-light-danger">采集失败</span>`
|
|
|
- } else if (row.collect_status === 4){
|
|
|
- str += `<span class="badge badge-light-info">数据变更</span>`
|
|
|
+ } else if (row.process_status === 200){
|
|
|
+ str += `<span class="badge badge-light-success">运行成功</span>`
|
|
|
+ } else if (row.process_status === 4){
|
|
|
+ str += `<span class="badge badge-light-danger" data-bs-toggle="tooltip" data-bs-placement="top" title="${row.process_error}">运行失败</span>`
|
|
|
+ } else if (row.process_status === 5){
|
|
|
+ str += `<span class="badge badge-warning">取消运行</span>`
|
|
|
}
|
|
|
return str
|
|
|
}
|
|
@@ -328,10 +325,13 @@ function RenderRightBox(data){
|
|
|
width: '160px',
|
|
|
render: (row) => {
|
|
|
let str = ``
|
|
|
- if (row.collect_status === 0) {
|
|
|
- str += `<button type="button" class="btn btn-icon btn-sm btn-light-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="开始任务" onclick="StartCollectTask(${row.id})"><i class="ki-duotone ki-add-notepad fs-1"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></i></button>`
|
|
|
- } else if (row.collect_status === 2) {
|
|
|
- str += `<button type="button" class="btn btn-icon btn-sm btn-light-warning" data-bs-toggle="tooltip" data-bs-placement="top" title="重新采集" onclick="ReStartCollectTask(${row.id})"><i class="ki-duotone ki-add-notepad fs-1"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></i></button>`
|
|
|
+ if (row.process_status === 0) {
|
|
|
+ str += `<button type="button" class="btn btn-icon btn-sm btn-light-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="开始任务" onclick="StarTask(${row.id})"><i class="ki-duotone ki-add-notepad fs-1"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></i></button>`
|
|
|
+ } else if (row.process_status === 1 || row.process_status === 2) {
|
|
|
+ str += `<button type="button" class="btn btn-icon btn-sm btn-light-danger" data-bs-toggle="tooltip" data-bs-placement="top" title="取消任务" onclick="CancelTask(${row.id})"><i class="ki-duotone ki-cross-square fs-1"><span class="path1"></span><span class="path2"></span></i></button>`
|
|
|
+ }
|
|
|
+ else if (row.process_status === 200) {
|
|
|
+ // str += `<button type="button" class="btn btn-icon btn-sm btn-light-warning" data-bs-toggle="tooltip" data-bs-placement="top" title="重新运行" onclick="ReStarTask(${row.id})"><i class="ki-duotone ki-add-notepad fs-1"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></i></button>`
|
|
|
// if (row.process_status === 0) {
|
|
|
// str += `<button type="button" class="btn btn-icon btn-sm btn-light-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="开始处理" onclick="StartProcessTask(${row.id})"><i class="ki-duotone ki-book-square fs-1"><span class="path1"></span><span class="path2"></span><span class="path3"></span></i></button>`
|
|
|
// } else if (row.process_status === 2) {
|
|
@@ -342,23 +342,27 @@ function RenderRightBox(data){
|
|
|
// } else if (row.process_status === 4) {
|
|
|
// str += `<button type="button" class="btn btn-icon btn-sm btn-light-info" data-bs-toggle="tooltip" data-bs-placement="top" title="重新处理" onclick="ReStartProcessTask(${row.id})"><i class="ki-duotone ki-book-square fs-1"><span class="path1"></span><span class="path2"></span><span class="path3"></span></i></button>`
|
|
|
// }
|
|
|
- if (row.send_status === 0) {
|
|
|
- str += `<button type="button" class="btn btn-icon btn-sm btn-light-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="开始发送" onclick="StartSendTask(${row.id})"><i class="ki-duotone ki-send fs-1"><span class="path1"></span><span class="path2"></span></i></button>`
|
|
|
- } else if (row.send_status === 2) {
|
|
|
- str += `<button type="button" class="btn btn-icon btn-sm btn-light-warning" data-bs-toggle="tooltip" data-bs-placement="top" title="重新发送" onclick="ReStartSendTask(${row.id})"><i class="ki-duotone ki-send fs-1"><span class="path1"></span><span class="path2"></span></i></button>`
|
|
|
- } else if (row.send_status === 3) {
|
|
|
- str += `<button type="button" class="btn btn-icon btn-sm btn-light-danger" data-bs-toggle="tooltip" data-bs-placement="top" title="重新发送" onclick="ReStartSendTask(${row.id})"><i class="ki-duotone ki-send fs-1"><span class="path1"></span><span class="path2"></span></i></button>`
|
|
|
- } else if (row.send_status === 4) {
|
|
|
- str += `<button type="button" class="btn btn-icon btn-sm btn-light-info" data-bs-toggle="tooltip" data-bs-placement="top" title="重新发送" onclick="ReStartSendTask(${row.id})"><i class="ki-duotone ki-send fs-1"><span class="path1"></span><span class="path2"></span></i></button>`
|
|
|
- }
|
|
|
- } else if (row.collect_status === 3) {
|
|
|
- str += `<button type="button" class="btn btn-icon btn-sm btn-light-danger" data-bs-toggle="tooltip" data-bs-placement="top" title="重新采集" onclick="ReStartCollectTask(${row.id})"><i class="ki-duotone ki-add-notepad fs-1"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></i></button>`
|
|
|
- }else if (row.collect_status === 4) {
|
|
|
- str += `<button type="button" class="btn btn-icon btn-sm btn-light-info" data-bs-toggle="tooltip" data-bs-placement="top" title="重新采集" onclick="ReStartCollectTask(${row.id})"><i class="ki-duotone ki-add-notepad fs-1"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></i></button>`
|
|
|
+ // if (row.send_status === 0) {
|
|
|
+ // str += `<button type="button" class="btn btn-icon btn-sm btn-light-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="开始发送" onclick="StartSendTask(${row.id})"><i class="ki-duotone ki-send fs-1"><span class="path1"></span><span class="path2"></span></i></button>`
|
|
|
+ // } else if (row.send_status === 2) {
|
|
|
+ // str += `<button type="button" class="btn btn-icon btn-sm btn-light-warning" data-bs-toggle="tooltip" data-bs-placement="top" title="重新发送" onclick="ReStartSendTask(${row.id})"><i class="ki-duotone ki-send fs-1"><span class="path1"></span><span class="path2"></span></i></button>`
|
|
|
+ // } else if (row.send_status === 3) {
|
|
|
+ // str += `<button type="button" class="btn btn-icon btn-sm btn-light-danger" data-bs-toggle="tooltip" data-bs-placement="top" title="重新发送" onclick="ReStartSendTask(${row.id})"><i class="ki-duotone ki-send fs-1"><span class="path1"></span><span class="path2"></span></i></button>`
|
|
|
+ // } else if (row.send_status === 4) {
|
|
|
+ // str += `<button type="button" class="btn btn-icon btn-sm btn-light-info" data-bs-toggle="tooltip" data-bs-placement="top" title="重新发送" onclick="ReStartSendTask(${row.id})"><i class="ki-duotone ki-send fs-1"><span class="path1"></span><span class="path2"></span></i></button>`
|
|
|
+ // }
|
|
|
+ } else if (row.process_status === 4) {
|
|
|
+ str += `<button type="button" class="btn btn-icon btn-sm btn-light-danger" data-bs-toggle="tooltip" data-bs-placement="top" title="重新运行" onclick="ReStarTask(${row.id})"><i class="ki-duotone ki-add-notepad fs-1"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></i></button>`
|
|
|
+ }else if (row.process_status === 5) {
|
|
|
+ str += `<button type="button" class="btn btn-icon btn-sm btn-light-info" data-bs-toggle="tooltip" data-bs-placement="top" title="重新运行" onclick="ReStarTask(${row.id})"><i class="ki-duotone ki-add-notepad fs-1"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></i></button>`
|
|
|
+ }
|
|
|
+ if (row.process_status === 0) {
|
|
|
+ str += `<button type="button" class="btn btn-icon btn-sm btn-light-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="编辑" onclick="Edit(${row.id})"><i class="ki-duotone ki-message-edit fs-1"><span class="path1"></span><span class="path2"></span></i></button>`
|
|
|
+ }
|
|
|
+ str+=`<!--<button type="button" class="btn btn-icon btn-sm btn-light-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="编辑" onclick="Edit(${row.id})"><i class="ki-duotone ki-message-edit fs-1"><span class="path1"></span><span class="path2"></span></i></button>-->`
|
|
|
+ if (row.process_status !== 2 && row.process_status !==1) {
|
|
|
+ str+=`<button type="button" class="btn btn-icon btn-sm btn-light-danger" data-bs-toggle="tooltip" data-bs-placement="top" title="删除" onclick="Delete(${row.id})"><i class="ki-duotone ki-trash-square fs-1"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></i></button>`
|
|
|
}
|
|
|
- str+=`<button type="button" class="btn btn-icon btn-sm btn-light-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="编辑" onclick="Edit(${row.id})"><i class="ki-duotone ki-message-edit fs-1"><span class="path1"></span><span class="path2"></span></i></button>`
|
|
|
- str+=`<button type="button" class="btn btn-icon btn-sm btn-light-danger" data-bs-toggle="tooltip" data-bs-placement="top" title="删除" onclick="Delete(${row.id})"><i class="ki-duotone ki-trash-square fs-1"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></i></button>`
|
|
|
-
|
|
|
return str
|
|
|
}
|
|
|
},
|
|
@@ -391,6 +395,7 @@ function RenderRightBox(data){
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
function BuildBudgetInfo() {
|
|
|
IwbAjax_1({
|
|
|
url: `/api/project/budget/${project_id}`,
|
|
@@ -403,6 +408,7 @@ function BuildBudgetInfo() {
|
|
|
},
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
function RenderTabs(data){
|
|
|
console.log('RenderTabs', data)
|
|
|
let str1 = '',
|
|
@@ -411,7 +417,7 @@ function RenderTabs(data){
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
const item = data[i]
|
|
|
str1 += nav_tab_template.format(item.budget_id, item.budget_code)
|
|
|
- const tableStr = table_template.format(item.budget_id,table_add_quota_btn_template.format(item.budget_id),"")
|
|
|
+ const tableStr = table_template.format(item.budget_id,table_add_quota_btn_template.format(item.budget_id),table_send_select_template)
|
|
|
const tabContent = tab_content_template.format(item.budget_id, tableStr)
|
|
|
// console.log('TAB_CONTENT', tabContent)
|
|
|
str2 += tabContent
|
|
@@ -430,9 +436,8 @@ function RenderTabs(data){
|
|
|
})
|
|
|
const firstTab = new bootstrap.Tab($tab_btn.eq(0))
|
|
|
firstTab.show()
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
function RenderQuotaTable(budget_id,data){
|
|
|
console.log('RenderQuotaTable', budget_id, data)
|
|
|
const $quotaBox = $('#body_box .right-box .box-body .quota')
|
|
@@ -443,28 +448,68 @@ function RenderQuotaTable(budget_id,data){
|
|
|
{
|
|
|
title: '序号',
|
|
|
data: 'id',
|
|
|
- width: '100px',
|
|
|
+ width: '80px',
|
|
|
},
|
|
|
{
|
|
|
title: '工程或费用项目名称',
|
|
|
- data: 'project_name',
|
|
|
- width: 'auto',
|
|
|
+ data: 'entry_name',
|
|
|
+ width: '210px',
|
|
|
+ render: (row) => {
|
|
|
+ return `<span class="one-line mw-200px" data-bs-toggle="tooltip" data-bs-placement="top" title="${row.entry_name}" >${row.entry_name}</span>`
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title: '工程数量',
|
|
|
- data: 'project_quantity',
|
|
|
+ data: 'amount',
|
|
|
width: '100px',
|
|
|
},
|
|
|
{
|
|
|
title: '单位',
|
|
|
- data: 'unit',
|
|
|
- width: '100px',
|
|
|
+ data: 'units',
|
|
|
+ width: '80px',
|
|
|
},
|
|
|
{
|
|
|
title: '定额编号',
|
|
|
data: 'quota_code',
|
|
|
width: '100px',
|
|
|
},
|
|
|
+ {
|
|
|
+ title: 'Excel文件',
|
|
|
+ data: 'ex_file',
|
|
|
+ width: '150px',
|
|
|
+ render: (row) => {
|
|
|
+ const path = row.ex_file
|
|
|
+ if (!path) {
|
|
|
+ return '-'
|
|
|
+ }
|
|
|
+ const names = path.split('/')
|
|
|
+ const file_name = names[names.length - 1]
|
|
|
+ return `<span class="one-line mw-150px"><a href="#" onclick="DownloadFile('/api/task/download?filename=${encodeURIComponent(path)}','${file_name}')" class="link link-info px-2">${file_name}</a></span>`
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: 'Excel整行内容',
|
|
|
+ data: 'ex_row',
|
|
|
+ width: 'auto',
|
|
|
+ render: (row) => {
|
|
|
+ return `<span class="one-line w-300px" data-bs-toggle="tooltip" data-bs-placement="top" title="${row.ex_row}" >${row.ex_row}</span>`
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: 'Excel数量',
|
|
|
+ data: 'ex_amount',
|
|
|
+ width: '100px',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '数量位置',
|
|
|
+ data: 'ex_cell',
|
|
|
+ width: '80px',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '数量单位',
|
|
|
+ data: 'ex_unit',
|
|
|
+ width: '80px',
|
|
|
+ },
|
|
|
{
|
|
|
title: '状态',
|
|
|
data: 'status',
|
|
@@ -486,11 +531,11 @@ function RenderQuotaTable(budget_id,data){
|
|
|
str+= `<span class="badge badge-primary ms-3">未发送</span>`
|
|
|
}else if (row.send_status === 1){
|
|
|
str+= `<span class="badge badge-warning ms-3">发送中</span>`
|
|
|
+ }else if (row.send_status === 200){
|
|
|
+ str+= `<span class="badge badge-success ms-3">发送成功</span>`
|
|
|
}else if (row.send_status === 2){
|
|
|
- str+= `<span class="badge badge-success ms-3">已发送</span>`
|
|
|
- }else if (row.send_status === 3){
|
|
|
str+= `<span class="badge badge-danger ms-3">发送失败</span>`
|
|
|
- }else if (row.send_status === 4){
|
|
|
+ }else if (row.send_status === 3){
|
|
|
str+= `<span class="badge badge-danger ms-3">数据变更</span>`
|
|
|
}
|
|
|
|
|
@@ -515,11 +560,11 @@ function RenderQuotaTable(budget_id,data){
|
|
|
// }
|
|
|
if (row.send_status === 0) {
|
|
|
str += `<button type="button" class="btn btn-icon btn-sm btn-light-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="开始发送" onclick="StartSendQuota(${row.id}, ${budget_id})"><i class="ki-duotone ki-send fs-1"><span class="path1"></span><span class="path2"></span></i></button>`
|
|
|
- } else if (row.send_status === 2) {
|
|
|
+ } else if (row.send_status === 200) {
|
|
|
str += `<button type="button" class="btn btn-icon btn-sm btn-light-warning" data-bs-toggle="tooltip" data-bs-placement="top" title="重新发送" onclick="ReStartSendQuota(${row.id}, ${budget_id})"><i class="ki-duotone ki-send fs-1"><span class="path1"></span><span class="path2"></span></i></button>`
|
|
|
- } else if (row.send_status === 3) {
|
|
|
+ } else if (row.send_status === 2) {
|
|
|
str += `<button type="button" class="btn btn-icon btn-sm btn-light-danger" data-bs-toggle="tooltip" data-bs-placement="top" title="重新发送" onclick="ReStartSendQuota(${row.id}, ${budget_id})"><i class="ki-duotone ki-send fs-1"><span class="path1"></span><span class="path2"></span></i></button>`
|
|
|
- } else if (row.send_status === 4) {
|
|
|
+ } else if (row.send_status === 3) {
|
|
|
str += `<button type="button" class="btn btn-icon btn-sm btn-light-info" data-bs-toggle="tooltip" data-bs-placement="top" title="重新发送" onclick="ReStartSendQuota(${row.id}, ${budget_id})"><i class="ki-duotone ki-send fs-1"><span class="path1"></span><span class="path2"></span></i></button>`
|
|
|
}
|
|
|
str+=`<button type="button" class="btn btn-icon btn-sm btn-light-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="编辑" onclick="Edit_Quota(${row.id}, ${budget_id})"><i class="ki-duotone ki-message-edit fs-1"><span class="path1"></span><span class="path2"></span></i></button>`
|
|
@@ -533,16 +578,17 @@ function RenderQuotaTable(budget_id,data){
|
|
|
|
|
|
function SetBudgetData($el){
|
|
|
const $tableBox = $(`#body_box .right-box`)
|
|
|
- $el.find('[name="budget_id"').val($tableBox.find('input[name="budget_id"]').val());
|
|
|
$el.find('[name="project_id"]').val($tableBox.find('input[name="project_id"]').val());
|
|
|
$el.find('[name="item_id"]').val($tableBox.find('input[name="item_id"]').val());
|
|
|
$el.find('[name="item_code"]').val($tableBox.find('input[name="item_code"]').val());
|
|
|
}
|
|
|
+
|
|
|
function Add() {
|
|
|
_fileUploadDropzone.removeAllFiles()
|
|
|
AddModal($modal, () => {
|
|
|
$modal.find('[name="task_id"]').val('0');
|
|
|
- $modal.find('[name="budget_id"]').val('0');
|
|
|
+ $modal.find('[name="budget_id"]').val(0);
|
|
|
+ $modal.find('[name="task_sort"]').val(0);
|
|
|
$modal.find('#delete_file_box').hide();
|
|
|
// $modal.find('[name="delete_file"]').prop('checked',false)
|
|
|
SetBudgetData($modal)
|
|
@@ -569,13 +615,14 @@ function Edit(id) {
|
|
|
$modal.find('[name="item_code"]').val(data.item_code);
|
|
|
$modal.find('[name="task_name"]').val(data.task_name);
|
|
|
$modal.find('[name="task_desc"]').val(data.task_desc);
|
|
|
+ $modal.find('[name="task_sort"]').val(data.task_sort);
|
|
|
// $modal.find('[name="delete_file"]').prop('checked',false)
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-function SaveProject() {
|
|
|
+function SaveProject(is_submit) {
|
|
|
const
|
|
|
formData = new FormData(),
|
|
|
budget_id = $modal.find('[name="budget_id"]').val(),
|
|
@@ -590,10 +637,13 @@ function SaveProject() {
|
|
|
files = _fileUploadDropzone.getAcceptedFiles();
|
|
|
// console.log("FILES",files)
|
|
|
|
|
|
- if(files.length>0){
|
|
|
+ if(files&&files.length>0){
|
|
|
files.forEach((file) => {
|
|
|
formData.append('files', file)
|
|
|
})
|
|
|
+ }else{
|
|
|
+ MsgWarning('文件不能为空,请选择文件')
|
|
|
+ return
|
|
|
}
|
|
|
formData.append('budget_id', budget_id)
|
|
|
formData.append('item_id', item_id)
|
|
@@ -603,7 +653,10 @@ function SaveProject() {
|
|
|
formData.append('task_name', task_name)
|
|
|
formData.append('task_sort', task_sort)
|
|
|
formData.append('task_desc', task_desc)
|
|
|
- formData.append('delete_old', delete_file)
|
|
|
+ // formData.append('delete_old', delete_file)
|
|
|
+ if (is_submit) {
|
|
|
+ formData.append('run_now', 'true')
|
|
|
+ }
|
|
|
|
|
|
IwbAjax({
|
|
|
url:`/api/task/save/${task_id}`,
|
|
@@ -618,27 +671,32 @@ function Delete(id){
|
|
|
ConfirmUrl('确定删除吗?',`/api/task/delete/${id}`,`#table_0`)
|
|
|
}
|
|
|
|
|
|
-function StartCollectTask(id){
|
|
|
- ConfirmUrl('确定开始采集吗?',`/api/task/start_collect/${id}`,`#table_0`)
|
|
|
-}
|
|
|
-function ReStartCollectTask(id){
|
|
|
- ConfirmUrl('确定重新开始采集吗?',`/api/task/start_collect/${id}`,`#table_0`)
|
|
|
+function StarTask(id){
|
|
|
+ ConfirmUrl('确定开始运行任务吗?',`/api/task/start_task/${id}`,`#table_0`)
|
|
|
}
|
|
|
|
|
|
-function StartProcessTask(id){
|
|
|
- ConfirmUrl('确定开始处理吗?',`/api/task/start_process/${id}`,`#table_0`)
|
|
|
+function ReStarTask(id){
|
|
|
+ ConfirmUrl('确定重新开始运行任务吗?',`/api/task/start_task/${id}`,`#table_0`)
|
|
|
}
|
|
|
-
|
|
|
-function ReStartProcessTask(id){
|
|
|
- ConfirmUrl('确定重新开始处理吗?',`/api/task/start_process/${id}`,`#table_0`)
|
|
|
+function CancelTask(id){
|
|
|
+ ConfirmUrl('确定取消运行任务吗?',`/api/task/cancel_task/${id}`,`#table_0`)
|
|
|
}
|
|
|
|
|
|
-function StartSendTask(id){
|
|
|
- ConfirmUrl('确定开始发送吗?',`/api/task/start_send/${id}`,`#table_0`)
|
|
|
-}
|
|
|
-function ReStartSendTask(id){
|
|
|
- ConfirmUrl('确定重新开始发送吗?',`/api/task/start_send/${id}`,`#table_0`)
|
|
|
-}
|
|
|
+
|
|
|
+// function StartProcessTask(id){
|
|
|
+// ConfirmUrl('确定开始处理吗?',`/api/task/start_process/${id}`,`#table_0`)
|
|
|
+// }
|
|
|
+//
|
|
|
+// function ReStartProcessTask(id){
|
|
|
+// ConfirmUrl('确定重新开始处理吗?',`/api/task/start_process/${id}`,`#table_0`)
|
|
|
+// }
|
|
|
+
|
|
|
+// function StartSendTask(id){
|
|
|
+// ConfirmUrl('确定开始发送吗?',`/api/task/start_send/${id}`,`#table_0`)
|
|
|
+// }
|
|
|
+// function ReStartSendTask(id){
|
|
|
+// ConfirmUrl('确定重新开始发送吗?',`/api/task/start_send/${id}`,`#table_0`)
|
|
|
+// }
|
|
|
|
|
|
function Add_Quota(budget_id,) {
|
|
|
AddModal($modalQuota, () => {
|
|
@@ -712,12 +770,12 @@ function Delete_Quota(id,budget_id){
|
|
|
ConfirmUrl('确定删除吗?',`/api/quota/delete/${id}`,`#table_${budget_id}`)
|
|
|
}
|
|
|
|
|
|
-function StartProcessQuota(id,budget_id){
|
|
|
- ConfirmUrl('确定开始处理吗?',`/api/quota/start_process/${id}`,`#table_${budget_id}`)
|
|
|
-}
|
|
|
-function ReStartProcessQuota(id,budget_id){
|
|
|
- ConfirmUrl('确定重新开始处理吗?',`/api/quota/start_process/${id}`,`#table_${budget_id}`)
|
|
|
-}
|
|
|
+// function StartProcessQuota(id,budget_id){
|
|
|
+// ConfirmUrl('确定开始处理吗?',`/api/quota/start_process/${id}`,`#table_${budget_id}`)
|
|
|
+// }
|
|
|
+// function ReStartProcessQuota(id,budget_id){
|
|
|
+// ConfirmUrl('确定重新开始处理吗?',`/api/quota/start_process/${id}`,`#table_${budget_id}`)
|
|
|
+// }
|
|
|
function StartSendQuota(id,budget_id){
|
|
|
ConfirmUrl('确定开始发送吗?',`/api/quota/start_send/${id}`,`#table_${budget_id}`)
|
|
|
}
|