初始上传
This commit is contained in:
38
addon/electronicsheet/config/diy_view.php
Executable file
38
addon/electronicsheet/config/diy_view.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
return [
|
||||
|
||||
// 自定义模板页面类型,格式:[ 'title' => '页面类型名称', 'name' => '页面标识', 'path' => '页面路径', 'value' => '页面数据,json格式' ]
|
||||
'template' => [],
|
||||
|
||||
// 后台自定义组件——装修
|
||||
'util' => [],
|
||||
|
||||
// 自定义页面路径
|
||||
'link' => [],
|
||||
|
||||
// 自定义图标库
|
||||
'icon_library' => [],
|
||||
|
||||
// uni-app 组件,格式:[ 'name' => '组件名称/文件夹名称', 'path' => '文件路径/目录路径' ],多个逗号隔开,自定义组件名称前缀必须是diy-,也可以引用第三方组件
|
||||
'component' => [],
|
||||
|
||||
// uni-app 页面,多个逗号隔开
|
||||
'pages' => [],
|
||||
|
||||
// 模板信息,格式:'title' => '模板名称', 'name' => '模板标识', 'cover' => '模板封面图', 'preview' => '模板预览图', 'desc' => '模板描述'
|
||||
'info' => [],
|
||||
|
||||
// 主题风格配色,格式可以自由定义扩展,【在uni-app中通过:this.themeStyle... 获取定义的颜色字段,例如:this.themeStyle.main_color】
|
||||
'theme' => [],
|
||||
|
||||
// 自定义页面数据,格式:[ 'title' => '页面名称', 'name' => "页面标识", 'value' => [页面数据,json格式] ]
|
||||
'data' => []
|
||||
];
|
||||
22
addon/electronicsheet/config/event.php
Executable file
22
addon/electronicsheet/config/event.php
Executable file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
// 事件定义文件
|
||||
return [
|
||||
'bind' => [
|
||||
|
||||
],
|
||||
|
||||
'listen' => [
|
||||
//展示活动
|
||||
'ShowPromotion' => [
|
||||
'addon\electronicsheet\event\ShowPromotion',
|
||||
],
|
||||
|
||||
'PromotionType' => [
|
||||
'addon\electronicsheet\event\PromotionType',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'subscribe' => [
|
||||
],
|
||||
];
|
||||
20
addon/electronicsheet/config/info.php
Executable file
20
addon/electronicsheet/config/info.php
Executable file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
return [
|
||||
'name' => 'electronicsheet',
|
||||
'title' => '电子面单',
|
||||
'description' => '电子面单',
|
||||
'type' => 'tool', //插件类型 system :系统插件(自动安装), promotion:扩展营销插件 tool:工具插件
|
||||
'status' => 1,
|
||||
'author' => '',
|
||||
'version' => '5.5.3',
|
||||
'version_no' => '553250709001',
|
||||
'content' => '',
|
||||
];
|
||||
66
addon/electronicsheet/config/menu_shop.php
Executable file
66
addon/electronicsheet/config/menu_shop.php
Executable file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 店铺端菜单设置
|
||||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
[
|
||||
'name' => 'PROMOTION_ELECTRONICSHEET',
|
||||
'title' => '电子面单',
|
||||
'url' => 'electronicsheet://shop/config/config',
|
||||
'parent' => 'PROMOTION_TOOL',
|
||||
'picture' => 'addon/electronicsheet/shop/view/public/img/distribution_new.png',
|
||||
'picture_selected' => 'addon/electronicsheet/shop/view/public/img/distribution_select.png',
|
||||
'is_show' => 1,
|
||||
'sort' => 1,
|
||||
'child_list' => [
|
||||
[
|
||||
'name' => 'PROMOTION_ELECTRONICSHEET_CONFIG',
|
||||
'title' => '设置',
|
||||
'url' => 'electronicsheet://shop/config/config',
|
||||
'is_show' => 1,
|
||||
'sort' => 1,
|
||||
'child_list' => []
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_ELECTRONICSHEET_GOODS_LIST',
|
||||
'title' => '电子面单模板',
|
||||
'url' => 'electronicsheet://shop/electronicsheet/lists',
|
||||
'is_show' => 1,
|
||||
'sort' => 2,
|
||||
'child_list' => [
|
||||
[
|
||||
'name' => 'PROMOTION_ELECTRONICSHEET_ADD',
|
||||
'title' => '添加模板',
|
||||
'url' => 'electronicsheet://shop/electronicsheet/add',
|
||||
'is_show' => 0,
|
||||
'type' => 'button',
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_ELECTRONICSHEET_EDIT',
|
||||
'title' => '编辑模板',
|
||||
'url' => 'electronicsheet://shop/electronicsheet/edit',
|
||||
'sort' => 1,
|
||||
'is_show' => 0,
|
||||
'type' => 'button',
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_ELECTRONICSHEET_DELETE',
|
||||
'title' => '删除模板',
|
||||
'url' => 'electronicsheet://shop/electronicsheet/delete',
|
||||
'sort' => 1,
|
||||
'is_show' => 0,
|
||||
'type' => 'button',
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_ELECTRONICSHEET_SET_DEFAULT_STATUS',
|
||||
'title' => '设置默认状态',
|
||||
'url' => 'electronicsheet://shop/electronicsheet/setdefaultstatus',
|
||||
'sort' => 1,
|
||||
'is_show' => 0,
|
||||
'type' => 'button',
|
||||
],
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
];
|
||||
1
addon/electronicsheet/data/install.sql
Executable file
1
addon/electronicsheet/data/install.sql
Executable file
@@ -0,0 +1 @@
|
||||
SET NAMES 'utf8';
|
||||
1
addon/electronicsheet/data/uninstall.sql
Executable file
1
addon/electronicsheet/data/uninstall.sql
Executable file
@@ -0,0 +1 @@
|
||||
SET NAMES 'utf8';
|
||||
25
addon/electronicsheet/event/Install.php
Executable file
25
addon/electronicsheet/event/Install.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\electronicsheet\event;
|
||||
|
||||
/**
|
||||
* 应用安装
|
||||
*/
|
||||
class Install
|
||||
{
|
||||
/**
|
||||
* 执行安装
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return success();
|
||||
}
|
||||
}
|
||||
27
addon/electronicsheet/event/PromotionType.php
Executable file
27
addon/electronicsheet/event/PromotionType.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\electronicsheet\event;
|
||||
|
||||
/**
|
||||
* 活动类型
|
||||
*/
|
||||
class PromotionType
|
||||
{
|
||||
|
||||
/**
|
||||
* 活动类型
|
||||
* @return array
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return [ "name" => "电子面单", "type" => "electronicsheet" ];
|
||||
}
|
||||
}
|
||||
46
addon/electronicsheet/event/ShowPromotion.php
Executable file
46
addon/electronicsheet/event/ShowPromotion.php
Executable file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\electronicsheet\event;
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
*/
|
||||
class ShowPromotion
|
||||
{
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
* @return array
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$data = [
|
||||
'shop' => [
|
||||
[
|
||||
//插件名称
|
||||
'name' => 'electronicsheet',
|
||||
//店铺端展示分类 shop:营销活动 member:互动营销
|
||||
'show_type' => 'tool',
|
||||
//展示主题
|
||||
'title' => '电子面单',
|
||||
//展示介绍
|
||||
'description' => '商家发货主动打印快递面单',
|
||||
//展示图标
|
||||
'icon' => 'addon/electronicsheet/icon.png',
|
||||
//跳转链接
|
||||
'url' => 'electronicsheet://shop/electronicsheet/lists',
|
||||
]
|
||||
]
|
||||
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
25
addon/electronicsheet/event/UnInstall.php
Executable file
25
addon/electronicsheet/event/UnInstall.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\electronicsheet\event;
|
||||
|
||||
/**
|
||||
* 应用卸载
|
||||
*/
|
||||
class UnInstall
|
||||
{
|
||||
/**
|
||||
* 执行卸载
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return success();
|
||||
}
|
||||
}
|
||||
BIN
addon/electronicsheet/icon.png
Executable file
BIN
addon/electronicsheet/icon.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 847 B |
172
addon/electronicsheet/model/ElectronicsheetDelivery.php
Executable file
172
addon/electronicsheet/model/ElectronicsheetDelivery.php
Executable file
@@ -0,0 +1,172 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\electronicsheet\model;
|
||||
|
||||
use app\model\BaseModel;
|
||||
use app\model\shop\Shop;
|
||||
use extend\Kdniao;
|
||||
use app\model\system\Address;
|
||||
|
||||
/**
|
||||
* 电子面单物流配送
|
||||
*/
|
||||
class ElectronicsheetDelivery extends BaseModel
|
||||
{
|
||||
|
||||
/**
|
||||
* 电子面单发货
|
||||
* @param $param
|
||||
* @param $is_delivery
|
||||
* @return array
|
||||
*/
|
||||
public function delivery($param)
|
||||
{
|
||||
//获取电子面单设置
|
||||
$electronicsheet_model = new ExpressElectronicsheet();
|
||||
$config_info = $electronicsheet_model->getElectronicsheetConfig($param[ 'site_id' ])[ 'data' ][ 'value' ];
|
||||
if (empty($config_info)) {
|
||||
return $this->error('', '请先配置电子面单');
|
||||
}
|
||||
|
||||
if (empty($param[ 'template_id' ])) {
|
||||
return $this->error('', '请先配置电子面单模板');
|
||||
}
|
||||
//获取电子模板信息
|
||||
$template = $electronicsheet_model->getExpressElectronicsheetInfo([ [ 'id', '=', $param[ 'template_id' ] ] ])[ 'data' ];
|
||||
if (empty($template)) {
|
||||
return $this->error('', '电子面单模板不存在');
|
||||
}
|
||||
|
||||
//获取店铺信息
|
||||
$shop_model = new Shop();
|
||||
$shop_info = $shop_model->getShopInfo([ [ 'site_id', '=', $param[ 'site_id' ] ] ])[ 'data' ];
|
||||
|
||||
if (empty($shop_info[ 'name' ])) {
|
||||
return $this->error('', '店铺联系地址中联系人姓名未设置');
|
||||
}
|
||||
if (empty($shop_info[ 'province_name' ]) || empty($shop_info[ 'city_name' ]) || empty($shop_info[ 'district_name' ]) || empty($shop_info[ 'address' ])) {
|
||||
return $this->error('', '店铺联系地址中联系地址未设置');
|
||||
}
|
||||
if (empty($shop_info[ 'telephone' ]) && empty($shop_info[ 'mobile' ])) {
|
||||
return $this->error('', '店铺联系地址中联系方式未设置');
|
||||
}
|
||||
|
||||
$result = $this->electronicsheetDelivery($param, $config_info, $template, $shop_info);
|
||||
if (isset($result[ 'code' ]) && $result[ 'code' ] < 0) {
|
||||
return $result;
|
||||
} else {
|
||||
return $this->success($result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 电子面单发货
|
||||
* @param $delivery_id //包裹id
|
||||
* @param $config_info //快递鸟配置信息
|
||||
* @param $template //电子面单模板
|
||||
* @param $shop_info //发货人信息
|
||||
* @param $goods_array //商品信息
|
||||
* @return array
|
||||
*/
|
||||
public function electronicsheetDelivery($param, $config_info, $template, $shop_info)
|
||||
{
|
||||
//获取订单信息
|
||||
$order_info = model('order')->getInfo([ [ 'order_id', '=', $param[ 'order_id' ] ] ]);
|
||||
//获取快递公司编码
|
||||
$express_company = model('express_company_template')->getInfo([ [ 'company_id', '=', $template[ 'company_id' ] ] ], 'express_no,print_style');
|
||||
$print_style = json_decode($express_company[ 'print_style' ], true);
|
||||
|
||||
$goods_commodity = [];
|
||||
//获取商品信息
|
||||
if (empty($param[ 'order_goods_id_array' ])) {
|
||||
$goods_array = model('order_goods')->getList(
|
||||
[
|
||||
[ 'order_id', '=', $param[ 'order_id' ] ]
|
||||
], 'sku_name as GoodsName,num as GoodsQuantity'
|
||||
);
|
||||
} else {
|
||||
$goods_array = model('order_goods')->getList(
|
||||
[
|
||||
[ 'order_goods_id', 'in', $param[ 'order_goods_id_array' ] ],
|
||||
[ 'order_id', '=', $param[ 'order_id' ] ]
|
||||
], 'sku_name as GoodsName,num as GoodsQuantity'
|
||||
);
|
||||
}
|
||||
//替换商品名称中的特殊字符 ' " # & + < > % \
|
||||
$search = array ( "'", '"', '&', '+', '<', '>', '%', "\\", '#', "and" );
|
||||
foreach ($goods_array as $key => $val){
|
||||
$goods_commodity[] = [
|
||||
'GoodsName' => str_replace($search, '', $val[ 'GoodsName' ]),
|
||||
'GoodsQuantity' => $val['GoodsQuantity']
|
||||
];
|
||||
}
|
||||
|
||||
//实例化快递鸟
|
||||
$config = [
|
||||
'EBusinessID' => $config_info[ 'kdniao_user_id' ],
|
||||
'AppKey' => $config_info[ 'kdniao_api_key' ]
|
||||
];
|
||||
$kdniao = new Kdniao($config);
|
||||
//构造电子面单提交信息
|
||||
$eorder = [];
|
||||
$eorder[ 'CustomerName' ] = $template[ 'customer_name' ];
|
||||
$eorder[ 'CustomerPwd' ] = $template[ 'customer_pwd' ];
|
||||
$eorder[ 'SendSite' ] = $template[ 'send_site' ];
|
||||
$eorder[ 'SendStaff' ] = $template[ 'send_staff' ];
|
||||
$eorder[ 'MonthCode' ] = $template[ 'month_code' ];
|
||||
$eorder[ 'ShipperCode' ] = $express_company[ 'express_no' ];//快递公司编码
|
||||
$eorder[ 'OrderCode' ] = $order_info[ 'order_no' ];//订单号
|
||||
$eorder[ 'PayType' ] = $template[ 'postage_payment_method' ]; //邮费支付方式
|
||||
$eorder[ 'ExpType' ] = 1; //快递类型
|
||||
$eorder[ 'TemplateSize' ] = $print_style[ $template[ 'print_style' ] ][ 'template_size' ]; //模板规格
|
||||
//发货人信息
|
||||
$sender = [];
|
||||
$sender[ 'Name' ] = $shop_info[ 'name' ];
|
||||
$sender[ 'Mobile' ] = $shop_info[ 'mobile' ];
|
||||
$sender[ 'Tel' ] = $shop_info[ 'telephone' ];
|
||||
$sender[ 'ProvinceName' ] = $shop_info[ 'province_name' ];
|
||||
$sender[ 'CityName' ] = $shop_info[ 'city_name' ];
|
||||
$sender[ 'ExpAreaName' ] = $shop_info[ 'district_name' ];
|
||||
$sender[ 'Address' ] = $shop_info[ 'address' ];
|
||||
$sender[ 'PostCode' ] = '000000';
|
||||
//获取收货人信息
|
||||
$area_model = new Address();
|
||||
$province_name = $area_model->getAreasInfo([ [ 'id', '=', $order_info[ 'province_id' ] ] ], 'name');
|
||||
$city_name = $area_model->getAreasInfo([ [ 'id', '=', $order_info[ 'city_id' ] ] ], 'name');
|
||||
$district_name = $area_model->getAreasInfo([ [ 'id', '=', $order_info[ 'district_id' ] ] ], 'name');
|
||||
$receiver = [];
|
||||
$receiver[ 'Name' ] = $order_info[ 'name' ];
|
||||
$receiver[ 'Mobile' ] = $order_info[ 'mobile' ];
|
||||
$receiver[ 'ProvinceName' ] = $province_name[ 'data' ][ 'name' ];
|
||||
$receiver[ 'CityName' ] = $city_name[ 'data' ][ 'name' ];
|
||||
$receiver[ 'ExpAreaName' ] = empty($district_name[ 'data' ][ 'name' ]) ? '' : $district_name[ 'data' ][ 'name' ];
|
||||
$receiver[ 'Address' ] = $order_info[ 'address' ];
|
||||
$receiver[ 'PostCode' ] = '000000';
|
||||
|
||||
// $commodity[] = $goods_array;
|
||||
$eorder[ 'Sender' ] = $sender;
|
||||
$eorder[ 'Receiver' ] = $receiver;
|
||||
$eorder[ 'Commodity' ] = $goods_commodity; //商品信息
|
||||
|
||||
$eorder[ 'IsReturnPrintTemplate' ] = 1; //是否返回电子模板
|
||||
|
||||
$jsonResult = $kdniao->submitEOrder($eorder);
|
||||
|
||||
$result = json_decode($jsonResult, true);
|
||||
if (isset($result[ 'ResultCode' ])) {
|
||||
if ($result[ 'ResultCode' ] == '100' || $result[ 'ResultCode' ] == '106') {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
return $this->error('', $result[ 'Reason' ]);
|
||||
}
|
||||
|
||||
}
|
||||
213
addon/electronicsheet/model/ExpressElectronicsheet.php
Executable file
213
addon/electronicsheet/model/ExpressElectronicsheet.php
Executable file
@@ -0,0 +1,213 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\electronicsheet\model;
|
||||
|
||||
use app\model\express\ExpressCompanyTemplate;
|
||||
use app\model\system\Config;
|
||||
use app\model\BaseModel;
|
||||
|
||||
class ExpressElectronicsheet extends BaseModel
|
||||
{
|
||||
|
||||
/************************************ 电子面单设置 start **********************************************************/
|
||||
/**
|
||||
* 电子面单设置
|
||||
* @param $data
|
||||
* @return array
|
||||
*/
|
||||
public function setElectronicsheetConfig($data)
|
||||
{
|
||||
$config = new Config();
|
||||
$res = $config->setConfig($data, '电子面单设置', 1, [ [ 'site_id', '=', $data[ 'site_id' ] ], [ 'app_module', '=', 'shop' ], [ 'config_key', '=', 'ELECTRONICSHEET_CONFIG' ] ]);
|
||||
return $this->success($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取电子面单设置
|
||||
* @return array
|
||||
*/
|
||||
public function getElectronicsheetConfig($site_id)
|
||||
{
|
||||
$config = new Config();
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', 'shop' ], [ 'config_key', '=', 'ELECTRONICSHEET_CONFIG' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'type' => 'kdniao',
|
||||
|
||||
'kdniao_user_id' => '',
|
||||
'kdniao_api_key' => '',
|
||||
'kdniao_port' => '',
|
||||
|
||||
'cainiao_token' => '',
|
||||
'cainiao_ip' => ''
|
||||
];
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
/************************************ 电子面单设置 end **********************************************************/
|
||||
|
||||
/**
|
||||
* 添加电子面单
|
||||
* @param $data
|
||||
* @return array
|
||||
*/
|
||||
public function addExpressElectronicsheet($data)
|
||||
{
|
||||
//判断模板名称是否重复
|
||||
$count = model('express_electronicsheet')->getCount(
|
||||
[
|
||||
[ 'site_id', '=', $data[ 'site_id' ] ],
|
||||
[ 'template_name', '=', $data[ 'template_name' ] ]
|
||||
]);
|
||||
|
||||
if ($count > 0) {
|
||||
return $this->error('', '该电子面单名称已存在');
|
||||
}
|
||||
$express_company_model = new ExpressCompanyTemplate();
|
||||
$express_company_info = $express_company_model->getExpressCompanyTemplateInfo([ [ 'company_id', '=', $data[ 'company_id' ] ] ], 'company_id,company_name,express_no');
|
||||
if (empty($express_company_info)) {
|
||||
return $this->error('', '快递公司不存在');
|
||||
}
|
||||
if (empty($express_company_info[ 'data' ][ 'express_no' ]) || empty($express_company_info[ 'data' ][ 'company_name' ])) {
|
||||
return $this->error('', '快递公司名称或者快递鸟编码为空');
|
||||
}
|
||||
|
||||
$data[ 'express_no' ] = $express_company_info[ 'data' ][ 'express_no' ];
|
||||
$data[ 'company_name' ] = $express_company_info[ 'data' ][ 'company_name' ];
|
||||
$data[ 'create_time' ] = time();
|
||||
|
||||
model('express_electronicsheet')->startTrans();
|
||||
try {
|
||||
|
||||
if ($data[ 'is_default' ] == 1) {
|
||||
$this->setExpressElectronicsheetDefault([ [ 'site_id', '=', $data[ 'site_id' ] ], [ 'is_default', '=', 1 ] ], 0);
|
||||
}
|
||||
model('express_electronicsheet')->add($data);
|
||||
|
||||
model('express_electronicsheet')->commit();
|
||||
return $this->success();
|
||||
} catch (\Exception $e) {
|
||||
model('express_electronicsheet')->rollback();
|
||||
return $this->error('', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑电子面单
|
||||
* @param $data
|
||||
* @return array
|
||||
*/
|
||||
public function editExpressElectronicsheet($data)
|
||||
{
|
||||
//判断模板名称是否重复
|
||||
$count = model('express_electronicsheet')->getCount(
|
||||
[
|
||||
[ 'site_id', '=', $data[ 'site_id' ] ],
|
||||
[ 'id', '<>', $data[ 'id' ] ],
|
||||
[ 'template_name', '=', $data[ 'template_name' ] ]
|
||||
]);
|
||||
if ($count > 0) {
|
||||
return $this->error('', '该电子面单名称已存在');
|
||||
}
|
||||
|
||||
$express_company_model = new ExpressCompanyTemplate();
|
||||
$express_company_info = $express_company_model->getExpressCompanyTemplateInfo([ [ 'company_id', '=', $data[ 'company_id' ] ] ], 'company_id,company_name,express_no');
|
||||
if (empty($express_company_info)) {
|
||||
return $this->error('', '快递公司不存在');
|
||||
}
|
||||
if (empty($express_company_info[ 'data' ][ 'express_no' ]) || empty($express_company_info[ 'data' ][ 'company_name' ])) {
|
||||
return $this->error('', '快递公司名称或者快递鸟编码为空');
|
||||
}
|
||||
$data[ 'express_no' ] = $express_company_info[ 'data' ][ 'express_no' ];
|
||||
$data[ 'company_name' ] = $express_company_info[ 'data' ][ 'company_name' ];
|
||||
$data[ 'update_time' ] = time();
|
||||
|
||||
model('express_electronicsheet')->startTrans();
|
||||
try {
|
||||
|
||||
if ($data[ 'is_default' ] == 1) {
|
||||
$this->setExpressElectronicsheetDefault([ [ 'site_id', '=', $data[ 'site_id' ] ], [ 'id', '<>', $data[ 'id' ] ], [ 'is_default', '=', 1 ] ], 0);
|
||||
}
|
||||
model('express_electronicsheet')->update($data, [ [ 'id', '=', $data[ 'id' ] ], [ 'site_id', '=', $data[ 'site_id' ] ] ]);
|
||||
|
||||
model('express_electronicsheet')->commit();
|
||||
return $this->success();
|
||||
} catch (\Exception $e) {
|
||||
|
||||
model('express_electronicsheet')->rollback();
|
||||
return $this->error('', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置默认状态
|
||||
* @param $condition
|
||||
* @param $is_default
|
||||
* @return array
|
||||
*/
|
||||
public function setExpressElectronicsheetDefault($condition, $is_default)
|
||||
{
|
||||
$res = model('express_electronicsheet')->update([ 'is_default' => $is_default ], $condition);
|
||||
return $this->success($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param $condition
|
||||
* @return array
|
||||
*/
|
||||
public function deleteExpressElectronicsheet($condition)
|
||||
{
|
||||
$res = model('express_electronicsheet')->delete($condition);
|
||||
return $this->success($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取电子面单信息
|
||||
* @param array $condition
|
||||
* @param string $field
|
||||
* @return array
|
||||
*/
|
||||
public function getExpressElectronicsheetInfo($condition = [], $field = '*')
|
||||
{
|
||||
$res = model('express_electronicsheet')->getInfo($condition, $field);
|
||||
return $this->success($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取电子面单列表
|
||||
* @param array $condition
|
||||
* @param string $field
|
||||
* @param string $order
|
||||
* @param string $limit
|
||||
*/
|
||||
public function getExpressElectronicsheetList($condition = [], $field = '*', $order = '', $limit = null)
|
||||
{
|
||||
$list = model('express_electronicsheet')->getList($condition, $field, $order, '', '', '', $limit);
|
||||
return $this->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取电子面单分页列表
|
||||
* @param array $condition
|
||||
* @param number $page
|
||||
* @param string $page_size
|
||||
* @param string $order
|
||||
* @param string $field
|
||||
*/
|
||||
public function getExpressElectronicsheetPageList($condition = [], $page = 1, $page_size = PAGE_LIST_ROWS, $order = '', $field = '*')
|
||||
{
|
||||
$list = model('express_electronicsheet')->pageList($condition, $field, $order, $page, $page_size);
|
||||
return $this->success($list);
|
||||
}
|
||||
|
||||
}
|
||||
47
addon/electronicsheet/shop/controller/Config.php
Executable file
47
addon/electronicsheet/shop/controller/Config.php
Executable file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\electronicsheet\shop\controller;
|
||||
|
||||
use app\shop\controller\BaseShop;
|
||||
use addon\electronicsheet\model\ExpressElectronicsheet as ExpressElectronicsheetModel;
|
||||
|
||||
|
||||
class Config extends BaseShop
|
||||
{
|
||||
|
||||
/*
|
||||
* 电子面单设置
|
||||
*/
|
||||
public function config()
|
||||
{
|
||||
$config = new ExpressElectronicsheetModel();
|
||||
if (request()->isJson()) {
|
||||
|
||||
$data = [
|
||||
'site_id' => $this->site_id,
|
||||
'type' => input('type', 'kdniao'),
|
||||
'kdniao_user_id' => input('kdniao_user_id', ''),
|
||||
'kdniao_api_key' => input('kdniao_api_key', ''),
|
||||
'kdniao_port' => input('kdniao_port', ''),
|
||||
'cainiao_token' => input('cainiao_token', ''),
|
||||
'cainiao_ip' => input('cainiao_ip', ''),
|
||||
];
|
||||
|
||||
return $config->setElectronicsheetConfig($data);
|
||||
} else {
|
||||
|
||||
$res = $config->getElectronicsheetConfig($this->site_id);
|
||||
$this->assign('config_info', $res[ 'data' ][ 'value' ]);
|
||||
return $this->fetch('config/config');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
145
addon/electronicsheet/shop/controller/Electronicsheet.php
Executable file
145
addon/electronicsheet/shop/controller/Electronicsheet.php
Executable file
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\electronicsheet\shop\controller;
|
||||
|
||||
use app\model\express\ExpressCompanyTemplate;
|
||||
use app\shop\controller\BaseShop;
|
||||
use addon\electronicsheet\model\ExpressElectronicsheet as ExpressElectronicsheetModel;
|
||||
|
||||
class Electronicsheet extends BaseShop
|
||||
{
|
||||
|
||||
/*
|
||||
* 电子面单列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$model = new ExpressElectronicsheetModel();
|
||||
|
||||
$condition[] = [ 'site_id', '=', $this->site_id ];
|
||||
//获取续签信息
|
||||
if (request()->isJson()) {
|
||||
$status = input('status', '');//模板状态
|
||||
if ($status) {
|
||||
$condition[] = [ 'status', '=', $status ];
|
||||
}
|
||||
$template_name = input('template_name', '');
|
||||
if ($template_name) {
|
||||
$condition[] = [ 'template_name', 'like', '%' . $template_name . '%' ];
|
||||
}
|
||||
|
||||
$page = input('page', 1);
|
||||
$page_size = input('page_size', PAGE_LIST_ROWS);
|
||||
$list = $model->getExpressElectronicsheetPageList($condition, $page, $page_size, 'is_default desc');
|
||||
return $list;
|
||||
}
|
||||
return $this->fetch('electronicsheet/lists');
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加电子面单
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$data = [
|
||||
'site_id' => $this->site_id,
|
||||
'template_name' => input('template_name', ''),
|
||||
'company_id' => input('company_id', ''),
|
||||
'customer_name' => input('customer_name', ''),
|
||||
'customer_pwd' => input('customer_pwd', ''),
|
||||
'send_site' => input('send_site', ''),
|
||||
'send_staff' => input('send_staff', ''),
|
||||
'month_code' => input('month_code', ''),
|
||||
'postage_payment_method' => input('postage_payment_method', ''),
|
||||
'is_notice' => input('is_notice', ''),
|
||||
'is_default' => input('is_default', 0),
|
||||
'print_style' => input('print_style', 0),
|
||||
];
|
||||
$model = new ExpressElectronicsheetModel();
|
||||
return $model->addExpressElectronicsheet($data);
|
||||
|
||||
} else {
|
||||
//快递公司
|
||||
$express_company_model = new ExpressCompanyTemplate();
|
||||
$condition = [
|
||||
[ 'is_electronicsheet', '=', 1 ],
|
||||
];
|
||||
$company_list = $express_company_model->getExpressCompanyTemplateList($condition, 'company_id,company_name,print_style', 'sort asc');
|
||||
$this->assign('company_list', $company_list[ 'data' ]);
|
||||
return $this->fetch('electronicsheet/add');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑电子面单
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$model = new ExpressElectronicsheetModel();
|
||||
$id = input('id', 0);
|
||||
if (request()->isJson()) {
|
||||
$data = [
|
||||
'id' => $id,
|
||||
'site_id' => $this->site_id,
|
||||
'template_name' => input('template_name', ''),
|
||||
'company_id' => input('company_id', ''),
|
||||
'customer_name' => input('customer_name', ''),
|
||||
'customer_pwd' => input('customer_pwd', ''),
|
||||
'send_site' => input('send_site', ''),
|
||||
'send_staff' => input('send_staff', ''),
|
||||
'month_code' => input('month_code', ''),
|
||||
'postage_payment_method' => input('postage_payment_method', ''),
|
||||
'is_notice' => input('is_notice', ''),
|
||||
'is_default' => input('is_default', 0),
|
||||
'print_style' => input('print_style', 0),
|
||||
];
|
||||
return $model->editExpressElectronicsheet($data);
|
||||
|
||||
} else {
|
||||
|
||||
$info = $model->getExpressElectronicsheetInfo([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ]);
|
||||
$this->assign('electronicsheet_info', $info[ 'data' ]);
|
||||
//快递公司
|
||||
$express_company_model = new ExpressCompanyTemplate();
|
||||
$condition = [
|
||||
[ 'is_electronicsheet', '=', 1 ],
|
||||
];
|
||||
$company_list = $express_company_model->getExpressCompanyTemplateList($condition, 'company_id,company_name,print_style', 'sort asc');
|
||||
$this->assign('company_list', $company_list[ 'data' ]);
|
||||
return $this->fetch('electronicsheet/edit');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 删除
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$id = input('id', '');
|
||||
|
||||
$groupbuy_model = new ExpressElectronicsheetModel();
|
||||
return $groupbuy_model->deleteExpressElectronicsheet([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ]);
|
||||
}
|
||||
|
||||
/*
|
||||
* 修改默认状态
|
||||
*/
|
||||
public function setDefaultStatus()
|
||||
{
|
||||
$id = input('id', '');
|
||||
|
||||
$groupbuy_model = new ExpressElectronicsheetModel();
|
||||
$groupbuy_model->setExpressElectronicsheetDefault([ [ 'site_id', '=', $this->site_id ] ], 0);
|
||||
return $groupbuy_model->setExpressElectronicsheetDefault([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ], 1);
|
||||
}
|
||||
|
||||
}
|
||||
192
addon/electronicsheet/shop/view/config/config.html
Executable file
192
addon/electronicsheet/shop/view/config/config.html
Executable file
@@ -0,0 +1,192 @@
|
||||
<style>
|
||||
.tips-wrap a {
|
||||
color: #fb6638;
|
||||
background: transparent;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
-webkit-transition: color .2s ease;
|
||||
transition: color .2s ease;
|
||||
}
|
||||
.desc{
|
||||
margin-bottom: 15px;border:1px dashed #ff8143;padding: 5px 10px;background: #fff0e9;color: #ff8143;width: 65%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="layui-form">
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">电子面单设置</span>
|
||||
</div>
|
||||
<div class="layui-collapse tips-wrap cainiao">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">使用说明</h2>
|
||||
<ul class="layui-colla-content kdniao">
|
||||
<li>1.注册菜鸟账号 <a href="https://lcp.cloud.cainiao.com/permission/index" target="_blank">https://lcp.cloud.cainiao.com/permission/index</a> 在三方授权管理 搜索服务商发布的应用,点击授权,查看授权获取token。</li>
|
||||
<li>2. 前往<a href="https://dayin.cainiao.com" target="_blank"> https://dayin.cainiao.com </a> 添加订购关系。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
<div class="desc">
|
||||
1. 注册快递鸟ID。<br>
|
||||
2. 实名认证。<br>
|
||||
3. 申请电子面单API:在快递鸟用户管理后台--申请API页面,点击申请电子面单API。<br>
|
||||
4. 将快递鸟用户ID以及API key填入以下表单。
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">类型选择:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="radio" name="type" value="kdniao" title="快递鸟" {if $config_info.type == 'kdniao'} checked="" {/if} lay-filter="type">
|
||||
<!--<input type="radio" name="type" value="cainiao" title="菜鸟" {if $config_info.type == 'cainiao'} checked="" {/if} lay-filter="type">-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item kdniao">
|
||||
<label class="layui-form-label">用户ID:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="kdniao_user_id" value="{$config_info.kdniao_user_id}" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item kdniao">
|
||||
<label class="layui-form-label">API key:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="kdniao_api_key" value="{$config_info.kdniao_api_key}" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item cainiao">
|
||||
<label class="layui-form-label">token:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="cainiao_token" value="{$config_info.cainiao_token}" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">打印机设置</span>
|
||||
</div>
|
||||
|
||||
<div class="layui-collapse tips-wrap cainiao">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">使用说明</h2>
|
||||
<ul class="layui-colla-content">
|
||||
<li>1.下载菜鸟组件并安装。下载链接:<a href="http://cloudprint-docs-resource.oss-cn-shanghai.aliyuncs.com/download.html" target="_blank">http://cloudprint-docs-resource.oss-cn-shanghai.aliyuncs.com/download.html</a>。</li>
|
||||
<li>2. 请将打印机连接至本机。</li>
|
||||
<li>3.在下面填写菜鸟组件的地址信息(默认本机打印 ws://localhost:13528)。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body kdniao">
|
||||
<div class="desc">
|
||||
本地打印机名称(供快递鸟电子面单使用)。<br>
|
||||
1. 请将打印机连接至本机。<br>
|
||||
2. 在本机上安装打印控件。下载链接:<a href="http://www.kdniao.com/documents-instrument" target="_blank">http://www.kdniao.com/documents-instrument</a>。
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">本地打印机名称:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="kdniao_port" value="{$config_info.kdniao_port}" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="layui-form-item">-->
|
||||
<!--<label class="layui-form-label">IP端口:</label>-->
|
||||
<!--<div class="layui-input-inline">-->
|
||||
<!--<input type="text" name="kdniao_port" value="{$config_info.kdniao_port}" class="layui-input len-long">-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body cainiao">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">菜鸟组件IP:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="cainiao_ip" value="{$config_info.cainiao_ip}" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="single-filter-box">
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var type = "{$config_info.type}";
|
||||
if(type == 'kdniao'){
|
||||
$('.kdniao').show();
|
||||
$('.cainiao').hide();
|
||||
}else{
|
||||
$('.kdniao').hide();
|
||||
$('.cainiao').show();
|
||||
}
|
||||
|
||||
layui.use(['form'], function() {
|
||||
var form = layui.form,
|
||||
repeat_flag = false; //防重复标识
|
||||
|
||||
form.render();
|
||||
|
||||
form.verify({
|
||||
rate: function(value){
|
||||
if(value > 100 || value < 0 || value%1 != 0){
|
||||
return '请填写0-100的整数';
|
||||
}
|
||||
},
|
||||
flo: function (value) {
|
||||
if (value == '') {
|
||||
return;
|
||||
}
|
||||
var reg = /^(0|[1-9]\d*)(\s|$|\.\d{1,2}\b)/;
|
||||
if (!reg.test(value)) {
|
||||
return '价格不能小于0,可保留两位小数!'
|
||||
}
|
||||
},
|
||||
check_num:function(value){
|
||||
if($("input[name='min_withdraw']").val() > value){
|
||||
return '最小提现金额不能大于最大提现金额!';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//类型切换
|
||||
form.on('radio(type)', function(data) {
|
||||
var type = data.value;
|
||||
if(type == 'kdniao'){
|
||||
$('.kdniao').show();
|
||||
$('.cainiao').hide();
|
||||
}else{
|
||||
$('.kdniao').hide();
|
||||
$('.cainiao').show();
|
||||
}
|
||||
});
|
||||
|
||||
form.on('submit(save)', function(data) {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
|
||||
field = data.field;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
url: ns.url("electronicsheet://shop/config/config"),
|
||||
data: field,
|
||||
success: function(res) {
|
||||
layer.msg(res.message);
|
||||
repeat_flag = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
223
addon/electronicsheet/shop/view/electronicsheet/add.html
Executable file
223
addon/electronicsheet/shop/view/electronicsheet/add.html
Executable file
@@ -0,0 +1,223 @@
|
||||
<div class="layui-collapse tips-wrap">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示</h2>
|
||||
<ul class="layui-colla-content layui-show">
|
||||
<li>管理员可以在此页添加电子面单模板</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form form-wrap">
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">基础设置</span>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="required">*</span>电子面单名称:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" value="" name="template_name" lay-verify="required" autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item express_company">
|
||||
<label class="layui-form-label"><span class="required">*</span>快递公司:</label>
|
||||
<div class="layui-input-block len-short">
|
||||
<select name="company_id" lay-verify="required" lay-filter="company_id">
|
||||
<option value="">请选择</option>
|
||||
{foreach $company_list as $v}
|
||||
<option value="{$v.company_id}" class="company_id_{$v.company_id}" data-value="{$v.print_style}">{$v.company_name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item print_style"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">其他设置</span>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">CustomerName:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" value="" name="customer_name" autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">CustomerPwd:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" value="" name="customer_pwd" autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">SendSite:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" value="" name="send_site" autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">SendStaff:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" value="" name="send_staff" autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">MonthCode:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" value="" name="month_code" autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">邮费支付方式:</label>
|
||||
<div class="layui-input-block len-short">
|
||||
<select name="postage_payment_method">
|
||||
<option value="">请选择</option>
|
||||
<option value="1">现付</option>
|
||||
<option value="2">到付</option>
|
||||
<option value="3">月结</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否上门揽件:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="radio" name="is_notice" value="1" title="是" checked="">
|
||||
<input type="radio" name="is_notice" value="0" title="否">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否默认:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="radio" name="is_default" value="1" title="是" checked="">
|
||||
<input type="radio" name="is_default" value="0" title="否">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="backElectronicSheetList()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['form'], function() {
|
||||
var form = layui.form,
|
||||
repeat_flag = false;
|
||||
|
||||
form.render();
|
||||
|
||||
/**
|
||||
* 表单验证
|
||||
*/
|
||||
form.verify({
|
||||
time: function(value) {
|
||||
var now_time = (new Date()).getTime();
|
||||
var start_time = (new Date($("#start_time").val())).getTime();
|
||||
var end_time = (new Date(value)).getTime();
|
||||
if (now_time > end_time) {
|
||||
return '结束时间不能小于当前时间!'
|
||||
}
|
||||
if (start_time > end_time) {
|
||||
return '结束时间不能小于开始时间!';
|
||||
}
|
||||
},
|
||||
flnum: function(value) {
|
||||
var arrMen = value.split(".");
|
||||
var val = 0;
|
||||
if (arrMen.length == 2) {
|
||||
val = arrMen[1];
|
||||
}
|
||||
if (val.length > 2) {
|
||||
return '保留小数点后两位!'
|
||||
}
|
||||
},
|
||||
int: function(value) {
|
||||
if (value <= 1 || value % 1 != 0) {
|
||||
return '请输入大于1的正整数!'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
form.on('select(company_id)', function(data){
|
||||
var print_style = $(".company_id_"+data.value).attr("data-value");
|
||||
|
||||
print_style = JSON.parse(print_style);
|
||||
|
||||
var html = '<div class="layui-form-item">' +
|
||||
'<label class="layui-form-label"><span class="required">*</span>模板样式:</label>' +
|
||||
'<div class="layui-input-block len-short">' +
|
||||
'<select name="print_style" lay-verify="required">' +
|
||||
'<option value="">请选择</option>';
|
||||
|
||||
for(i = 0; i < print_style.length; i ++){
|
||||
html += '<option value="'+ i +'">'+ print_style[i]['template_name'] +'</option>';
|
||||
}
|
||||
|
||||
html += '</select>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
|
||||
$('.print_style').html(html);
|
||||
form.render();
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* 表单提交
|
||||
*/
|
||||
form.on('submit(save)', function(data){
|
||||
|
||||
if(repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
url: ns.url("electronicsheet://shop/electronicsheet/add"),
|
||||
data: data.field,
|
||||
async: false,
|
||||
success: function(res){
|
||||
repeat_flag = false;
|
||||
|
||||
if (res.code == 0) {
|
||||
layer.confirm('添加成功', {
|
||||
title:'操作提示',
|
||||
btn: ['返回列表', '继续添加'],
|
||||
closeBtn: 0,
|
||||
yes: function(index, layero) {
|
||||
location.hash = ns.hash("electronicsheet://shop/electronicsheet/lists");
|
||||
layer.close(index);
|
||||
},
|
||||
btn2: function(index, layero) {
|
||||
listenerHash(); // 刷新页面
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.msg(res.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
function backElectronicSheetList() {
|
||||
location.hash = ns.hash("electronicsheet://shop/electronicsheet/lists");
|
||||
}
|
||||
</script>
|
||||
244
addon/electronicsheet/shop/view/electronicsheet/edit.html
Executable file
244
addon/electronicsheet/shop/view/electronicsheet/edit.html
Executable file
@@ -0,0 +1,244 @@
|
||||
<div class="layui-collapse tips-wrap">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示</h2>
|
||||
<ul class="layui-colla-content layui-show">
|
||||
<li>管理员可以在此页编辑电子面单模板</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form form-wrap">
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">基础设置</span>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="required">*</span>电子面单名称:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" value="{$electronicsheet_info.template_name}" name="template_name" lay-verify="required" autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item express_company">
|
||||
<label class="layui-form-label"><span class="required">*</span>快递公司:</label>
|
||||
<div class="layui-input-block len-short">
|
||||
<select name="company_id" lay-verify="required" lay-filter="company_id">
|
||||
<option value="">请选择</option>
|
||||
{foreach $company_list as $v}
|
||||
<option value="{$v.company_id}" class="company_id_{$v.company_id}" data-value="{$v.print_style}" {if $electronicsheet_info.company_id == $v.company_id} selected {/if}>{$v.company_name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item print_style"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">其他设置</span>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">CustomerName:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" value="{$electronicsheet_info.customer_name}" name="customer_name" autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">CustomerPwd:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" value="{$electronicsheet_info.customer_pwd}" name="customer_pwd" autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">SendSite:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" value="{$electronicsheet_info.send_site}" name="send_site" autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">SendStaff:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" value="{$electronicsheet_info.send_staff}" name="send_staff" autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">MonthCode:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" value="{$electronicsheet_info.month_code}" name="month_code" autocomplete="off" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">邮费支付方式:</label>
|
||||
<div class="layui-input-block len-short">
|
||||
<select name="postage_payment_method">
|
||||
<option value="">请选择</option>
|
||||
<option value="1" {if $electronicsheet_info.postage_payment_method == 1} selected {/if}>现付</option>
|
||||
<option value="2" {if $electronicsheet_info.postage_payment_method == 2} selected {/if}>到付</option>
|
||||
<option value="3" {if $electronicsheet_info.postage_payment_method == 3} selected {/if}>月结</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否上门揽件:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="radio" name="is_notice" value="1" title="是" {if $electronicsheet_info.is_notice == 1} checked {/if}>
|
||||
<input type="radio" name="is_notice" value="0" title="否" {if $electronicsheet_info.is_notice == 0} checked {/if}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否默认:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="radio" name="is_default" value="1" title="是" {if $electronicsheet_info.is_default == 1} checked {/if}>
|
||||
<input type="radio" name="is_default" value="0" title="否" {if $electronicsheet_info.is_default == 0} checked {/if}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="id" value="{$electronicsheet_info.id}">
|
||||
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="backElectronicSheetList()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['form'], function() {
|
||||
var form = layui.form,
|
||||
repeat_flag = false;
|
||||
|
||||
var print_style = '{$electronicsheet_info.print_style}';
|
||||
var company_id = '{$electronicsheet_info.company_id}';
|
||||
var print_style_data = $('.company_id_'+company_id).attr('data-value') || '{}';
|
||||
print_style_data = JSON.parse(print_style_data);
|
||||
|
||||
var html = '<div class="layui-form-item">' +
|
||||
'<label class="layui-form-label"><span class="required">*</span>模板样式:</label>' +
|
||||
'<div class="layui-input-block len-short">' +
|
||||
'<select name="print_style" lay-verify="required">' +
|
||||
'<option value="">请选择</option>';
|
||||
|
||||
for(i = 0; i < print_style_data.length; i ++){
|
||||
if(i == print_style){
|
||||
html += '<option value="'+ i +'" selected>'+ print_style_data[i]['template_name'] +'</option>';
|
||||
}else{
|
||||
html += '<option value="'+ i +'">'+ print_style_data[i]['template_name'] +'</option>';
|
||||
}
|
||||
}
|
||||
|
||||
html += '</select>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
|
||||
$('.print_style').html(html);
|
||||
|
||||
form.render();
|
||||
|
||||
/**
|
||||
* 表单验证
|
||||
*/
|
||||
form.verify({
|
||||
time: function(value) {
|
||||
var now_time = (new Date()).getTime();
|
||||
var start_time = (new Date($("#start_time").val())).getTime();
|
||||
var end_time = (new Date(value)).getTime();
|
||||
if (now_time > end_time) {
|
||||
return '结束时间不能小于当前时间!'
|
||||
}
|
||||
if (start_time > end_time) {
|
||||
return '结束时间不能小于开始时间!';
|
||||
}
|
||||
},
|
||||
flnum: function(value) {
|
||||
var arrMen = value.split(".");
|
||||
var val = 0;
|
||||
if (arrMen.length == 2) {
|
||||
val = arrMen[1];
|
||||
}
|
||||
if (val.length > 2) {
|
||||
return '保留小数点后两位!'
|
||||
}
|
||||
},
|
||||
int: function(value) {
|
||||
if (value <= 1 || value % 1 != 0) {
|
||||
return '请输入大于1的正整数!'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
form.on('select(company_id)', function(data){
|
||||
var print_style = $(".company_id_"+data.value).attr("data-value");
|
||||
|
||||
print_style = JSON.parse(print_style);
|
||||
|
||||
var html = '<div class="layui-form-item">' +
|
||||
'<label class="layui-form-label"><span class="required">*</span>模板样式:</label>' +
|
||||
'<div class="layui-input-block len-short">' +
|
||||
'<select name="print_style" lay-verify="required">' +
|
||||
'<option value="">请选择</option>';
|
||||
|
||||
for(i = 0; i < print_style.length; i ++){
|
||||
html += '<option value="'+ i +'">'+ print_style[i]['template_name'] +'</option>';
|
||||
}
|
||||
|
||||
html += '</select>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
|
||||
$('.print_style').html(html);
|
||||
form.render();
|
||||
});
|
||||
|
||||
/**
|
||||
* 表单提交
|
||||
*/
|
||||
form.on('submit(save)', function(data){
|
||||
if(repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
url: ns.url("electronicsheet://shop/electronicsheet/edit"),
|
||||
data: data.field,
|
||||
async: false,
|
||||
success: function(res){
|
||||
repeat_flag = false;
|
||||
|
||||
if (res.code == 0) {
|
||||
layer.confirm('编辑成功', {
|
||||
title:'操作提示',
|
||||
btn: ['返回列表', '继续编辑'],
|
||||
yes: function(index, layero) {
|
||||
location.hash = ns.hash("electronicsheet://shop/electronicsheet/lists");
|
||||
layer.close(index);
|
||||
},
|
||||
btn2: function(index, layero) {
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.msg(res.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
function backElectronicSheetList() {
|
||||
location.hash = ns.hash("electronicsheet://shop/electronicsheet/lists");
|
||||
}
|
||||
</script>
|
||||
224
addon/electronicsheet/shop/view/electronicsheet/lists.html
Executable file
224
addon/electronicsheet/shop/view/electronicsheet/lists.html
Executable file
@@ -0,0 +1,224 @@
|
||||
<div class="single-filter-box">
|
||||
<button class="layui-btn" onclick="add()">添加电子面单模板</button>
|
||||
</div>
|
||||
|
||||
<div class="screen layui-collapse" lay-filter="selection_panel">
|
||||
<div class="layui-colla-item">
|
||||
<form class="layui-colla-content layui-form layui-show">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">模板名称:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="template_name" placeholder="请输入模板名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<button type="button" class="layui-btn" lay-filter="search" lay-submit>筛选</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-tab table-tab" lay-filter="electronicsheet_tab">
|
||||
<div class="layui-tab-content">
|
||||
<!-- 列表 -->
|
||||
<table id="electronicsheet_list" lay-filter="electronicsheet_list"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 商品 -->
|
||||
<script type="text/html" id="goods">
|
||||
<div class="table-title">
|
||||
<div class="title-pic">
|
||||
{{# if(d.goods_image){ }}
|
||||
<img layer-src src="{{ns.img(d.goods_image.split(',')[0],'small')}}"/>
|
||||
{{# } }}
|
||||
</div>
|
||||
<div class="title-content">
|
||||
<a href="javascript:;" class="multi-line-hiding text-color" title="{{d.goods_name}}">{{d.goods_name}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- 时间 -->
|
||||
<script id="time" type="text/html">
|
||||
<div class="layui-elip">开始:{{ns.time_to_date(d.start_time)}}</div>
|
||||
<div class="layui-elip">结束:{{ns.time_to_date(d.end_time)}}</div>
|
||||
</script>
|
||||
|
||||
<!-- 状态 -->
|
||||
<script type="text/html" id="status">
|
||||
{{# if(d.status == 1){ }}
|
||||
未开始
|
||||
{{# }else if(d.status == 2){ }}
|
||||
进行中
|
||||
{{# }else if(d.status == 3){ }}
|
||||
已结束
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<!-- 操作 -->
|
||||
<script type="text/html" id="operation">
|
||||
<div class="table-btn">
|
||||
<a class="layui-btn" lay-event="edit">编辑</a>
|
||||
{{# if(d.is_default != 1){ }}
|
||||
<a class="layui-btn" lay-event="default">设置默认</a>
|
||||
{{# } }}
|
||||
<a class="layui-btn" lay-event="del">删除</a>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
layui.use(['form', 'element'], function() {
|
||||
var table,
|
||||
form = layui.form,
|
||||
element = layui.element,
|
||||
repeat_flag = false; //防重复标识
|
||||
form.render();
|
||||
|
||||
table = new Table({
|
||||
elem: '#electronicsheet_list',
|
||||
url: ns.url("electronicsheet://shop/electronicsheet/lists"),
|
||||
cols: [
|
||||
[{
|
||||
'field':'template_name',
|
||||
title: '模板名称',
|
||||
unresize: 'false'
|
||||
}, {
|
||||
field: 'company_name',
|
||||
title: '快递公司',
|
||||
unresize: 'false'
|
||||
}, {
|
||||
field: 'is_default',
|
||||
title: '是否默认',
|
||||
unresize: 'false',
|
||||
templet: function(data) {
|
||||
if(data.is_default == 1){
|
||||
return '是';
|
||||
}else{
|
||||
return '否';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
title: '操作',
|
||||
toolbar: '#operation',
|
||||
unresize: 'false',
|
||||
align:'right'
|
||||
}]
|
||||
]
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* 搜索功能
|
||||
*/
|
||||
form.on('submit(search)', function(data) {
|
||||
table.reload({
|
||||
page: {
|
||||
curr: 1
|
||||
},
|
||||
where: data.field
|
||||
});
|
||||
});
|
||||
|
||||
//监听Tab切换
|
||||
element.on('tab(status)', function(data) {
|
||||
var status = $(this).attr("data-status");
|
||||
table.reload({
|
||||
page: {
|
||||
curr: 1
|
||||
},
|
||||
where: {
|
||||
'status': status
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* 监听工具栏操作
|
||||
*/
|
||||
table.tool(function(obj) {
|
||||
var data = obj.data;
|
||||
switch (obj.event) {
|
||||
case 'edit': //编辑
|
||||
location.hash = ns.hash("electronicsheet://shop/electronicsheet/edit", {"id": data.id});
|
||||
break;
|
||||
case 'del': //删除
|
||||
deleteElectronicsheet(data.id);
|
||||
break;
|
||||
case 'default': //默认
|
||||
setDefaultStatus(data.id);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
function deleteElectronicsheet(id) {
|
||||
layer.confirm('确定要删除该电子面单模板吗?', function(index) {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
layer.close(index);
|
||||
|
||||
$.ajax({
|
||||
url: ns.url("electronicsheet://shop/electronicsheet/delete"),
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
dataType: 'JSON',
|
||||
type: 'POST',
|
||||
success: function(res) {
|
||||
layer.msg(res.message);
|
||||
repeat_flag = false;
|
||||
if (res.code == 0) {
|
||||
table.reload({
|
||||
page: {
|
||||
curr: 1
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}, function() {
|
||||
layer.close();
|
||||
repeat_flag = false;
|
||||
});
|
||||
}
|
||||
|
||||
//默认
|
||||
function setDefaultStatus(id) {
|
||||
|
||||
layer.confirm('您确认设为默认模版吗?', function(index) {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
layer.close(index);
|
||||
|
||||
$.ajax({
|
||||
url: ns.url("electronicsheet://shop/electronicsheet/setdefaultstatus"),
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
dataType: 'JSON',
|
||||
type: 'POST',
|
||||
success: function(res) {
|
||||
layer.msg(res.message);
|
||||
repeat_flag = false;
|
||||
if (res.code == 0) {
|
||||
table.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, function() {
|
||||
layer.close();
|
||||
repeat_flag = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function add() {
|
||||
location.hash = ns.hash("electronicsheet://shop/electronicsheet/add");
|
||||
}
|
||||
</script>
|
||||
BIN
addon/electronicsheet/shop/view/public/img/distribution_new.png
Executable file
BIN
addon/electronicsheet/shop/view/public/img/distribution_new.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/electronicsheet/shop/view/public/img/distribution_select.png
Executable file
BIN
addon/electronicsheet/shop/view/public/img/distribution_select.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Reference in New Issue
Block a user