|
@@ -19,20 +19,22 @@ const nav_tab_template = `
|
|
|
<input type="hidden" name="item_id" value="">
|
|
|
<input type="hidden" name="item_code" value="">
|
|
|
</section>
|
|
|
- <div class="my-2 d-flex align-items-center table-title mt-5">
|
|
|
+ <div class="my-2 d-flex align-items-center table-title mt-5">
|
|
|
<span class="fw-bolder me-5 title fs-2"></span>
|
|
|
-<!-- <span class="badge badge-primary fs-2">定额任务列表</span>-->
|
|
|
- <div class="form-check form-check-custom form-check-primary form-check-solid">
|
|
|
- <input class="form-check-input" name="table_radio" type="radio" value="task" id="task_radio"/>
|
|
|
- <label class="form-check-label fw-bolder text-primary" for="task_radio">
|
|
|
- 任务列表
|
|
|
- </label>
|
|
|
- </div>
|
|
|
- <div class="form-check form-check-custom form-check-success form-check-solid ms-5">
|
|
|
- <input class="form-check-input" name="table_radio" type="radio" value="quota" id="quota_radio"/>
|
|
|
- <label class="form-check-label fw-bolder text-success" for="quota_radio">
|
|
|
- 定额输入
|
|
|
- </label>
|
|
|
+ <span class="badge d-none badge-primary fs-5 me-5"></span>
|
|
|
+ <div class="d-flex">
|
|
|
+ <div class="form-check form-check-custom form-check-primary form-check-solid">
|
|
|
+ <input class="form-check-input" name="table_radio" type="radio" value="task" id="task_radio"/>
|
|
|
+ <label class="form-check-label fw-bolder text-primary" for="task_radio">
|
|
|
+ 任务列表
|
|
|
+ </label>
|
|
|
+ </div>
|
|
|
+ <div class="form-check form-check-custom form-check-success form-check-solid ms-5">
|
|
|
+ <input class="form-check-input" name="table_radio" type="radio" value="quota" id="quota_radio"/>
|
|
|
+ <label class="form-check-label fw-bolder text-success" for="quota_radio">
|
|
|
+ 定额输入
|
|
|
+ </label>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="d-flex justify-content-between my-5">
|
|
@@ -120,7 +122,7 @@ function InitFileUpload(){
|
|
|
dropzoneItem.style.display = '';
|
|
|
});
|
|
|
if(_fileUploadDropzone.getAcceptedFiles().findIndex(item=>item.name===file.name)>=0){
|
|
|
- alert('文件已存在')
|
|
|
+ MsgWarning('文件已存在')
|
|
|
_fileUploadDropzone.removeFile(file);
|
|
|
}
|
|
|
});
|
|
@@ -236,13 +238,14 @@ function RenderTabCondent(data) {
|
|
|
_taskTable($table,data)
|
|
|
}
|
|
|
})
|
|
|
- if(data.children_count>0){
|
|
|
+ if(data.children_count>0||data.chapter){
|
|
|
$tableBox.find('.table-title .title').text(title)
|
|
|
- // $tableBox.find('.table-title .badge').text('任务列表').removeClass('badge-success').addClass('badge-primary')
|
|
|
+ $tableBox.find('.table-title .badge').text('任务列表').removeClass('badge-success').addClass('badge-primary')
|
|
|
+ $tableBox.find('#task_radio').prop("checked",true)
|
|
|
_taskTable($table,data)
|
|
|
} else {
|
|
|
$tableBox.find('.table-title .title').text(title)
|
|
|
- // $tableBox.find('.table-title .badge').text('定额输入明细').removeClass('badge-primary').addClass('badge-success')
|
|
|
+ $tableBox.find('.table-title .badge').text('定额输入明细').removeClass('badge-primary').addClass('badge-success')
|
|
|
$tableBox.find('#task_radio').prop("disabled",true)
|
|
|
$tableBox.find('#quota_radio').prop("checked",true)
|
|
|
_quotaTable($table,data)
|
|
@@ -298,22 +301,22 @@ function RenderTabCondent(data) {
|
|
|
} else if (row.collect_status === 2){
|
|
|
str += `<span class="badge badge-light-success">采集完成</span>`
|
|
|
if (row.process_status === 0) {
|
|
|
- str += `<span class="badge badge-light-primary">未处理</span>`
|
|
|
+ str += `<span class="badge badge-light-primary ms-3">未处理</span>`
|
|
|
} else if (row.process_status === 1){
|
|
|
- str += `<span class="badge badge-light-warning">处理中</span>`
|
|
|
+ str += `<span class="badge badge-light-warning ms-3">处理中</span>`
|
|
|
} else if (row.process_status === 2){
|
|
|
- str += `<span class="badge badge-light-success">已处理</span>`
|
|
|
+ str += `<span class="badge badge-light-success ms-3">处理完成</span>`
|
|
|
if (row.send_status === 0) {
|
|
|
- str += `<span class="badge badge-light-primary">未发送</span>`
|
|
|
+ str += `<span class="badge badge-light-primary ms-3">未发送</span>`
|
|
|
} else if (row.send_status === 1){
|
|
|
- str += `<span class="badge badge-light-warning">发送中</span>`
|
|
|
+ str += `<span class="badge badge-light-warning ms-3">发送中</span>`
|
|
|
} else if (row.send_status === 2){
|
|
|
- str += `<span class="badge badge-light-success">已发送</span>`
|
|
|
+ str += `<span class="badge badge-light-success ms-3">发送完成</span>`
|
|
|
} else if (row.send_status === 3){
|
|
|
- str += `<span class="badge badge-light-danger">发送失败</span>`
|
|
|
+ str += `<span class="badge badge-light-danger ms-3">发送失败</span>`
|
|
|
}
|
|
|
} else if (row.process_status === 3){
|
|
|
- str += `<span class="badge badge-light-danger">处理失败</span>`
|
|
|
+ str += `<span class="badge badge-light-danger ms-3">处理失败</span>`
|
|
|
}
|
|
|
} else if (row.collect_status === 3){
|
|
|
str += `<span class="badge badge-light-danger">采集失败</span>`
|
|
@@ -375,14 +378,24 @@ function RenderTabCondent(data) {
|
|
|
data: 'project_name',
|
|
|
width: 'auto',
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '工程数量',
|
|
|
+ data: 'project_quantity',
|
|
|
+ width: '100px',
|
|
|
+ },
|
|
|
{
|
|
|
title: '单位',
|
|
|
data: 'unit',
|
|
|
width: '100px',
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '定额编号',
|
|
|
+ data: 'quota_code',
|
|
|
+ width: '100px',
|
|
|
+ },
|
|
|
{
|
|
|
title: '状态',
|
|
|
- data: 'task_desc',
|
|
|
+ data: 'status',
|
|
|
width: '150px',
|
|
|
render: (row) => {
|
|
|
let str=''
|
|
@@ -544,9 +557,10 @@ function ReStartSendTask(id,budget_id){
|
|
|
ConfirmUrl('确定重新开始发送吗?',`/api/task/start_send/${id}`,`#table_${budget_id}`)
|
|
|
}
|
|
|
|
|
|
-function Add_Quota(budget_id) {
|
|
|
+function Add_Quota(budget_id,) {
|
|
|
AddModal($modalQuota, () => {
|
|
|
- $modalQuota.find('#quota_id').val('0');
|
|
|
+ $modalQuota.find('[name="quota_id"]').val('0');
|
|
|
+ $modalQuota.find('[name="task_id"]').val('0');
|
|
|
SetBudgetData($modalQuota, budget_id)
|
|
|
})
|
|
|
}
|
|
@@ -554,7 +568,7 @@ function Add_Quota(budget_id) {
|
|
|
function Edit_Quota(id) {
|
|
|
EditModal($modalQuota,()=>{
|
|
|
IwbAjax_1({
|
|
|
- url:`/api/task/get/${id}`,
|
|
|
+ url:`/api/quota/get/${id}`,
|
|
|
success:res=>{
|
|
|
if(!res.success){
|
|
|
console.error(res.message)
|
|
@@ -562,12 +576,16 @@ function Edit_Quota(id) {
|
|
|
}
|
|
|
const data = res.data
|
|
|
// SetBudgetData(budget_id)
|
|
|
- $modalQuota.find('#quota_id').val(data.id);
|
|
|
+ $modalQuota.find('[name="quota_id"]').val(data.id);
|
|
|
+ $modalQuota.find('[name="task_id"]').val(data.task_id);
|
|
|
$modalQuota.find('[name="budget_id"]').val(data.budget_id);
|
|
|
$modalQuota.find('[name="project_id"]').val(data.project_id);
|
|
|
$modalQuota.find('[name="item_id"]').val(data.item_id);
|
|
|
$modalQuota.find('[name="item_code"]').val(data.item_code);
|
|
|
$modalQuota.find('[name="project_name"]').val(data.project_name);
|
|
|
+ $modalQuota.find('[name="project_quantity"]').val(data.project_quantity);
|
|
|
+ $modalQuota.find('[name="unit"]').val(data.unit);
|
|
|
+ $modalQuota.find('[name="quota_code"]').val(data.quota_code);
|
|
|
|
|
|
}
|
|
|
})
|
|
@@ -575,20 +593,29 @@ function Edit_Quota(id) {
|
|
|
}
|
|
|
|
|
|
function SaveQuota(){
|
|
|
- const quota_id = $modalQuota.find('#quota_id').val(),
|
|
|
+ const quota_id = $modalQuota.find('[name="quota_id"]').val(),
|
|
|
+ task_id = $modalQuota.find('[name="task_id"]').val(),
|
|
|
budget_id = $modalQuota.find('[name="budget_id"]').val(),
|
|
|
project_id = $modalQuota.find('[name="project_id"]').val(),
|
|
|
item_id = $modalQuota.find('[name="item_id"]').val(),
|
|
|
item_code = $modalQuota.find('[name="item_code"]').val(),
|
|
|
- project_name = $modalQuota.find('[name="project_name"]').val()
|
|
|
+ project_name = $modalQuota.find('[name="project_name"]').val(),
|
|
|
+ project_quantity = $modalQuota.find('[name="project_quantity"]').val(),
|
|
|
+ unit = $modalQuota.find('[name="unit"]').val(),
|
|
|
+ quota_code = $modalQuota.find('[name="quota_code"]').val()
|
|
|
IwbAjax({
|
|
|
- url:`/api/quota/save/${quota_id}`,
|
|
|
- body:{
|
|
|
+ url:`/api/quota/save`,
|
|
|
+ data:{
|
|
|
+ id: quota_id,
|
|
|
+ task_id,
|
|
|
budget_id,
|
|
|
project_id,
|
|
|
item_id,
|
|
|
item_code,
|
|
|
- project_name
|
|
|
+ project_name,
|
|
|
+ project_quantity,
|
|
|
+ unit,
|
|
|
+ quota_code
|
|
|
},
|
|
|
modal:$modalQuota,
|
|
|
table:`#table_${budget_id}`
|