Răsfoiți Sursa

新增打包规格,产品规格关联

dong025 1 zi în urmă
părinte
comite
0e4d0188fa

+ 3 - 1
.gitignore

@@ -5,4 +5,6 @@
 /.vscode
 vendor.zip
 public/.htaccess
-public/nginx.htaccess
+public/nginx.htaccess
+config/nginx.htaccess
+config/.htaccess

+ 18 - 3
app/admin/command/FengSu.php

@@ -93,7 +93,7 @@ class FengSu extends Command
                 "sort": "CONSIGN_TIME",
                 "sortAsc": false,
                 "current": 1,
-                "size": 1,
+                "size": 50,
                 "tradeStatus": 2,
                 "fromAccountId": [],
                 "goodType": 2,
@@ -120,15 +120,22 @@ class FengSu extends Command
         $productConfig = new ProductConfig();
         $shopDelivery = new ShopDelivery();
         $customerSpec = new CustomerSpec();
+        $shopDelivery_list=[];
+
         foreach($order_list as $item) {
            $goods_id=$item['tradeOrderPrintVos'][0]['goodsId'];
             $oid=$item['tradeOrderPrintVos'][0]['oid'];
+            $sku_id=$item['tradeOrderPrintVos'][0]['skuId'];
             $waybill_no=$item['waybillNo'];
             if(empty($waybill_no)) continue;
-            $add_status = JuShuiTanService::prevent_duplicate_additions($oid,$waybill_no);
+            $add_status = JuShuiTanService::prevent_duplicate_additions($sku_id,$waybill_no);
             if($add_status) continue;
-            $status = FengsuService::getAdditionalPrice( $shopList, $importSku, $productConfig, $shopDelivery, $customerSpec, $item);
+            // $status = FengsuService::getAdditionalPrice( $shopList, $importSku, $productConfig, $shopDelivery, $customerSpec, $item);
        
+            $res = FengsuService::getAdditionalPrice($shopList, $importSku, $productConfig, $shopDelivery, $customerSpec, $item);
+            $status=$res['status'];
+            $shopDelivery_list[]=$res['shopDelivery'];
+
             $weight=$item['tradeOrderPrintVos'][0]['weight'];
             $weight=strval($weight);
             $weight=bcdiv($weight, '500', 2);
@@ -137,6 +144,9 @@ class FengSu extends Command
             $price=strval($price);
             $price=bcdiv($price, '100', 2);
             $price=(float)$price;
+
+            $getPackSpecsFee = JuShuiTanService::getPackSpecsFee($importSku, $item['shopId'], $item['tradeOrderPrintVos'][0]['skuId'],$item['receiverProvince']);
+
             $queue[] = [
                 'type_id'       => $this->type_id,
                 'shop_id'       => $item['shopId'],
@@ -155,9 +165,14 @@ class FengSu extends Command
                 'weight'         =>$weight,
                 'price'         => $price,
                 'status'        => $status,
+                'pack_specs_id'        => $getPackSpecsFee['data']['id'],
+                'labor_cost_money'        => $getPackSpecsFee['data']['labor_cost_money'],
+                'one_surcharge_money'        => $getPackSpecsFee['one_surcharge_money'],
+                'two_surcharge_money'        => $getPackSpecsFee['two_surcharge_money']
             ];
         }
         // 保存到数据库
+        $shopDelivery->saveAll($shopDelivery_list);
         (new ImportList())->saveAll($queue);
         // 更新最后执行时间
         CrontabLog::create(['type_id' => 2,'last_time' => date('Y-m-d H:i:s')]);

+ 50 - 34
app/admin/command/JuShuiTan.php

@@ -1,4 +1,5 @@
 <?php
+
 /**
  * ----------------------------------------------------------------------------
  * 行到水穷处,坐看云起时
@@ -7,6 +8,7 @@
  * Author: 老成
  * email:85556713@qq.com
  */
+
 declare(strict_types=1);
 
 namespace app\admin\command;
@@ -43,7 +45,7 @@ class JuShuiTan extends Command
     ];
 
     // 打单平台 1:风速  2:聚水潭
