订单发货状态验证优化,动态列表id支持多条件,导出excel支持选择数据

This commit is contained in:
gongfuxiang 2024-07-08 18:17:17 +08:00
parent fa5dacd668
commit d8f8153ba8
4 changed files with 39 additions and 18 deletions

View File

@ -1464,6 +1464,13 @@ class FormTableHandleModule
$value = str_replace(['-', '/', '|'], '', $value);
}
// id字段则判断数据值是否包含半角逗号则条件类型强制为in
if(!is_array($value) && ($where_name == 'id' || stripos($where_name, '.id') !== false) && stripos($value, ',') !== false)
{
$where_symbol = 'in';
$value = explode(',', $value);
}
// 条件
$this->where[] = [$where_name, $where_symbol, $value];
}

View File

@ -1240,6 +1240,7 @@ class GoodsService
'spec_base' => empty($specifications_base['data']) ? '' : json_encode($specifications_base['data'], JSON_UNESCAPED_UNICODE),
'fictitious_goods_value' => $fictitious_goods_value,
'site_type' => (isset($params['site_type']) && $params['site_type'] != '') ? $params['site_type'] : -1,
'sort_level' => empty($params['sort_level']) ? 0 : intval($params['sort_level']),
];
// 是否存在赠送积分

View File

@ -1557,7 +1557,7 @@ class OrderService
// 支付
$result['is_pay'] = ($data['pay_status'] == 0 && !in_array($data['status'], [0,5,6])) ? 1 : 0;
// 发货、取货
$result['is_delivery'] = isset($data['order_model']) && (($data['order_model'] == 0 && in_array($data['status'], [2,3])) || ($data['order_model'] == 2 && $data['status'] == 2)) ? 1 : 0;
$result['is_delivery'] = isset($data['order_model']) && (($data['order_model'] == 0 && in_array($data['status'], [2,3])) || (in_array($data['order_model'], [2,3]) && $data['status'] == 2)) ? 1 : 0;
// 收货
$result['is_collect'] = ($data['status'] == 3) ? 1 : 0;
// 取消

View File

@ -3920,7 +3920,7 @@ $(function () {
});
// 表格公共搜索操作
$('.form-table-operate-top-search-submit').on('click', function () {
$(document).on('click', '.form-table-operate-top-search-submit', function () {
// 表单数据
var element = 'form.form-validation-search';
var $form = $(element);
@ -3994,7 +3994,7 @@ $(function () {
});
// 表格公共删除操作
$('.form-table-operate-top-delete-submit').on('click', function () {
$(document).on('click', '.form-table-operate-top-delete-submit', function () {
// 请求 url
var url = $(this).data('url') || null;
if (url == null) {
@ -4065,30 +4065,43 @@ $(function () {
});
// 表格公共excel导出操作
$('.form-table-operate-top-export-excel-submit').on('click', function () {
$(document).on('click', '.form-table-operate-top-export-excel-submit', function () {
// 表单基础
var form_name = 'form.form-validation-search';
var $form = $(form_name);
var request_value = $form.attr('request-value') || null;
if (request_value == null) {
// 不存在表单则直接使用当前地址
request_value = window.open(UrlFieldReplace('form_table_is_export_excel', 1));
} else {
// 拼接参数
var params = GetFormVal(form_name, true);
var pv = 'form_table_is_export_excel=1&';
for (var i in params) {
if (params[i] != undefined && params[i] != '') {
pv += i + '=' + encodeURIComponent(params[i]) + '&';
var request_value = $form.attr('request-value') || window.location.href;
request_value = UrlFieldReplace('form_table_is_export_excel', null, request_value);
// 拼接条件
var pv = 'form_table_is_export_excel=1&';
// 是否存在数据选择(复选框列+id数据列
var id_form_name = null;
if($form.find('.form-table-search-item-head-value-form_checkbox_value').length > 0 && $form.find('.form-table-search-item-head-value-id').length > 0) {
// 是否有选择的数据
var values = FromTableCheckedValues('form_checkbox_value', '.am-table-scrollable-horizontal');
if(values.length > 0) {
id_form_name = $form.find('.form-table-search-item-head-value-id input').attr('name') || null;
if(id_form_name != null) {
pv += id_form_name + '=' + encodeURIComponent(values.join(',')) + '&';
}
}
var join = (request_value.indexOf('?') >= 0) ? '&' : '?';
request_value += join + pv.substr(0, pv.length - 1);
}
// 拼接参数
var params = GetFormVal(form_name, true);
for (var i in params) {
if (params[i] != undefined && params[i] != '' && i != id_form_name) {
pv += i + '=' + encodeURIComponent(params[i]) + '&';
}
}
var join = (request_value.indexOf('?') >= 0) ? '&' : '?';
request_value += join + pv.substr(0, pv.length - 1);
window.open(request_value);
});
// 表格公共excel导出操作
// 表格公共pdf导出和打印操作
$(document).on('click', '.form-table-operate-top-data-print-submit,.common-print-submit', function () {
DataPrintHandle($(this).data('is-pdf'));
});