This commit is contained in:
xman 2025-05-31 15:21:01 +08:00
parent 8ff54692cf
commit e548cf86a4
2 changed files with 96 additions and 2 deletions

View File

@ -30,7 +30,7 @@ class Dispatch2 extends Backend
*/
protected $model = null;
protected $searchFields = 'order.id,order.order_no,order.tel,order.customer,worker_name,worker_tel';
protected $searchFields = 'orderb.id,orderb.order_no,orderb.tel,orderb.customer,worker_name,worker_tel';
public function _initialize()
{

View File

@ -41,7 +41,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($,
{field: 'id', title: __('Id'), operate: false},
{field: 'order.order_no', title: __('Order.order_no'), operate: '='},
{field: 'orderb.order_no', title: __('Order.order_no'), operate: '='},
{
field: 'follow',
@ -194,6 +194,62 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($,
return false;
}
},
{
name: 'deleteOrder',
text: '取消订单',
title: '取消订单',
classname: 'btn btn-dialog',
icon: 'fa fa-trash',
url: function(row){
return 'order/delete/ids/'+row.order_id;
},
dropdown: "更多",
visible: function (row) {
if (row.orderb.status >= 0 && row.orderb.status < 60 && row.status >0) {
return true;
}
return false;
},
},
{
name:"error",
text:"订单报错",
title:"订单报错",
extend: 'data-toggle="tooltip" data-container="body"',
classname: 'btn btn-dialog',
icon: 'fa fa-bolt',
url: function(row) {
return 'order/addAbnormal/ids/' + row.order_id;
},
refresh:true,
dropdown: "更多",
visible: function (row) {
if (row.orderb.status != 60 && row.status > 0) {
return true;
}
return false;
},
},
{
name: 'invoice',
text: '申请开票',
title: '申请开票',
classname: 'btn btn-dialog',
icon: 'fa fa-send',
url: function(row){
return 'order/invoice/ids/'+row.order_id;
},
dropdown: "更多",
visible: function (row) {
if (row.orderb.status == 60 && row.status>0) {
return true;
}
return false;
},
},
],
}
@ -325,6 +381,44 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($,
dispatchlog: function () {
Controller.api.bindevent();
},
addabnormal: function () {
Form.api.bindevent($("#add-form"));
},
deleteOrder: function () {
Form.api.bindevent($("form[role=form]"));
},
invoice: function () {
function toggleInvoiceFields() {
const type = $('#c-source').val();
if (type === '1') {
// 公司发票
$('#c-tax_number').closest('.form-group').show();
$('#c-company_address').closest('.form-group').show();
$('#c-company_phone').closest('.form-group').show();
$('#c-bank_name').closest('.form-group').show();
$('#c-bank_account').closest('.form-group').show();
} else {
// 个人发票
$('#c-tax_number').closest('.form-group').hide();
$('#c-company_address').closest('.form-group').hide();
$('#c-company_phone').closest('.form-group').hide();
$('#c-bank_name').closest('.form-group').hide();
$('#c-bank_account').closest('.form-group').hide();
}
}
// 初始化时执行一次
toggleInvoiceFields();
// 监听 select 改变
$('#c-source').on('change',function () {
toggleInvoiceFields();
});
Form.api.bindevent($("form[role=form]"));
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));