-    protected $type_id=2;
+    protected $type_id = 2;
     // 指令配置
     protected function configure()
     {
@@ -55,18 +57,18 @@ class JuShuiTan extends Command
     {
         $output->writeln('开始同步聚水潭订单');
         $resquet = $this->getOrderList('dy');
-        if($resquet['success']){
-            if(count($resquet['data']) > 0){
+        if ($resquet['success']) {
+            if (count($resquet['data']) > 0) {
                 $list = $resquet['data'];
                 // dump($list);
                 // return;
                 $this->insertOrder($list);
                 //dump($resquet);
-            }else{
+            } else {
                 $output->writeln('没有数据');
             }
-        }else{
-            $output->writeln('接口错误: ' .$resquet['message']);
+        } else {
+            $output->writeln('接口错误: ' . $resquet['message']);
         }
 
         $output->writeln('ok');
@@ -82,25 +84,25 @@ class JuShuiTan extends Command
 
         $headers = [
             'Accept' => ' application/json, text/plain, */*',
-            'Authorization' =>site_config('addonsd.ju_shui_tan_authorization_toke'),
+            'Authorization' => site_config('addonsd.ju_shui_tan_authorization_toke'),
             'Content-Type' => ' application/json'
         ];
-        $todayTime=date("Y-m-d");
-        
+        $todayTime = date("Y-m-d");
+
         $startTime = strtotime($todayTime . ' 00:00:00');
-        $startTime=date('Y-m-d H:i:s', $startTime);
+        $startTime = date('Y-m-d H:i:s', $startTime);
         // $startTime='2025-01-01 08:59:21';
         $endTime = strtotime($todayTime . ' 23:59:59');
-        $endTime=date('Y-m-d H:i:s', $endTime);
+        $endTime = date('Y-m-d H:i:s', $endTime);
         $body = '{
-            "startTime": "'.$startTime.'",
-            "endTime": "'.$endTime.'",
+            "startTime": "' . $startTime . '",
+            "endTime": "' . $endTime . '",
             "dateQueryType": "DeliveryDate",
             "coId": "14792222",
             "uid": "21943091",
             "upSendFailed": false,
             "isExceptAddress": "Except",
-            "pageNum": 2,
+            "pageNum": 1,
             "pageSize": 50,
             "searchType": 1,
             "orderStatus": [
@@ -112,16 +114,16 @@ class JuShuiTan extends Command
         $request = new Request('POST', 'https://innerapi.scm121.com/api/inner/supOrder/getErpNormalOrders', $headers, $body);
         $res = $client->sendAsync($request)->wait();
         $json = [];
-        if($res->getStatusCode() == 200) {
+        if ($res->getStatusCode() == 200) {
             $json = json_decode($res->getBody()->getContents(), true);
-        }else{
+        } else {
             dump($res->getStatusCode(), '接口返回结果');
         }
         return $json;
     }
     public function insertOrder($order_list)
     {
-        if(!(count($order_list) > 0)){
+        if (!(count($order_list) > 0)) {
             return false;
         }
         $queue = [];
@@ -130,30 +132,39 @@ class JuShuiTan extends Command
         $productConfig = new ProductConfig();
         $shopDelivery = new ShopDelivery();
         $customerSpec = new CustomerSpec();
-        
-        usort($order_list, function($a, $b) {
+
+        usort($order_list, function ($a, $b) {
             // 将create_time转换为时间戳比较(支持字符串时间戳)
             $timeA = strtotime($a['deliveryDate']);
             $timeB = strtotime($b['deliveryDate']);
-            
+
             // 降序排序(从新到旧)
             // return $timeB - $timeA;
-            
+
             // 升序排序(从旧到新)可改为:
             return $timeA - $timeB;
         });
-        foreach($order_list as $item) {
+        $shopDelivery_list=[];
+        foreach ($order_list as $item) {
             // dump($item['shopId'], '店铺id');
             // 防止重复记录,订单号+快递单号
-            $goods_id=$item['disInnerOrderGoodsViewList'][0]['shopIid'];
-            
-            $oid=$item['oid'];
-            // $waybill_no=ltrim($item['trackNo'], '@');
-            $waybill_no=$item['trackNo'];
-            if(empty($waybill_no)) continue;
-            $add_status = JuShuiTanService::prevent_duplicate_additions($oid,$waybill_no);
-            if($add_status) continue;
-            $status = JuShuiTanService::getAdditionalPrice( $shopList, $importSku, $productConfig, $shopDelivery, $customerSpec, $item);
+            $goods_id = $item['disInnerOrderGoodsViewList'][0]['shopIid'];
+
+            $oid = $item['oid'];
+            $sku_id=$item['disInnerOrderGoodsViewList'][0]['shopSkuId'];
+            $waybill_no = ltrim($item['trackNo'], '@');
+            // $waybill_no=$item['trackNo'];
+            if (empty($waybill_no)) continue;
+            $add_status = JuShuiTanService::prevent_duplicate_additions($sku_id, $waybill_no);
+            if ($add_status) continue;
+            // $status = JuShuiTanService::getAdditionalPrice($shopList, $importSku, $productConfig, $shopDelivery, $customerSpec, $item);
+            $res = JuShuiTanService::getAdditionalPrice($shopList, $importSku, $productConfig, $shopDelivery, $customerSpec, $item);
+           
+            $status=$res['status'];
+            $shopDelivery_list[]=$res['shopDelivery'];
+
+            $getPackSpecsFee = JuShuiTanService::getPackSpecsFee($importSku, $item['shopId'], $item['disInnerOrderGoodsViewList'][0]['shopSkuId'], $item['receiverState']);
+
             $queue[] = [
                 'type_id'       => $this->type_id,
                 'shop_id'       => $item['shopId'],
@@ -172,12 +183,17 @@ class JuShuiTan extends Command
                 'weight'         => $item['weight'],
                 'price'         => bcdiv((string)$item['disInnerOrderGoodsViewList'][0]['price'], '1', 2),
                 'status'        => $status,
+                'pack_specs_id'        => $getPackSpecsFee['data']['id'],
+                'labor_cost_money'        => $getPackSpecsFee['data']['labor_cost_money'],
+                'one_surcharge_money'        => $getPackSpecsFee['one_surcharge_money'],
+                'two_surcharge_money'        => $getPackSpecsFee['two_surcharge_money']
             ];
+            
         }
-
         // 保存到数据库
+        $shopDelivery->saveAll($shopDelivery_list);
         (new ImportList())->saveAll($queue);
         // 更新最后执行时间
-        CrontabLog::create(['type_id' => 2,'last_time' => date('Y-m-d H:i:s')]);
+        CrontabLog::create(['type_id' => 2, 'last_time' => date('Y-m-d H:i:s')]);
     }
-}
+}

+ 70 - 37
app/admin/controller/goods/ImportList.php

@@ -18,6 +18,7 @@ use app\common\model\CustomerSpec;
 use app\common\model\ProductConfig;
 use app\common\model\ImportList as ImportListModel;
 use app\common\model\ShopList as ShopListModel;
+
 #[Group("goods/import_list")]
 class ImportList extends Backend
 {
@@ -35,6 +36,23 @@ class ImportList extends Backend
         $this->assign('typeList',  StockConfig::where('type_id', 'variety_name')->order('sort desc')->column('title', 'id'));
         $this->assign('packingList', StockConfig::where('type_id', 'packing_box')->column('title', 'id'));
     }
+    // 获取店铺
+    #[Route('GET,POST,JSON', 'getShopList')]
+    public function getShopList()
+    {
+        $shopList = new ShopList();
+        $sql_restul = $shopList->alias('s')
+            ->join("yun_customer c", "s.customer_id = c.id", "INNER")
+            ->where(['s.status' => 1, 'c.status' => 1])
+            ->field(['s.id','s.shop_id', 's.name', 'c.name' => 'nickname'])
+            ->select();
+        $arr = [];
+        foreach ($sql_restul as $item) {
+            $arr[$item['id']] = $item['name'] .'('.'店铺id:'.$item['shop_id'].',客户:' . $item['nickname'] . ')';
+        }
+
+        return $this->jsonSuccess('', $arr);
+    }
 
     /**
      * 查看
@@ -49,7 +67,7 @@ class ImportList extends Backend
             return $this->selectpage();
         }
         [$where, $order, $limit, $with] = $this->buildparams();
-        
+
         $list = $this->model
             ->withJoin($with, 'left')
             //如果没有使用operate filter过滤的情况下,推荐使用with关联,可以提高查询效率
@@ -58,25 +76,25 @@ class ImportList extends Backend
             ->order($order)
             ->paginate($limit)
             ->each(function ($item, $key) {
-                if(empty($item['type_id'])){
-                    $item['type_id']=0;
+                if (empty($item['type_id'])) {
+                    $item['type_id'] = 0;
                 }
-                $trade_from_list=[];
-                if($item['type_id']==1){
-                    $feng_su_trade_from_list=site_config("addonsd.feng_su_trade_from_list");
-                    $trade_from_list=$feng_su_trade_from_list;
-                }else{
-                    $ju_shui_tan_trade_from_list=site_config("addonsd.ju_shui_tan_trade_from_list");
-                    $trade_from_list=$ju_shui_tan_trade_from_list;
+                $trade_from_list = [];
+                if ($item['type_id'] == 1) {
+                    $feng_su_trade_from_list = site_config("addonsd.feng_su_trade_from_list");
+                    $trade_from_list = $feng_su_trade_from_list;
+                } else {
+                    $ju_shui_tan_trade_from_list = site_config("addonsd.ju_shui_tan_trade_from_list");
+                    $trade_from_list = $ju_shui_tan_trade_from_list;
                 }
-                
-                
-                $trade_from=$item['trade_from'];
-                $trade_from=isset($trade_from_list[$trade_from])?$trade_from_list[$trade_from]:$item['trade_from'];
-                $item['trade_from']=$trade_from;
+
+
+                $trade_from = $item['trade_from'];
+                $trade_from = isset($trade_from_list[$trade_from]) ? $trade_from_list[$trade_from] : $item['trade_from'];
+                $item['trade_from'] = $trade_from;
                 // $item['trade_from']=empty($item['trade_from'])?'无':$trade_from_list[$trade_from];
-                
-                
+
+
                 return $item;
             });
         $result = ['total' => $list->total(), 'rows' => $list->items()];
@@ -91,27 +109,27 @@ class ImportList extends Backend
     {
         if (false === $this->request->isPost()) {
             $ids = $this->request->get('ids/s', '');
-            $shopList=new ShopList();
-            $sql_restul=$shopList->alias('s')
+            $shopList = new ShopList();
+            $sql_restul = $shopList->alias('s')
                 ->join("yun_customer c", "s.customer_id = c.id", "INNER")
                 ->where(['s.status' => 1, 'c.status' => 1])
-                ->field(['s.id','s.name','c.name'=>'nickname'])
+                ->field(['s.id','s.shop_id', 's.name', 'c.name' => 'nickname'])
                 ->select();
-            $arr=[];
+            $arr = [];
             foreach ($sql_restul as $item) {
-                $arr[$item['id']]=$item['name'].'(客户:'.$item['nickname'].')';
+                $arr[$item['id']] = $item['name'] .'('.'店铺id:'.$item['shop_id'].',客户:' . $item['nickname'] . ')';
             }
-                
-            $this->assign('shopList',$arr );
+
+            $this->assign('shopList', $arr);
             return $this->fetch();
         }
         $params = array_merge($this->request->post("row/a"), $this->postParams);
         if (empty($params)) {
             $this->error(__('提交的参数不能为空'));
         }
-        if (!$this->request->checkToken('__token__', ['__token__' => $this->request->post('__token__')])) {
-            $this->error(__('token错误,请刷新页面重试'));
-        }
+        // if (!$this->request->checkToken('__token__', ['__token__' => $this->request->post('__token__')])) {
+        //     $this->error(__('token错误,请刷新页面重试'));
+        // }
         foreach ($params as &$value) {
             if (is_array($value)) {
                 $value = implode(',', $value);
@@ -165,11 +183,11 @@ class ImportList extends Backend
             }
         }
         if (false === $this->request->isPost()) {
-            $shop_id=$row['shop_id'];
-            $shopListModel=new ShopListModel();
-            
+            $shop_id = $row['shop_id'];
+            $shopListModel = new ShopListModel();
+
             $rows = $shopListModel::where('shop_id', $shop_id)->where('status', 1)->find();
-            $this->assign('rows', $rows->type_spec??'');
+            $this->assign('rows', $rows->type_spec ?? '');
             $this->assign('row', $row);
             return $this->fetch();
         }
@@ -189,24 +207,39 @@ class ImportList extends Backend
             $shopDelivery = new ShopDelivery();
             $customerSpec = new CustomerSpec();
             $importSku = new ImportSku();
+            $shopDelivery_list=[];
+            $import_list=[];
             foreach ($list as $item) {
                 //插入发货数据
-                JuShuiTanService::setAdditionalPrice(
+                $res=JuShuiTanService::setAdditionalPrice(
                     $importSku,
                     $shopList,
                     $productConfig,
                     $shopDelivery,
                     $customerSpec,
-                    $row['shop_id'],
-                    $row['sku_id'],
+                    $item['shop_id'],
+                    $item['sku_id'],
                     $params['all_data'][0]['type_id'],
                     $params['all_data'][0]['id'],
                     $params['all_data'][0]['name'],
-                    $row
+                    $item
                 );
-
-                $count += $item->save(['status' => 3]);
+                $getPackSpecsFee=$res['getPackSpecsFee'];
+                $shopDelivery_list[]=$res['shopDelivery'];
+                $import_list_item=[
+                    'id'=>$item['id'],
+                    'pack_specs_id'=>$getPackSpecsFee['data']['id'],
+                    'labor_cost_money'=>$getPackSpecsFee['data']['labor_cost_money'],
+                    'one_surcharge_money'=>$getPackSpecsFee['one_surcharge_money'],
+                    'two_surcharge_money'=>$getPackSpecsFee['two_surcharge_money'],
+                    'status' => 3
+                ];
+                $import_list[]=$import_list_item;
+                $count++;
+                // $count += $item->save(['pack_specs_id'=>$getPackSpecsFee['data']['id'],'labor_cost_money'=>$getPackSpecsFee['data']['labor_cost_money'],'one_surcharge_money'=>$getPackSpecsFee['one_surcharge_money'],'two_surcharge_money'=>$getPackSpecsFee['two_surcharge_money'],'status' => 3]);
             }
+            $this->model->saveAll($import_list);
+            $shopDelivery->saveAll($shopDelivery_list);
             if ($this->callback) {
                 $callback = $this->callback;
                 $callback($ids);

+ 100 - 0
app/admin/controller/goods/PackSpecs.php

@@ -0,0 +1,100 @@
+<?php
+declare (strict_types = 1);
+
+namespace app\admin\controller\goods;
+
+use app\common\controller\Backend;
+use app\admin\traits\Actions;
+use think\annotation\route\Group;
+use think\annotation\route\Route;
+use app\common\model\PackSpecs as PackSpecsModel;
+
+#[Group("goods/pack_specs")]
+class PackSpecs extends Backend
+{
+    use Actions;
+
+    protected function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new PackSpecsModel();
+    }
+
+
+    /**
+     * 查看
+     */
+    #[Route('GET,JSON', 'index')]
+    public function index()
+    {
+        if (false === $this->request->isAjax()) {
+            return $this->fetch();
+        }
+        if ($this->request->post('selectpage')) {
+            return $this->selectpage();
+        }
+        [$where, $order, $limit, $with] = $this->buildparams();
+        
+        $list = $this->model
+            ->withJoin($with, 'left')
+            //如果没有使用operate filter过滤的情况下,推荐使用with关联,可以提高查询效率
+            //->with($with)
+            ->where($where)
+            ->order($order)
+            ->paginate($limit);
+        $result = ['total' => $list->total(), 'rows' => $list->items()];
+        return json($result);
+    }
+    //添加
+    #[Route("GET,POST","add")]
+    public function add()
+    {
+        if (false === $this->request->isPost()) {
+            return $this->fetch();
+        }
+        $params = $this->request->post("row/a");
+        if (empty($params)) {
+            return $this->jsonError('提交的参数不能为空');
+        }
+        $result=$this->model->save($params);
+        if ($result === false) {
+            return $this->jsonError('没有新增任何数据');
+        }
+        return $this->jsonSuccess();
+        
+    }
+
+    //添加
+    #[Route("GET,POST","edit")]
+    public function edit(mixed $row=null)
+    {
+        $ids = $this->request->get('ids');
+        if(!$row || is_array($row)){
+            $row = $this->model->find($ids);
+        }
+        if(count($this->volidateFields)>0){
+            foreach ($this->volidateFields as $field=>$value){
+                if($row[$field]!=$value){
+                    return $this->jsonError(__('没有操作权限'));
+                }
+            }
+        }
+        if (false === $this->request->isPost()) {
+            $this->assign('row', $row);
+            return $this->fetch();
+        }
+
+        $params = $this->request->post("row/a");
+        $params['updatetime']=time();
+        if (empty($params)) {
+            return $this->jsonError('提交的参数不能为空');
+        }
+        $result=$this->model->saveAll([$params]);
+        if ($result === false) {
+            return $this->jsonError('没有修改任何数据');
+        }
+        return $this->jsonSuccess();
+        
+    }
+
+}

+ 32 - 13
app/admin/controller/goods/ProductConfig.php

@@ -1,5 +1,6 @@
 <?php
-declare (strict_types = 1);
+
+declare(strict_types=1);
 
 namespace app\admin\controller\goods;
 
@@ -9,6 +10,7 @@ use think\annotation\route\Route;
 use app\admin\traits\Actions;
 use app\common\model\StockConfig;
 use app\common\model\ProductConfig as ProductConfigModel;
+use app\common\model\PackSpecs as PackSpecsModel;
 
 #[Group("goods/product_config")]
 class ProductConfig extends Backend
@@ -21,29 +23,46 @@ class ProductConfig extends Backend
         parent::_initialize();
         $this->model = new ProductConfigModel();
 
-        $this->assign('varietyList', StockConfig::where('type_id', 'variety_name')->column('title','id'));
-     
-     
+        $this->assign('varietyList', StockConfig::where('type_id', 'variety_name')->column('title', 'id'));
+        $this->assign('packSpecsList', PackSpecsModel::column('title', 'id'));
     }
 
-
-
     //删除
-    #[Route("GET","del")]
-    public function del()
+    #[Route('GET,JSON', 'index')]
+    public function index()
     {
-        return "删除";
+        if (false === $this->request->isAjax()) {
+            return $this->fetch();
+        }
+        if ($this->request->post('selectpage')) {
+            return $this->selectpage();
+        }
+        [$where, $order, $limit, $with] = $this->buildparams();
+        
+        $list = $this->model
+            ->alias('p')
+            ->leftJoin('pack_specs s',"p.pack_specs_id = s.id")
+            ->field('p.*,s.title as pack_specs_title,s.labor_cost_money,s.one_surcharge_money,s.two_surcharge_money,s.keep_warm_type,s.surcharge_money')
+            ->where($where)
+            ->order($order)
+            ->paginate($limit)
+            ->each(function ($item, $key) {
+                return $item;
+            });
+        $result = ['total' => $list->total(), 'rows' => $list->items()];
+        return json($result);
     }
-    
+
+
     //导入
-    #[Route("GET","import")]
+    #[Route("GET", "import")]
     public function import()
     {
         return "导入";
     }
-    
+
     //下载
-    #[Route("GET","download")]
+    #[Route("GET", "download")]
     public function download()
     {
         return "下载";

+ 43 - 70
app/admin/service/FengsuService.php

@@ -10,7 +10,7 @@
 declare(strict_types=1);
 namespace app\admin\service;
 
-
+use app\admin\service\JuShuiTanService;
 
 class FengsuService {
 
@@ -20,11 +20,12 @@ class FengsuService {
      * @param array $item
      * @return int
      */
-    public static function getAdditionalPrice(object $shopList, object $fengsuSku, object $productConfig, object $shopDelivery, object $customerSpec, array $item):int
+    public static function getAdditionalPrice(object $shopList, object $sku, object $productConfig, object $shopDelivery, object $customerSpec, array $item)
     {
         // dump('店铺0');
 
         $status = 1;
+        $shopDelivery=[];
         //判断是否存在店铺
         $shops = $shopList::getSpecsIdByShopId($item['shopId']);
         // dump('店铺00');
@@ -33,7 +34,7 @@ class FengsuService {
             // dump('店铺1');
 
             //判断是否存在规格-获取重量
-            $specs = $fengsuSku::getSpecsIdByShopId($shops->shop_id, $item['tradeOrderPrintVos'][0]['skuId']);
+            $specs = $sku::getSpecsIdByShopId($shops->shop_id, $item['tradeOrderPrintVos'][0]['skuId']);
             if(!$specs->isEmpty()) {
                 // dump('店铺2');
 
@@ -42,11 +43,40 @@ class FengsuService {
                 $status = 3;
                 if($weight){
                     // dump('店铺3');
+                    
+                    $other_price = JuShuiTanService::getRemoteAreaFee($item['tradeOrderPrintVos'][0]['companyName'],  $weight, $item['receiverProvince'], $item['receiverCity']);
+                    
+                    // 保温加收价格
+                    $getPackSpecsFee=JuShuiTanService::getPackSpecsFee($sku,$item['shopId'], $item['tradeOrderPrintVos'][0]['skuId'],$item['receiverProvince']);
+                    $pack_specs=strval($getPackSpecsFee['surcharge_money']);
+
+                    $other_price=(string)$other_price;
+                    $other_price=strval($other_price);
+                    $other_price=bcadd($other_price,$pack_specs, 2);
 
-                    $other_price = self::getRemoteAreaFee($item['tradeOrderPrintVos'][0]['companyName'],  $weight, $item['receiverProvince'], $item['receiverCity']);
                     //获取包装箱
                     $box = $customerSpec::getBoxId($shops->customer_id, $specs->variety_id, $specs->spec_id);
-                    $shopDelivery::create([
+                    // $shopDelivery::create([
+                    //     'customer_id' => $shops->customer_id,
+                    //     'shop_id' => $shops->id,
+                    //     'plat_id' => $shops->platform,
+                    //     'variety_id'    => $specs->variety_id,
+                    //     'spec_id'       => $specs->spec_id,
+                    //     'spec_name'     => $specs->spec_name,
+                    //     'box_id'        => $box->id??0,
+                    //     'box_name'      => $box->box_name??'',
+                    //     'variety_name'  => $box->variety_name,
+                    //     'num'           => $item['tradeOrderPrintVos'][0]['total'],
+                    //     'weigh'         => $weight,
+                    //     'price'         => $box->price??0,
+                    //     'total_price'   => bcmul($box->price, (string)$item['tradeOrderPrintVos'][0]['total'], 2),
+                    //     'company_name'  => $item['tradeOrderPrintVos'][0]['companyName'],
+                    //     'waybill_no'    => $item['waybillNo'],
+                    //     'region'        => $item['receiverProvince'].' '.$item['receiverCity'],
+                    //     'other_price'   => $other_price,
+                    //     'ship_date'     => substr($item['consignTime'], 0, 10),
+                    // ]);
+                    $shopDelivery=[
                         'customer_id' => $shops->customer_id,
                         'shop_id' => $shops->id,
                         'plat_id' => $shops->platform,
@@ -59,83 +89,26 @@ class FengsuService {
                         'num'           => $item['tradeOrderPrintVos'][0]['total'],
                         'weigh'         => $weight,
                         'price'         => $box->price??0,
-                        'total_price'   => bcmul($box->price, (string)$item['tradeOrderPrintVos'][0]['total'], 2),
+                        'total_price'   => bcmul((string)$box->price, (string)$item['tradeOrderPrintVos'][0]['total'], 2),
                         'company_name'  => $item['tradeOrderPrintVos'][0]['companyName'],
                         'waybill_no'    => $item['waybillNo'],
                         'region'        => $item['receiverProvince'].' '.$item['receiverCity'],
                         'other_price'   => $other_price,
                         'ship_date'     => substr($item['consignTime'], 0, 10),
-                    ]);
+                    ];
                 }
             }else{
                 $status = 2;
             }
         }
-        return $status;
+        // return $status;
+        $data=[
+            'shopDelivery'=>$shopDelivery,
+            'status'=>$status
+        ];
+        return $data;
     }
 
-
-    /** 编辑规格-加收价格 
-     * @param array $item
-     * @return int
-     */
-    public static function setAdditionalPrice(object $shopList, object $productConfig, object $shopDelivery, object $customerSpec, string $shop_id, $variety_id, $spec_id, string $spec_name, object $item):bool
-    {
-        //判断是否存在店铺
-        $shops = $shopList::getSpecsIdByShopId($shop_id);
-     
-        //根据规格重量获取,加收价格
-        $weight = $productConfig::getWeight((int)$spec_id);
     
-        $other_price = self::getRemoteAreaFee($item['company_name'],  $weight??0, $item['province'], $item['city']);
-        //获取包装箱
-        $box = $customerSpec::getBoxId($shops->customer_id, (int)$variety_id, (int)$spec_id);
-        $shopDelivery::create([
-            'customer_id'   => $shops->customer_id,
-            'shop_id'       => $shops->id,
-            'plat_id'       => $shops->platform,
-            'variety_id'    => $variety_id,
-            'spec_id'       => $spec_id,
-            'spec_name'     => $spec_name,
-            'box_id'        => $box->id??0,
-            'box_name'      => $box->box_name??'',
-            'variety_name'  => $box->variety_name,
-            'num'           => $item['num'],
-            'weigh'         => $weight??0,
-            'price'         => $box->price??0,
-            'total_price'   => bcmul((string)$box->price, (string)$item['num'], 2),
-            'company_name'  => $item['company_name'],
-            'waybill_no'    => $item['waybill_no'],
-            'region'        => $item['province'].' '.$item['city'],
-            'other_price'   => $other_price,
-            'ship_date'     => substr($item['consign_time'], 0, 10),
-        ]);
-        return true;
-    }
-
-    /**
-     * 获取偏远地区加收费用
-     * @param string $express 快递公司名称
-     * @param string $area 省份
-     * @param float $weight 重量
-     * @param string $city 城市
-     * @return float
-     */
-    protected static function getRemoteAreaFee(string $express, string $weight, string $area, string $city = ''){
-        $remote_area = config('app.remote_area');
-        $fee = 0;
-        if($express == '顺丰快递'){
-            if(in_array($area, $remote_area[1])) {
-                if($weight >= 3.5) $fee = 5;
-                if($weight >= 4.5) $fee = 6;
-            };
-        }else{
-            //普通(广东省-深圳) -浙江-舟山
-            if(in_array($area, $remote_area[0])) $fee = 1.5;
-            if($area == '广东省' && $city == '深圳市') $fee = 1.5;
-            if($area == '浙江省' && $city == '舟山市') $fee = 1.5;
-        }
-        return $fee;
-    }
 
 }

+ 149 - 19
app/admin/service/JuShuiTanService.php

@@ -20,15 +20,17 @@ class JuShuiTanService {
      * @param array $item
      * @return int
      */
-    public static function getAdditionalPrice(object $shopList, object $fengsuSku, object $productConfig, object $shopDelivery, object $customerSpec, array $item):int
+    public static function getAdditionalPrice(object $shopList, object $sku, object $productConfig, object $shopDelivery, object $customerSpec, array $item)
     {
         $status = 1;
+        $shopDelivery=[];
+        
         //判断是否存在店铺
         $shops = $shopList::getSpecsIdByShopId($item['shopId']);
         if(!$shops->isEmpty()){
 
             //判断是否存在规格-获取重量
-            $specs = $fengsuSku::getSpecsIdByShopId($shops->shop_id, $item['disInnerOrderGoodsViewList'][0]['shopSkuId']);
+            $specs = $sku::getSpecsIdByShopId($shops->shop_id, $item['disInnerOrderGoodsViewList'][0]['shopSkuId']);
             
             if(!$specs->isEmpty()) {
 
@@ -37,9 +39,38 @@ class JuShuiTanService {
                 $status = 3;
                 if($weight){
                     $other_price = self::getRemoteAreaFee($item['expressCompany'],  $weight, $item['receiverState'], $item['receiverCity']);
+
+                    // 保温加收价格
+                    $getPackSpecsFee=self::getPackSpecsFee($sku,$item['shopId'], $item['disInnerOrderGoodsViewList'][0]['shopSkuId'],$item['receiverState']);
+                    $pack_specs=strval($getPackSpecsFee['surcharge_money']);
+                    $other_price=(string)$other_price;
+                    $other_price=strval($other_price);
+                    $other_price=bcadd($other_price,$pack_specs, 2);
+
                     //获取包装箱
                     $box = $customerSpec::getBoxId($shops->customer_id, $specs->variety_id, $specs->spec_id);
-                    $shopDelivery::create([
+                    // $shopDelivery::create([
+                    //     'customer_id' => $shops->customer_id,
+                    //     'shop_id' => $shops->id,
+                    //     'plat_id' => $shops->platform,
+                    //     'variety_id'    => $specs->variety_id,
+                    //     'spec_id'       => $specs->spec_id,
+                    //     'spec_name'     => $specs->spec_name,
+                    //     'box_id'        => $specs->box_id??0,
+                    //     'box_name'      => $box->box_name??'',
+                    //     'variety_name'  => $box->variety_name,
+                    //     'num'           => $item['disInnerOrderGoodsViewList'][0]['itemCount'],
+                    //     'weigh'         => $weight,
+                    //     'price'         => $box->price??0,
+                    //     'total_price'   => bcmul($box->price, (string)$item['disInnerOrderGoodsViewList'][0]['itemCount'], 2),
+                    //     'company_name'  => $item['expressCompany'],
+                    //     'waybill_no'    => ltrim($item['trackNo'], '@'),
+                    //     'region'        => $item['receiverState'].' '.$item['receiverCity'],
+                    //     'other_price'   => $other_price,
+                    //     'ship_date'     => substr($item['deliveryDate'], 0, 10),
+                    //     'incubator'   => $getPackSpecsFee['pack_specs_type']
+                    // ]);
+                    $shopDelivery=[
                         'customer_id' => $shops->customer_id,
                         'shop_id' => $shops->id,
                         'plat_id' => $shops->platform,
@@ -52,19 +83,25 @@ class JuShuiTanService {
                         'num'           => $item['disInnerOrderGoodsViewList'][0]['itemCount'],
                         'weigh'         => $weight,
                         'price'         => $box->price??0,
-                        'total_price'   => bcmul($box->price, (string)$item['disInnerOrderGoodsViewList'][0]['itemCount'], 2),
+                        'total_price'   => bcmul((string)$box->price, (string)$item['disInnerOrderGoodsViewList'][0]['itemCount'], 2),
                         'company_name'  => $item['expressCompany'],
                         'waybill_no'    => ltrim($item['trackNo'], '@'),
                         'region'        => $item['receiverState'].' '.$item['receiverCity'],
                         'other_price'   => $other_price,
                         'ship_date'     => substr($item['deliveryDate'], 0, 10),
-                    ]);
+                        'incubator'   => $getPackSpecsFee['pack_specs_type']
+                    ];
                 }
             }else{
                 $status = 2;
             }
         }
-        return $status;
+        $data=[
+            'shopDelivery'=>$shopDelivery,
+            'status'=>$status
+        ];
+        return $data;
+        // return $status;
     }
 
 
@@ -72,21 +109,52 @@ class JuShuiTanService {
      * @param array $item
      * @return int
      */
-    public static function setAdditionalPrice(object $fengsuSku,object $shopList, object $productConfig, object $shopDelivery, object $customerSpec, string $shop_id,$sku_id, $variety_id, $spec_id, string $spec_name, object $item):bool
+    public static function setAdditionalPrice(object $sku,object $shopList, object $productConfig, object $shopDelivery, object $customerSpec, string $shop_id,$sku_id, $variety_id, $spec_id, string $spec_name, object $item)
     {
         //判断是否存在规格-获取重量
-        $specs = $fengsuSku::getSpecsIdByShopId($shop_id, $sku_id);
+        $specs = $sku::getSpecsIdByShopId($shop_id, $sku_id);
         //判断是否存在店铺
         $shops = $shopList::getSpecsIdByShopId($shop_id);
      
         //根据规格重量获取,加收价格
         $weight = $productConfig::getWeight((int)$spec_id);
     
-        $other_price = self::getRemoteAreaFee($item['company_name'],  $weight??0, $item['province'], $item['city']);
+        
+        $other_price =self::getRemoteAreaFee($item['company_name'],  $weight??0, $item['province'], $item['city']);
+
+        // 保温加收价格
+        $getPackSpecsFee=self::getPackSpecsFee($sku,$shop_id, $sku_id,$item['province']);
+        $pack_specs=strval($getPackSpecsFee['surcharge_money']);
+        $other_price=(string)$other_price;
+        $other_price=strval($other_price);
+        $other_price=bcadd($other_price,$pack_specs, 2);
         //获取包装箱
         $box = $customerSpec::getBoxId($shops->customer_id, (int)$variety_id, (int)$spec_id);
-        
-        $shopDelivery::create([
+        // $shopDelivery::create([
+        //     'customer_id'   => $shops->customer_id,
+        //     'shop_id'       => $shops->id,
+        //     'plat_id'       => $shops->platform,
+        //     'variety_id'    => $variety_id,
+        //     'spec_id'       => $spec_id,
+        //     'spec_name'     => $specs->spec_name,
+        //     'box_id'        => $box->id??0,
+        //     'box_name'      => $box->box_name??'',
+        //     'variety_name'  => $box->variety_name,
+        //     'num'           => $item['num'],
+        //     'weigh'         => $weight??0,
+        //     'price'         => $box->price??0,
+        //     'total_price'   => bcmul((string)$box->price, (string)$item['num'], 2),
+        //     'company_name'  => $item['company_name'],
+        //     'waybill_no'    => $item['waybill_no'],
+        //     'region'        => $item['province'].' '.$item['city'],
+        //     'other_price'   => $other_price,
+        //     'ship_date'     => substr($item['consign_time'], 0, 10),
+        //     'incubator'   => $getPackSpecsFee['pack_specs_type']
+            
+           
+            
+        // ]);
+        $shopDelivery=[
             'customer_id'   => $shops->customer_id,
             'shop_id'       => $shops->id,
             'plat_id'       => $shops->platform,
@@ -105,8 +173,16 @@ class JuShuiTanService {
             'region'        => $item['province'].' '.$item['city'],
             'other_price'   => $other_price,
             'ship_date'     => substr($item['consign_time'], 0, 10),
-        ]);
-        return true;
+            'incubator'   => $getPackSpecsFee['pack_specs_type']
+            
+           
+            
+        ];
+        $data=[
+            'shopDelivery'=>$shopDelivery,
+            'getPackSpecsFee'=>$getPackSpecsFee
+        ];
+        return $data;
     }
 
     /**
@@ -117,10 +193,13 @@ class JuShuiTanService {
      * @param string $city 城市
      * @return float
      */
-    protected static function getRemoteAreaFee(string $express, string $weight, string $area, string $city = ''){
-        $remote_area = config('app.remote_area');
+    public static function getRemoteAreaFee(string $express, string $weight, string $area, string $city = ''){
+        // $remote_area = config('app.remote_area');
+        $remote_area=[];
+        $remote_area[0]=site_config("addonsd.remote_area_0");
+        $remote_area[1]=site_config("addonsd.remote_area_1");
         $fee = 0;
-        if($express == '顺丰速运'){
+        if($express == '顺丰快递'||$express=='顺丰速运'){
             if(in_array($area, $remote_area[1])) {
                 if($weight >= 3.5) $fee = 5;
                 if($weight >= 4.5) $fee = 6;
@@ -134,14 +213,65 @@ class JuShuiTanService {
         return $fee;
     }
     //防止重复记录,订单号+快递单号
-    public static function prevent_duplicate_additions($oid,$waybill_no){
+    public static function prevent_duplicate_additions($sku_id,$waybill_no){
         $importList=new ImportList();
         $where = [
-            'order_id' => ['=', $oid],
+            'sku_id' => ['=', $sku_id],
             'waybill_no' => ['=', $waybill_no]
         ];
         $result = $importList->where($where)->count();
         return $result=$result>0?true:false;
     }
-
+    // 保温加收区域设置,加收金额
+    public static function getPackSpecsFee($sku,$shop_id,$sku_id,$province){
+        $res=[
+            'data'=>[
+                'id'=>0,
+                'labor_cost_money'=>0,
+            ],
+            'one_surcharge_money'=>0,
+            'two_surcharge_money'=>0,
+            'pack_specs_type'=>0,
+            'surcharge_money'=>0
+        ];
+        $pack_specs_one_region=site_config("addonsd.pack_specs_one_region");
+        $pack_specs_two_region=site_config("addonsd.pack_specs_two_region");
+        $pack_specs_one_type=in_array($province,$pack_specs_one_region);
+        $pack_specs_two_type=in_array($province,$pack_specs_two_region);
+        $pack_specs_type=0;
+        if($pack_specs_one_type){
+            $pack_specs_type=1;
+        }else if($pack_specs_two_type){
+            $pack_specs_type=2;
+        }
+        // if(empty($pack_specs_type))return $res;
+        $result=$sku::getPackSpecs($shop_id, $sku_id);
+        if(empty($result)) return $res;
+        $surcharge_money=0;
+        $one_surcharge_money=0;
+        $two_surcharge_money=0;
+        switch ($pack_specs_type) {
+            case 1:
+                $surcharge_money=$result->one_surcharge_money;
+                $one_surcharge_money=$surcharge_money;
+                break;
+            case 2:
+                $surcharge_money=$result->two_surcharge_money;
+                $two_surcharge_money=$surcharge_money;
+                break;
+            default:
+                $surcharge_money=0;
+                break;
+        }
+        $res=[
+            'data'=>$result,
+            'pack_specs_type'=>$pack_specs_type,
+            'one_surcharge_money'=>$one_surcharge_money,
+            'two_surcharge_money'=>$two_surcharge_money,
+            'surcharge_money'=>$surcharge_money
+            
+        ];
+        
+        return $res;
+    }
 }

+ 7 - 0
app/admin/view/general/config/index.html

@@ -272,6 +272,11 @@
                         obj.edit.label=list[i].extend[0];
                         obj.edit.keys=list[i].extend[1];
                     }
+                    if(list[i].type=='array'){
+                        obj.edit.form='input';
+                        obj.edit.type='text';
+                        obj.edit.value=list[i].value;
+                    }
                     if(list[i].type=='switch'){
                         obj.edit.form='switch';
                         obj.edit.inactiveValue='0';
@@ -293,6 +298,8 @@
                     this.$refs.yunform.showField(['label','keys']);
                 }else if(inArray(['select','selects','radio','checkbox'],data)){
                     this.$refs.yunform.showField('options');
+                }else if(data=='array'){
+                    this.$refs.yunform.showField(['vulue']);
                 }
             },
             changeGroup:function (data){

+ 107 - 103
app/admin/view/goods/import_list/index.html

@@ -1,130 +1,134 @@
 <template>
     <el-card shadow="never">
-        <yun-table
-                :columns="columns"
-                ref="yuntable"
-                @render="onTableRender"
-                toolbar="refresh,del"
-                :auth="{
+        <yun-table :columns="columns" ref="yuntable" @render="onTableRender" toolbar="refresh,del" :auth="{
                
                     del:{:$auth->check('app\\admin\\controller\\goods\\ImportList','del')},
          
-                }"
-                :extend="extend">
+                }" :extend="extend">
         </yun-table>
     </el-card>
 </template>
 <script>
-import table from "@components/Table.js";
-export default{
-    components:{
-        'YunTable':table
-    },
-    data:{
-        extend:{
-            index_url: 'goods/import_list/index',
-            del_url: 'goods/import_list/del',
-            multi_url: 'goods/import_list/multi',
+    import table from "@components/Table.js";
+    export default {
+        components: {
+            'YunTable': table
         },
-        columns:[
-            {checkbox: true,selectable:function (row,index){
-                //可以根据业务需求返回false让某些行不可选中
-                return true;
-            }},
-            {field:"id",title:"ID",operate:false},
-            {field:"shop_id",title:"店铺ID"},
-            {field: 'type_id', title:('打单平台'), operate: false,searchList: {1:'风速', 2:'聚水潭',0: '无'},formatter: function(data,row){
-                        let tag=Yunqi.formatter.tag;
-                        if(row.type_id==1){
-                            tag.value='风速';
-                            tag.type='success';
-                        }else if(row.type_id==2){
-                            tag.value='聚水潭';
-                            tag.type='primary';
-                        }else{
-                            tag.value='无';
-                            tag.type='info';
+        data: {
+            extend: {
+                index_url: 'goods/import_list/index',
+                del_url: 'goods/import_list/del',
+                multi_url: 'goods/import_list/multi',
+            },
+            columns: [
+                {
+                    checkbox: true, selectable: function (row, index) {
+                        //可以根据业务需求返回false让某些行不可选中
+                        return true;
+                    }
+                },
+                { field: "id", title: "ID", operate: false },
+                { field: "shop_id", title: "店铺ID" },
+                {
+                    field: 'type_id', title: ('打单平台'), operate: "select", searchList: { 1: '风速', 2: '聚水潭', 0: '无' }, formatter: function (data, row) {
+                        let tag = Yunqi.formatter.tag;
+                        if (row.type_id == 1) {
+                            tag.value = '风速';
+                            tag.type = 'success';
+                        } else if (row.type_id == 2) {
+                            tag.value = '聚水潭';
+                            tag.type = 'primary';
+                        } else {
+                            tag.value = '无';
+                            tag.type = 'info';
                         }
                         return tag;
-                    }},
-            {field:"trade_from",title:"平台"},
-            {field:"province",title:"省份",operate: false},
-            {field:"city",title:"城市",operate: false},
-            {field:"company_name",title:"快递名称"},
-            {field:"waybill_no",title:"快递单号"},
-            {field:"goods_title",title:"产品名称",width:300,align:'left'},
-            {field:"goods_info",title:"商品信息",width:300,align:'left'},
-            {field:"sku_id",title:"规格id"},
-            {field:"num",title:"件数",operate: false},
-            {field:"price",title:"实付价格",operate: false},
-            // {field:"weight",title:"重量(斤)",operate: false},
-            {field:"consign_time",title:"发货时间",operate:"daterange",formatter:Yunqi.formatter.datetime},
-            {field:"status",title:"状态",operate:"select",searchList:{1:"无店铺", 2:"无Sku", 3:"正常"},formatter:Yunqi.formatter.tags},
-            // {field:"user_id",title:"录入人",operate: false},
-            {field:"createtime",title:"创建时间",operate: false,formatter:Yunqi.formatter.datetime},
-            {field:"updatetime",title:"修改时间",visible:false,operate: false,formatter:Yunqi.formatter.datetime},
-            {
-                field: 'operate',
-                fixed: 'right',
-                title: __('操作'),
-                width:150,
-                      action:{
-                        shops:{
-                            tooltip:true,
-                            icon:'fa fa-certificate',
-                            type:'success',
-                            text:__('关联店铺'),
-                            method:'shops',
-                            visible:function(row,index){
+                    }
+                },
+                { field: "trade_from", title: "平台" },
+                { field: "province", title: "省份", operate: false },
+                { field: "city", title: "城市", operate: false },
+                { field: "company_name", title: "快递名称", operate: false },
+                { field: "waybill_no", title: "快递单号" },
+                { field: "goods_title", title: "产品名称", width: 300, align: 'left' },
+                { field: "goods_info", title: "商品信息", width: 300, align: 'left' },
+                { field: "sku_id", title: "规格id" },
+                { field: "num", title: "件数", operate: false },
+                { field: "price", title: "实付价格", operate: false },
+                { field: "pack_specs_id", title: "打包规格id", operate: false },
+                { field: "labor_cost_money", title: "工价", operate: false },
+                { field: "one_surcharge_money", title: "单层保温金额", operate: false },
+                { field: "two_surcharge_money", title: "双层保温金额", operate: false },
+                // {field:"weight",title:"重量(斤)",operate: false},
+                { field: "consign_time", title: "发货时间", operate: "daterange", formatter: Yunqi.formatter.datetime },
+                
+                // {field:"user_id",title:"录入人",operate: false},
+                { field: "createtime", title: "创建时间", operate: false, formatter: Yunqi.formatter.datetime },
+                { field: "updatetime", title: "修改时间", operate: false, formatter: Yunqi.formatter.datetime },
+                { field: "status",fixed: 'right', title: "状态", operate: "select", searchList: { 1: "无店铺", 2: "无Sku", 3: "正常" }, formatter: Yunqi.formatter.tags },
+                {
+                    field: 'operate',
+                    fixed: 'right',
+                    title: __('操作'),
+                    width: 150,
+                    action: {
+                        shops: {
+                            tooltip: true,
+                            icon: 'fa fa-certificate',
+                            type: 'success',
+                            text: __('关联店铺'),
+                            method: 'shops',
+                            visible: function (row, index) {
                                 return row.status == 1;
                             }
                         },
-                        specs:{
-                            tooltip:true,
-                            icon:'fa fa-list',
-                            type:'info',
-                            text:__('关联规格'),
-                            method:'specs',
-                            visible:function(row,index){
+                        specs: {
+                            tooltip: true,
+                            icon: 'fa fa-list',
+                            type: 'info',
+                            text: __('关联规格'),
+                            method: 'specs',
+                            visible: function (row, index) {
                                 return row.status == 2;
                             }
                         },
-                        del:true
+                        // del: true
                     }
-            }
-        ]
-    },
-    methods: {
-        shops:function (row){
-            let that=this;
-            Yunqi.api.open({
-                url:'goods/import_list/shops?ids='+row.shop_id,
-                width:1000,
-                title:__('关联店铺'),
-                icon:'fa fa-list',
-                close:function (r){
-                    that.$refs.yuntable.reload();
                 }
-            });
+            ]
         },
-        specs:function (row){
-            let that=this;
-            Yunqi.api.open({
-                url:'goods/import_list/specs?ids='+row.id,
-                width:1000,
-                title:__('关联规格'),
-                icon:'fa fa-list',
-                close:function (r){
-                    if(r){
+        methods: {
+            shops: function (row) {
+                let that = this;
+                Yunqi.api.open({
+                    url: 'goods/import_list/shops?ids=' + row.shop_id,
+                    width: 1000,
+                    title: __('关联店铺'),
+                    icon: 'fa fa-list',
+                    close: function (r) {
                         that.$refs.yuntable.reload();
                     }
-                }
-            })
-            
-        },
-  
+                });
+            },
+            specs: function (row) {
+                let that = this;
+                Yunqi.api.open({
+                    url: 'goods/import_list/specs?ids=' + row.id,
+                    width: 1000,
+                    title: __('关联规格'),
+                    icon: 'fa fa-list',
+                    close: function (r) {
+                        if (r) {
+                            that.$refs.yuntable.reload();
+                        }
+                    }
+                })
+
+            },
+
+        }
     }
-}
 </script>
 <style>
+    
 </style>

+ 78 - 57
app/admin/view/goods/import_list/shops.html

@@ -1,76 +1,97 @@
 <template>
     <el-card shadow="never" style="border: 0;">
-        <yun-form
-            ref="yunform"
-            @render="onFormRender"
-            @submit="onSubmit"
-            @success="onSuccess"
-            @fail="onFail"
-            :data="row"
+        <yun-form ref="yunform" @render="onFormRender" @submit="onSubmit" @success="onSuccess" @fail="onFail"
             :columns="columns">
-            <template #default>
+            <!-- <template #default>
                 {:token_field()}
-            </template>
-    
+            </template> -->
+
         </yun-form>
+        <div class="el-form-item__label">
+
+            <label for="" style="width: 120px;"></label>
+            <el-button type="primary" @click="shops">添加店铺</el-button>
+        </div>
     </el-card>
 </template>
 <script>
-import form from "@components/Form.js";
-export default{
-    components:{
-        'YunForm':form
-    },
-    data:{
-        columns:[
-            {field:"id",title:"ID",edit:"hidden"},
-            {field:"shop_id",title:"店铺名称",searchList:Yunqi.data.shopList,edit: 'select',rules:'required'},
-        ],
-        row:Yunqi.data.row || {}
-    },
-    //页面加载完成时执行
-    onLoad:function(query){
-        
-        
-    },
-    //页面初始显示或在框架内显示时执行
-    onShow:function(){
+    import form from "@components/Form.js";
+    export default {
+        components: {
+            'YunForm': form
+        },
+        data: {
+            columns: [
+                { field: "id", title: "ID", edit: "hidden" },
+                { field: "shop_id", title: "店铺名称", searchList: Yunqi.data.shopList, edit: 'select', rules: 'required' },
+
+            ]
+        },
+        //页面加载完成时执行
+        onLoad: function (query) {
 
-    },
-    //页面在框架内隐藏时执行
-    onHide:function(){
 
-    },
-    //页面在框架内关闭时执行
-    onUnload:function(){
+        },
+        //页面初始显示或在框架内显示时执行
+        onShow: function () {
 
-    },
-    methods: {
-        onFormRender:function(rows){
-            //表单渲染完成后执行
         },
-        onSubmit:function(rows){
-            //表单提交前执行,返回false可以阻止表单提交
-            /**
-             * form常用方法
-             * this.$refs.yunform.setError(field,message);//聚焦表单项并显示错误信息
-             * this.$refs.yunform.hideField(field);//隐藏表单项
-             * this.$refs.yunform.showField(field);//显示表单项
-             * this.$refs.yunform.setValue(field,value);//为表单项设置值
-             * this.$refs.yunform.getValue(field);//为获取表单项的值
-             * this.$refs.yunform.setField(field,key,value);//修改表单json的其他属性值,比如rules,title,searchList等
-             */
-            return true;
+        //页面在框架内隐藏时执行
+        onHide: function () {
+
         },
-        onSuccess:function(response){
-            //表单提交成功后执行
-            console.log(response)
+        //页面在框架内关闭时执行
+        onUnload: function () {
+
         },
-        onFail:function(err){
-            //表单提交失败后执行
+        methods: {
+            shops: function (row) {
+                let that = this;
+                Yunqi.api.open({
+                    url: 'shop/shop_list/add',
+                    width: 500,
+                    title: __('关联店铺'),
+                    icon: 'fa fa-list',
+                    close: function (r) {
+                        that.getShopList()
+                    }
+                });
+            },
+            getShopList() {
+                let that = this;
+                Yunqi.ajax.post('goods/import_list/getShopList', {}, false, false, true).then(res => {
+                    
+                    if (res.code == 200) {
+                        this.$refs.yunform.setField('shop_id','searchList',res.data)
+                        
+                    }
+                })
+            },
+            onFormRender: function (rows) {
+                //表单渲染完成后执行
+            },
+            onSubmit: function (rows) {
+                //表单提交前执行,返回false可以阻止表单提交
+                /**
+                 * form常用方法
+                 * this.$refs.yunform.setError(field,message);//聚焦表单项并显示错误信息
+                 * this.$refs.yunform.hideField(field);//隐藏表单项
+                 * this.$refs.yunform.showField(field);//显示表单项
+                 * this.$refs.yunform.setValue(field,value);//为表单项设置值
+                 * this.$refs.yunform.getValue(field);//为获取表单项的值
+                 * this.$refs.yunform.setField(field,key,value);//修改表单json的其他属性值,比如rules,title,searchList等
+                 */
+                return true;
+            },
+            onSuccess: function (response) {
+                //表单提交成功后执行
+                console.log(response)
+            },
+            onFail: function (err) {
+                //表单提交失败后执行
+            }
         }
     }
-}
 </script>
 <style>
 </style>

+ 78 - 66
app/admin/view/goods/import_list/specs.html

@@ -6,7 +6,13 @@
             <el-table :data="tableData" style="width: 100%" border :ref="'multipleTable_' + tabValue" stripe
                 highlight-current-row @select="handleSelectionChange" @select-all="handleAllSelect"
                 @current-change="handleCurrentChange">
-                <el-table-column type="index" width="55">
+                <!-- <el-table-column type="index" width="55">
+                </el-table-column> -->
+                <el-table-column prop="selected_d" label="店铺关联规格" width="90" height="40">
+                   
+                   <template #default="{row}">
+                        <el-checkbox v-model="row.selected_d" size="large" disabled/>
+                    </template>
                 </el-table-column>
                 <el-table-column prop="name" label="规格" align="center">
                 </el-table-column>
@@ -25,6 +31,7 @@
         <el-button @click="cancelDialog">取消</el-button>
     </div>
 </template>
+
 <script>
     import table from "@components/Table.js";
 
@@ -53,7 +60,7 @@
                 if (this.allData == "") return;
                 let arr = Object.values(this.allData).flat(Infinity)
                 Yunqi.ajax.post('goods/import_list/specs', { ids: Yunqi.data.row.id, all_data: arr }, false, false, true).then(res => {
-                    console.log(res.data)
+                    // console.log(res)
                     if (res.code == 200) {
                         this.$message.success(__('设置成功'));
                         //倒计时刷新窗口
@@ -70,7 +77,6 @@
                 this.allData[this.tabValue] = e || []
             },
             handleCurrentChange(e) {
-
                 this.allData[this.tabValue] = e || []
             },
             handleSelectionChange(e) {
@@ -95,70 +101,69 @@
                         for (var key in Object(res)) {
                             let index = this.tableData.findIndex(item => item.id == res[key]['id']);
                             const isExist = this.shop_allData.includes(res[key]['id'])
-                            if(isExist){
-                                if (index != -1) {
-                                    this.tableData.splice(index, 1)
-                                } else {
-                                    this.tableData.push({ name: res[key]['title'], id: res[key]['id'], type_id: this.tabValue });
-                                }
+                            if (index != -1) {
+                                this.tableData.splice(index, 1)
+                            } else {
+
+                                this.tableData.push({ name: res[key]['title'], id: res[key]['id'], type_id: this.tabValue, selected_d: isExist });
                             }
-                            
+
                         }
-                        this.$nextTick(() => {
-                            const tableRef = this.$refs['multipleTable_' + this.tabValue];
-                            if (this.type == 0 && this.allData[this.tabValue]?.length > 0 && tableRef) {
-                                this.tableData.forEach((item, index) => {
-                                    const matched = this.allData[this.tabValue].find(row => {
-                                        return row.id == item.id
-                                    });
-                                    if (matched) {
-                                        this.tableData[index] = matched
-                                    }
-                                })
-                                this.allData[this.tabValue].forEach(selected => {
-                                    const matched = this.tableData.find(row => row.id === selected.id);
-                                    if (matched) {
-                                        this.$refs['multipleTable_' + this.tabValue].toggleRowSelection(matched, true); // 勾选
-                                    }
-                                });
-                            }
-                            else if (this.type == 1 && this.allData[Number(this.tabValue)]) {
-                                this.tableData.forEach((item, index) => {
-                                    const matched = this.allData[Number(this.tabValue)].find(row => {
-                                        if (row.product_id) {
-                                            return row.product_id == item.value
-                                        } else {
-                                            return row.value == item.value
-                                        }
-                                    });
-                                    if (matched) {
-                                        // this.tableData[index] = { name: 'kam', value: 3, price: '111', type_id: '4', packet: '3' }
-                                        if (matched.product_id) {
-                                            this.tableData[index].name = matched.name
-                                            this.tableData[index].box_name = matched.box_name
-                                            this.tableData[index].type_name = matched.type_name
-                                            this.tableData[index].price = matched.price
-                                            this.tableData[index].packet = matched.box_id != 0 ? matched?.box_id.toString() : ""
-                                        } else {
-                                            this.tableData[index] = matched
-                                        }
-                                    }
-                                })
-                                this.allData[Number(this.tabValue)].forEach(selected => {
-                                    const matched = this.tableData.find(row => {
-                                        if (selected.product_id) {
-                                            return selected.product_id == row.value
-                                        } else {
-                                            return row.value === selected.value
-                                        }
-                                    });
-                                    if (matched) {
-                                        this.$refs['multipleTable_' + this.tabValue].toggleRowSelection(matched, true); // 勾选
-                                    }
-                                });
-                                console.log(this.allData)
-                            }
-                        });
+                        // this.$nextTick(() => {
+                        //     const tableRef = this.$refs['multipleTable_' + this.tabValue];
+                        //     if (this.type == 0 && this.allData[this.tabValue]?.length > 0 && tableRef) {
+                        //         this.tableData.forEach((item, index) => {
+                        //             const matched = this.allData[this.tabValue].find(row => {
+                        //                 return row.id == item.id
+                        //             });
+                        //             if (matched) {
+                        //                 this.tableData[index] = matched
+                        //             }
+                        //         })
+                        //         this.allData[this.tabValue].forEach(selected => {
+                        //             const matched = this.tableData.find(row => row.id === selected.id);
+                        //             if (matched) {
+                        //                 this.$refs['multipleTable_' + this.tabValue].toggleRowSelection(matched, true); // 勾选
+                        //             }
+                        //         });
+                        //     }
+                        //     else if (this.type == 1 && this.allData[Number(this.tabValue)]) {
+                        //         this.tableData.forEach((item, index) => {
+                        //             const matched = this.allData[Number(this.tabValue)].find(row => {
+                        //                 if (row.product_id) {
+                        //                     return row.product_id == item.value
+                        //                 } else {
+                        //                     return row.value == item.value
+                        //                 }
+                        //             });
+                        //             if (matched) {
+                        //                 // this.tableData[index] = { name: 'kam', value: 3, price: '111', type_id: '4', packet: '3' }
+                        //                 if (matched.product_id) {
+                        //                     this.tableData[index].name = matched.name
+                        //                     this.tableData[index].box_name = matched.box_name
+                        //                     this.tableData[index].type_name = matched.type_name
+                        //                     this.tableData[index].price = matched.price
+                        //                     this.tableData[index].packet = matched.box_id != 0 ? matched?.box_id.toString() : ""
+                        //                 } else {
+                        //                     this.tableData[index] = matched
+                        //                 }
+                        //             }
+                        //         })
+                        //         this.allData[Number(this.tabValue)].forEach(selected => {
+                        //             const matched = this.tableData.find(row => {
+                        //                 if (selected.product_id) {
+                        //                     return selected.product_id == row.value
+                        //                 } else {
+                        //                     return row.value === selected.value
+                        //                 }
+                        //             });
+                        //             if (matched) {
+                        //                 this.$refs['multipleTable_' + this.tabValue].toggleRowSelection(matched, true); // 勾选
+                        //             }
+                        //         });
+                        //         console.log(this.allData)
+                        //     }
+                        // });
                     }
                 });
             }
@@ -183,7 +188,7 @@
                 for (var key in Object(arr)) {
                     acc[key] = Number(arr[key]['value']);
                 }
-                this.shop_allData=acc;
+                this.shop_allData = acc;
             }
             //你只需要保存规格是吧, 是你末尾加了个row
             this.getSpecData()
@@ -191,4 +196,11 @@
     }
 </script>
 <style>
+    .el-table_1_column_1{
+        padding: 0px !important;
+    }
+    .el-checkbox__input.is-checked .el-checkbox__inner {
+        background-color: var(--el-checkbox-checked-bg-color) !important;
+        border-color: var(--el-checkbox-checked-input-border-color) !important;
+    }
 </style>

+ 78 - 0
app/admin/view/goods/pack_specs/add.html

@@ -0,0 +1,78 @@
+<template>
+    <el-card shadow="never" style="border: 0;">
+        <yun-form
+            ref="yunform"
+            @render="onFormRender"
+            @submit="onSubmit"
+            @success="onSuccess"
+            @fail="onFail"
+            :data="row"
+            :columns="columns">
+            <template #default>
+                {:token_field()}
+            </template>
+    
+        </yun-form>
+    </el-card>
+</template>
+<script>
+import form from "@components/Form.js";
+export default{
+    components:{
+        'YunForm':form
+    },
+    data:{
+        columns:[
+            {field:"title",title:"规格名称",edit:{form:"input",type:"text"},rules:"required"},
+            {field:"labor_cost_money",title:"工价",edit:"number",rules:"required"},
+            // {field: "keep_warm_type", title: "保温款式", edit: "radio", searchList: { 1: "单层保温", 2: "双层保温" }, rules: "required" },
+            // {field:"surcharge_money",title:"加收金额",edit:{form:"input",type:"number"},rules:"required"}
+            {field:"one_surcharge_money",title:"单层保温金额",edit:{form:"input",type:"number"},rules:"required"},
+            {field:"two_surcharge_money",title:"双层保温金额",edit:{form:"input",type:"number"},rules:"required"}
+        ],
+        row:Yunqi.data.row || {}
+    },
+    //页面加载完成时执行
+    onLoad:function(query){
+    },
+    //页面初始显示或在框架内显示时执行
+    onShow:function(){
+
+    },
+    //页面在框架内隐藏时执行
+    onHide:function(){
+
+    },
+    //页面在框架内关闭时执行
+    onUnload:function(){
+
+    },
+    methods: {
+        onFormRender:function(rows){
+            //表单渲染完成后执行
+        },
+        onSubmit:function(rows){
+            Yunqi.ajax.post('goods/pack_specs/add', { row: rows}, false, false, true).then(res => {
+                    if (res.code == 200) {
+                        this.$message.success(__('设置成功'));
+                        // 倒计时刷新窗口
+                        setTimeout(() => {
+                            Yunqi.api.closelayer(Yunqi.app.window.id, true);
+                        }, 1000);
+
+                    }else{
+                        Yunqi.alert(__(res.msg), __('温馨提示'), { type: 'error' });
+                    }
+                });
+        },
+        onSuccess:function(response){
+            //表单提交成功后执行
+        },
+        onFail:function(err){
+            //表单提交失败后执行
+        }
+    }
+}
+</script>
+<style>
+</style>

+ 78 - 0
app/admin/view/goods/pack_specs/edit.html

@@ -0,0 +1,78 @@
+<template>
+    <el-card shadow="never" style="border: 0;">
+        <yun-form
+            ref="yunform"
+            @render="onFormRender"
+            @submit="onSubmit"
+            @success="onSuccess"
+            @fail="onFail"
+            :data="row"
+            :columns="columns">
+            <template #default>
+                {:token_field()}
+            </template>
+    
+        </yun-form>
+    </el-card>
+</template>
+<script>
+import form from "@components/Form.js";
+export default{
+    components:{
+        'YunForm':form
+    },
+    data:{
+        columns:[
+            {field:"title",title:"规格名称",edit:{form:"input",type:"text"},rules:"required"},
+            {field:"labor_cost_money",title:"工价",edit:"number",rules:"required"},
+            // {field: "keep_warm_type", title: "保温款式", edit: "radio", searchList: { 1: "单层保温", 2: "双层保温" }, rules: "required" },
+            // {field:"surcharge_money",title:"加收金额",edit:{form:"input",type:"number"},rules:"required"}
+            {field:"one_surcharge_money",title:"单层保温金额",edit:{form:"input",type:"number"},rules:"required"},
+            {field:"two_surcharge_money",title:"双层保温金额",edit:{form:"input",type:"number"},rules:"required"}
+        ],
+        row:Yunqi.data.row || {}
+    },
+    //页面加载完成时执行
+    onLoad:function(query){
+    },
+    //页面初始显示或在框架内显示时执行
+    onShow:function(){
+
+    },
+    //页面在框架内隐藏时执行
+    onHide:function(){
+
+    },
+    //页面在框架内关闭时执行
+    onUnload:function(){
+
+    },
+    methods: {
+        onFormRender:function(rows){
+            //表单渲染完成后执行
+        },
+        onSubmit:function(rows){
+            Yunqi.ajax.post('goods/pack_specs/edit', {row: rows}, false, false, true).then(res => {
+                    if (res.code == 200) {
+                        this.$message.success(__('设置成功'));
+                        // 倒计时刷新窗口
+                        setTimeout(() => {
+                            Yunqi.api.closelayer(Yunqi.app.window.id, true);
+                        }, 1000);
+
+                    }else{
+                        Yunqi.alert(__(res.msg), __('温馨提示'), { type: 'error' });
+                    }
+                });
+        },
+        onSuccess:function(response){
+            //表单提交成功后执行
+        },
+        onFail:function(err){
+            //表单提交失败后执行
+        }
+    }
+}
+</script>
+<style>
+</style>

+ 91 - 0
app/admin/view/goods/pack_specs/index.html

@@ -0,0 +1,91 @@
+<template>
+    <el-card shadow="never">
+        <yun-table :columns="columns" search="name,phone" toolbar="refresh,add,edit,del,more" ref="yuntable"
+            :auth="auth" :extend="extend">
+        </yun-table>
+    </el-card>
+</template>
+<script>
+    import table from "@components/Table.js";
+    export default {
+        components: {
+            'YunTable': table
+        },
+        auth: {
+            add: Yunqi.auth.check('app\\admin\\controller\\goods\\PackSpecs', 'add'),
+            edit: Yunqi.auth.check('app\\admin\\controller\\goods\\PackSpecs', 'edit'),
+            del: Yunqi.auth.check('app\\admin\\controller\\goods\\PackSpecs', 'del'),
+            multi: Yunqi.auth.check('app\\admin\\controller\\goods\\PackSpecs', 'multi'),
+            recyclebin: Yunqi.auth.check('app\\admin\\controller\\goods\\PackSpecs', 'recyclebin'),
+        },
+        data: {
+            extend: {
+                index_url: 'goods/pack_specs/index',
+                add_url: 'goods/pack_specs/add',
+                edit_url: 'goods/pack_specs/edit',
+                del_url: 'goods/pack_specs/del',
+                multi_url: 'goods/pack_specs/multi'
+            },
+            columns: [
+                {
+                    checkbox: true, selectable: function (row, index) {
+                        //可以根据业务需求返回false让某些行不可选中
+                        return true;
+                    }
+                },
+                { field: "id", title: "ID", operate: false },
+                { field: "title", title: "规格名称" },
+                { field: "labor_cost_money", title: "工价", operate: false },
+                // { field: "keep_warm_type", title: "保温款式", operate: { form: "radio", filter: "=" }, searchList: { 1: "单层保温", 2: "双层保温" } },
+                // { field: "surcharge_money", title: "加收金额", operate: false },
+                { field: "one_surcharge_money", title: "单层保温金额", operate: false },
+                { field: "two_surcharge_money", title: "双层保温金额", operate: false },
+                { field: "createtime", title: "创建时间", operate: "daterange", formatter: Yunqi.formatter.datetime },
+                { field: "updatetime", title: "修改时间", operate: "daterange", formatter: Yunqi.formatter.datetime },
+                {
+                    field: 'operate',
+                    title: __('操作'),
+                    width: 130,
+                    action: {
+                        edit: function (row) {
+                            //可以根据业务需求返回false让按钮不显示
+                            return true
+                        },
+                        del: true,
+                    }
+                }
+            ]
+        },
+        //页面加载完成时执行
+        onLoad: function (query) {
+            console.log(query);
+        },
+        //页面初始显示或在框架内显示时执行
+        onShow: function () {
+
+        },
+        //页面在框架内隐藏时执行
+        onHide: function () {
+
+        },
+        //页面在框架内关闭时执行
+        onUnload: function () {
+
+        },
+        methods: {
+            onTableRender: function (list) {
+                //表格渲染完成后执行
+                /**
+                 * table常用方法
+                 * this.$refs.yuntable.reset();//重新渲染整个组件,当columns修改时,需要重新渲染表格才能生效,可以执行该方法。
+                 * this.$refs.yuntable.reload();//保持当前的page,重新获取数据
+                 * this.$refs.yuntable.submit();//返回第一页,重新获取数据
+                 * this.$refs.yuntable.expandAllTree();//树形表格展开所有节点
+                 * this.$refs.yuntable.expandTree(topid);//树形表格展开指定节点
+                 */
+            }
+        }
+    }
+</script>
+<style>
+</style>

+ 14 - 13
app/admin/view/goods/product_config/add.html

@@ -7,19 +7,20 @@
 </template>
 <script>
     import form from "@components/Form.js";
-    export default{
-        components:{'YunForm':form},
-        data:{
-            row:Yunqi.data.row,
-            columns:[
-                {field: 'id',title: __('ID'),edit:'hidden'},
-                {field: 'type_id', title: __('类型'), edit: 'radio',rules:"required",searchList: Yunqi.data.varietyList},
-                {field: 'title',title: __('名称'),edit:'text',rules:'required'},
-                {field: 'another_name',title: __('别名'),edit:'text',rules:'required'},
-                {field: 'weight',title: __('重量(斤)'),edit:'text',rules:'required'},
+    export default {
+        components: { 'YunForm': form },
+        data: {
+            row: Yunqi.data.row,
+            columns: [
+                { field: 'id', title: __('ID'), edit: 'hidden' },
+                { field: 'type_id', title: __('类型'), edit: 'radio', rules: "required", searchList: Yunqi.data.varietyList },
+                { field: 'title', title: __('名称'), edit: 'text', rules: 'required' },
+                { field: 'another_name', title: __('别名'), edit: 'text'},
+                { field: 'weight', title: __('重量(斤)'), edit: 'text', rules: 'required' },
+                { field: "pack_specs_id", title: "打包规格", searchList: Yunqi.data.packSpecsList, edit: 'select'},
                 //{field: 'box_id',title: __('包装箱'),edit:'radio',rules:'required', searchList: Yunqi.data.packingList},
-                {field: 'sort',title: __('排序'),edit:'text'},
-                {field: 'status', title: __('状态'), edit:'switch',searchList: {1: __('正常'),2: __('隐藏')}},
+                { field: 'sort', title: __('排序'), edit: 'text' },
+                { field: 'status', title: __('状态'), edit: 'switch', searchList: { 1: __('正常'), 2: __('隐藏') } },
             ]
         },
         methods: {
@@ -29,4 +30,4 @@
 </script>
 <style>
 
-</style>
+</style>

+ 4 - 0
app/admin/view/goods/product_config/index.html

@@ -38,6 +38,10 @@
                 {field: 'title',title: __('标题'),operate: '='},
                 {field: 'another_name', title: __('别名'),operate:'LIKE'},
                 {field: 'weight', title: __('重量(斤)'),operate: false},
+                {field: 'pack_specs_title', title: __('打包规格'),operate: false},
+                { field: "labor_cost_money", title: "工价", operate: false },
+                { field: "one_surcharge_money", title: "单层保温金额", operate: false },
+                { field: "two_surcharge_money", title: "双层保温金额", operate: false },
                 //{field: 'type_box', title: __('包装箱'),operate: false, searchList: Yunqi.data.packingList},
                 {field: 'status', title: __('状态'),width:120,searchList: {1: __('正常'),2: __('停用')},formatter:Yunqi.formatter.switch},
                 {field: 'sort', title: __('排序'), operate:false,sortable: true},

+ 16 - 2
app/admin/view/shop/shop_delivery/index.html

@@ -55,10 +55,24 @@
                 {field: 'weigh', title: __('重量'),operate: false},
                 {field: 'price', title: __('发货价'),operate: false},
                 {field: 'total_price', title: __('总价'),operate: false},
-                {field: 'company_name', title: __('快递名称'),operate: false},
-                {field: 'waybill_no', title: __('快递单号'),operate: false},
+                {field: 'company_name', title: __('快递名称'),operate: 'LIKE'},
+                {field: 'waybill_no', title: __('快递单号'),operate: 'LIKE'},
                 {field: 'region', title: __('省市'),operate: false},
                 {field: 'other_price', title: __('偏远加收金额'),operate: false},
+                { field: "incubator", title: "保温箱", operate: "select", searchList: { 0: "不是保温箱",1: "单层保温", 2: "双层保温" },formatter: function (data, row) {
+                        let tag = Yunqi.formatter.tag;
+                        if (row.incubator == 1) {
+                            tag.value = '单层保温';
+                            tag.type = 'warning';
+                        } else if (row.incubator == 2) {
+                            tag.value = '双层保温';
+                            tag.type = 'danger';
+                        } else {
+                            tag.value = '不是保温箱';
+                            tag.type = 'info';
+                        }
+                        return tag;
+                    } },
                 {field: 'ship_date', title: __('录入时间'), width:80, operate:"date" },
                 {field: 'settlement_data', title: __('结算时间'),width: 100,operate:'date'},
                 {field: 'status', title: __('结算状态'), operate: 'select', width:85,searchList: {1: __('待结算'),2: __('已结算')},formatter:Yunqi.formatter.tag},

+ 1 - 1
app/admin/view/shop/shop_list/add.html

@@ -18,7 +18,7 @@
                 {field: 'customer_id', title: __('客户'),searchList:Yunqi.data.customerList,edit: 'select',rules:'required'},
                 {field: 'platform',title: __('平台'), edit: 'radio', rules:'required',searchList:Yunqi.data.platformList},
                 {field: 'name',title: __('店铺名称'),edit:'text',rules:'required'},
-                {field: 'shop_id',title: __('店铺ID(风速)'),edit:'text'},
+                {field: 'shop_id',title: __('店铺ID(风速、聚水潭)'),edit:'text',rules:'required'},
                 {field: 'staff_id', title: __('员工'), edit: 'select',searchList: Yunqi.data.userList},
                 {field: 'status', title: __('状态'), edit:'switch',searchList: {1: __('正常'),2: __('隐藏')}},
             ]

+ 1 - 1
app/admin/view/shop/shop_list/edit.html

@@ -18,7 +18,7 @@
                 {field: 'customer_id', title: __('客户'),searchList:Yunqi.data.customerList,edit: 'select',rules:'required'},
                 {field: 'platform',title: __('平台'), edit: 'radio', rules:'required',searchList:Yunqi.data.platformList},
                 {field: 'name',title: __('店铺名称'),edit:'text'},
-                {field: 'shop_id',title: __('店铺ID(风速)'),edit:'readonly'},
+                {field: 'shop_id',title: __('店铺ID(风速、聚水潭)'),edit:'readonly'},
                 {field: 'staff_id', title: __('员工'), edit: 'select',searchList: Yunqi.data.userList},
                 {field: 'status', title: __('状态'), edit:'switch',searchList: {1: __('正常'),2: __('隐藏')}},
             ]

+ 1 - 1
app/admin/view/shop/shop_list/index.html

@@ -37,7 +37,7 @@
                 {field: 'customer.name',title: __('客户'),operate:'LIKE'},
                 {field: 'platform',title: __('平台'),operate: '=', searchList: Yunqi.data.platformList},
                 {field: 'name', title: __('店铺名称'),operate: 'LIKE'},
-                {field: 'shop_id',title: __('店铺ID(风速)'),width:110},
+                {field: 'shop_id',title: __('店铺ID(风速、聚水潭)'),width:110},
                 {field: 'staff.nickname', title: __('员工'),searchList: {1: __('日结'), 2: __('周结'), 3: __('半月结')}},
                 {field: 'status', title: __('状态'),width:120,searchList: {1: __('正常'),2: __('停用')},formatter:Yunqi.formatter.switch},
                 {field: 'create_time', title: __('创建时间'), width:160,formatter: Yunqi.formatter.datetime,operate:false,sortable: true},

+ 7 - 1
app/api/controller/Index.php

@@ -13,7 +13,7 @@ use think\facade\Db;
 class Index extends Base
 {
 
-      protected $noNeedLogin = ['getAppVersion'];
+      protected $noNeedLogin = ['getAppVersion','getArr'];
 
       //首页数据分组统计品种
       public function index(StockLog $stockLog)
@@ -94,6 +94,12 @@ class Index extends Base
             return $this->success('ok', $shopList);  
       }
 
+      //获取规格
+      public function getArr(){
+
+            $list  = site_config('addonsd.arr_1');
+            $this->success('提交成功', $list);
+      }
 
    
 }

+ 1 - 1
app/api/route/route.php

@@ -71,5 +71,5 @@ Route::group('worker', function () {
     Route::rule('scan','worker/scan','POST');
     Route::rule('scanlog','worker/scanlog','POST');
 })->middleware(AllowCrossDomain::class);
-
+Route::rule('ceshi','index/getArr','GET|POST');
 

+ 8 - 0
app/common.php

@@ -16,6 +16,7 @@ if (!function_exists('site_config')) {
      */
     function site_config(string $name,mixed $vars='')
     {
+        
         if(strpos($name,'.')!==false){
             $name=explode('.',$name);
             $group=$name[0];
@@ -28,6 +29,7 @@ if (!function_exists('site_config')) {
             $groupval=Cache::get('site_config_'.$group);
             if(!$groupval){
                 $groupval=Config::where('group',$group)->column('value','name');
+                
                 foreach ($groupval as $key=>$val){
                     if(is_string($val)){
                         if (str_starts_with($val, '{') &&  str_ends_with($val, '}')) {
@@ -44,6 +46,12 @@ if (!function_exists('site_config')) {
                 Cache::set('site_config_'.$group,$groupval);
             }
             if($name) {
+                $type=Config::where(['group'=>$group,'name'=>$name])->value('type');
+                if($type=='array'){
+                    $array=str_replace(' ', '', $groupval[$name]);
+                    $array=str_replace(' ', '', $array);
+                    return explode(',', $array);
+                }
                 return $groupval[$name];
             }else{
                 return $groupval;

+ 1 - 1
app/common/controller/BaseController.php

@@ -74,7 +74,7 @@ class BaseController
      */
     protected function jsonSuccess(string $msg='',mixed $data=null)
     {
-        return json(['code' => 1,'msg' => 1111, 'data' => $data]);
+        return json(['code' => 200,'msg' => $msg, 'data' => $data]);
     }
 
     /**

+ 2 - 1
app/common/model/Config.php

@@ -42,7 +42,8 @@ class Config extends Model{
             'checkbox'      => __('多项选择'),
             'selectpage'    => __('关联表'),
             'selectpages'   => __('关联表(多选)'),
-            'json'         => __('JSON')
+            'json'         => __('JSON'),
+            'array'         => __('数组,以英文逗号(,)隔开')
         ];
         return $typeList;
     }

+ 0 - 1
app/common/model/FengsuSku.php

@@ -36,7 +36,6 @@ class FengsuSku Extends Model
                     'f.*',
                     'p.type_id',
                     'p.title as spec_name',
-                    'p.another_name as box_name',
                     'p.weight',
                     'p.box_id'
                 ])

+ 19 - 2
app/common/model/ImportSku.php

@@ -4,7 +4,7 @@ declare(strict_types=1);
 namespace app\common\model;
 
 use think\Model;
-
+use app\common\model\PackSpecs;
 class ImportSku Extends Model
 {
     // 自动写入时间戳字段
@@ -34,7 +34,6 @@ class ImportSku Extends Model
                     'f.*',
                     'p.type_id',
                     'p.title as spec_name',
-                    'p.another_name as box_name',
                     'p.weight',
                     'p.box_id'
                 ])
@@ -48,4 +47,22 @@ class ImportSku Extends Model
         return self::create(['shop_id'=> $shop_id, 'variety_id'=>$variety_id, 'spec_id'=>$spec_id, 'sku_id'=>$sku_id]);
     }
 
+    //获规格下的打包规格
+    public static function getPackSpecs(string $shop_id,  string $spec_id)
+    {
+        // return self::where('shop_id', $shop_id)->where('sku_id', $spec_id)->findOrEmpty();
+        $result = self::alias('f')
+                ->where(['f.shop_id'=>$shop_id,'f.sku_id'=>$spec_id])
+                ->join('yun_product_config p', 'f.variety_id = p.type_id AND f.spec_id = p.id', 'INNER')
+                ->field([
+                    'p.pack_specs_id'
+                ])
+                ->findOrEmpty();
+        $pack_specs_id=$result->pack_specs_id;
+        if(empty($pack_specs_id)) return null;
+        $packSpecs=new PackSpecs();
+        $result=$packSpecs->where('id',$pack_specs_id)->findOrEmpty();
+        return $result;
+    }
+
 }

+ 20 - 0
app/common/model/PackSpecs.php

@@ -0,0 +1,20 @@
+<?php
+declare(strict_types=1);
+
+namespace app\common\model;
+
+use think\Model;
+
+class PackSpecs Extends Model
+{
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = true;
+    protected $createTime = 'createtime';
+    protected $updateTime = 'updatetime';
+
+    protected $type = [
+        'createtime'     =>  'timestamp:Y-m-d H:i',
+        'updatetime'     =>  'timestamp:Y-m-d H:i',
+    ];
+
+}

+ 0 - 0
config/.htaccess


+ 8 - 0
config/nginx.htaccess

@@ -0,0 +1,8 @@
+location ~* (runtime|application)/{
+	return 403;
+}
+location / {
+	if (!-e $request_filename){
+		rewrite  ^(.*)$  /index.php?s=$1  last;   break;
+	}
+}