Quellcode durchsuchen

显示修改电商平台同步时间

dong025 vor 2 Tagen
Ursprung
Commit
f7df60273b

+ 129 - 56
app/admin/controller/goods/ImportList.php

@@ -19,6 +19,7 @@ use app\common\model\ProductConfig;
 use app\common\model\ImportList as ImportListModel;
 use app\common\model\ShopList as ShopListModel;
 use think\facade\Cache;
+
 #[Group("goods/import_list")]
 class ImportList extends Backend
 {
@@ -64,14 +65,40 @@ class ImportList extends Backend
     #[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();
 
+        if (false === $this->request->isAjax()) {
+            $list = $this->model->where($where)->field('type_id,trade_from,max(id)')->group('trade_from')->select();
+            $trade_from_item_list=[];
+            foreach ($list as &$item) {
+                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 = $item['trade_from'];
+                $trade_from = isset($trade_from_list[$trade_from]) ? $trade_from_list[$trade_from] : $item['trade_from'];
+                
+                $trade_from_item_list[$item['trade_from']]=$trade_from;
+            }
+            $trade_from_list = [
+                'dy' => '抖音'
+            ];
+            $this->assign('trade_from_item_list',  $trade_from_item_list);
+            return $this->fetch();
+        }
+
         $list = $this->model
             ->withJoin($with, 'left')
             //如果没有使用operate filter过滤的情况下,推荐使用with关联,可以提高查询效率
@@ -328,7 +355,7 @@ class ImportList extends Backend
                                 $shopDelivery_updata_list[] = $res['shopDelivery'];
                             }
                         }
-                        
+
                         $import_list_item = [
                             'id' => $item['id'],
                             'specs_name'        => $getPackSpecsFee['data']['title'],
@@ -381,12 +408,12 @@ class ImportList extends Backend
     public function set_jushuitan()
     {
         if (false === $this->request->isPost()) {
-            $row=[];
-            $startTime=null;
-            $jushuitan=Cache::get('jushuitan');
-            if(!empty($jushuitan)||$jushuitan!=null){
-                $startTime=$jushuitan['startTime'];
-                $startTime=date('Y-m-d H:i:s', $startTime);
+            $row = [];
+            $startTime = null;
+            $jushuitan = Cache::get('jushuitan');
+            if (!empty($jushuitan) || $jushuitan != null) {
+                $startTime = $jushuitan['startTime'];
+                $startTime = date('Y-m-d H:i:s', $startTime);
             }
             $this->assign('row', $row);
             $this->assign('startTime', $startTime);
@@ -397,38 +424,38 @@ class ImportList extends Backend
         if (empty($params['startTime'])) $this->error(__('请选择开始时间'));
 
         //时间间隔
-        $start_end_space_time=10*60;
+        $start_end_space_time = 10 * 60;
         //下一次时间间隔
-        $next_time_space=7*60;
+        $next_time_space = 7 * 60;
 
 
         //将查询分为,"2026-01-05 00:00:00~2026-01-05 00:05:00",查询该区间的订单,但是该时间区间单独数量可能超过50条,为了性能又不能一次性查询太多,从而进行分页查询,
         //查询不到数据,就往下一个时间区间查询
 
         $startTime_stamp = strtotime($params['startTime']);
-        if((time()-$startTime_stamp)<=3*60){
-             $this->error(__('开始时间3分钟之前'));
+        if ((time() - $startTime_stamp) <= 3 * 60) {
+            $this->error(__('开始时间3分钟之前'));
         }
-        $endTime_stamp=$startTime_stamp+$start_end_space_time;
-        $pageNum=1;
-
-        $jushuitan=[
-            'startTime'=>$startTime_stamp,
-            'endTime'=>$endTime_stamp,
-            'pageNum'=>$pageNum,
-            'next_time_space'=>$next_time_space
+        $endTime_stamp = $startTime_stamp + $start_end_space_time;
+        $pageNum = 1;
+
+        $jushuitan = [
+            'startTime' => $startTime_stamp,
+            'endTime' => $endTime_stamp,
+            'pageNum' => $pageNum,
+            'next_time_space' => $next_time_space
         ];
-        $jushuitan=[
-            'startTime'=>$startTime_stamp,
-            'endTime'=>$endTime_stamp,
-            'pageNum'=>$pageNum,
-            'next_time_space'=>$next_time_space
+        $jushuitan = [
+            'startTime' => $startTime_stamp,
+            'endTime' => $endTime_stamp,
+            'pageNum' => $pageNum,
+            'next_time_space' => $next_time_space
         ];
-        $result=Cache::set('jushuitan',$jushuitan);
-        if($result) return $this->jsonSuccess('设置成功');
+        $result = Cache::set('jushuitan', $jushuitan);
+        if ($result) return $this->jsonSuccess('设置成功');
         return $this->jsonError('设置失败');
     }
-   
+
     /**
      * 风速同步数据设置
      */
@@ -436,51 +463,97 @@ class ImportList extends Backend
     public function set_fengsu()
     {
         if (false === $this->request->isPost()) {
-            $row=[];
-            $startTime=null;
-            $fengsu=Cache::get('fengsu');
-            if(!empty($fengsu)||$fengsu!=null){
-                $startTime=$fengsu['startTime'];
-                $startTime=date('Y-m-d H:i:s', $startTime);
+            $row = [];
+            $platform_list = [
+                [
+                    'type' => 'dy',
+                    'name' => '抖音'
+                ],
+                [
+                    'type' => 'pdd',
+                    'name' => '拼多多'
+                ],
+                [
+                    'type' => 'jd',
+                    'name' => '京东'
+                ],
+                [
+                    'type' => 'tb',
+                    'name' => '淘宝'
+                ],
+                [
+                    'type' => 'ks',
+                    'name' => '快手'
+                ],
+                [
+                    'type' => 'xhs',
+                    'name' => '小红书'
+                ],
+                [
+                    'type' => 'sph',
+                    'name' => '微信小店'
+                ]
+                
+                
+
+            ];
+            $startTime_list = [];
+            foreach ($platform_list as $key => $item) {
+                $fengsu = Cache::get('fengsu_' . $item['type']);
+                $startTime = null;
+                if (!empty($fengsu) || $fengsu != null) {
+                    $startTime = $fengsu['startTime'];
+                    $startTime = date('Y-m-d H:i:s', $startTime);
+                }
+                $item_list = [
+                    'type' => $item['type'],
+                    'name' => $item['name'],
+                    'startTime' => $startTime
+                ];
+                $startTime_list[] = $item_list;
             }
+
+
             $this->assign('row', $row);
-            $this->assign('startTime', $startTime);
+            $this->assign('startTime_list', $startTime_list);
             return $this->fetch();
         }
 
         $params = $this->request->post("");
+
         if (empty($params['startTime'])) $this->error(__('请选择开始时间'));
 
         //时间间隔
-        $start_end_space_time=10*60;
+        $start_end_space_time = 10 * 60;
         //下一次时间间隔
-        $next_time_space=7*60;
+        $next_time_space = 7 * 60;
 
 
         //将查询分为,"2026-01-05 00:00:00~2026-01-05 00:05:00",查询该区间的订单,但是该时间区间单独数量可能超过50条,为了性能又不能一次性查询太多,从而进行分页查询,
         //查询不到数据,就往下一个时间区间查询
 
         $startTime_stamp = strtotime($params['startTime']);
-        if((time()-$startTime_stamp)<=3*60){
-             $this->error(__('开始时间3分钟之前'));
+        if ((time() - $startTime_stamp) <= 3 * 60) {
+            $this->error(__('开始时间3分钟之前'));
         }
-        $endTime_stamp=$startTime_stamp+$start_end_space_time;
-        $pageNum=1;
-
-        $fengsu=[
-            'startTime'=>$startTime_stamp,
-            'endTime'=>$endTime_stamp,
-            'pageNum'=>$pageNum,
-            'next_time_space'=>$next_time_space
+        $endTime_stamp = $startTime_stamp + $start_end_space_time;
+        $pageNum = 1;
+
+        $fengsu = [
+            'startTime' => $startTime_stamp,
+            'endTime' => $endTime_stamp,
+            'pageNum' => $pageNum,
+            'next_time_space' => $next_time_space
         ];
-        $fengsu=[
-            'startTime'=>$startTime_stamp,
-            'endTime'=>$endTime_stamp,
-            'pageNum'=>$pageNum,
-            'next_time_space'=>$next_time_space
+        $fengsu = [
+            'startTime' => $startTime_stamp,
+            'endTime' => $endTime_stamp,
+            'pageNum' => $pageNum,
+            'next_time_space' => $next_time_space
         ];
-        $result=Cache::set('fengsu',$fengsu);
-        if($result) return $this->jsonSuccess('设置成功');
+        $type = $params['type'];
+        $result = Cache::set('fengsu_' . $type, $fengsu);
+        if ($result) return $this->jsonSuccess('设置成功');
         return $this->jsonError('设置失败');
     }
 }

+ 327 - 216
app/admin/view/goods/import_list/index.html

@@ -1,229 +1,340 @@
 <template>
-    <el-card shadow="never">
-        <yun-table :columns="columns" ref="yuntable" @render="onTableRender" toolbar="refresh,settlement" :auth="{}" :extend="extend" :total-arr="totalArr" :is-showtotal="true"
-            @data-loaded="handleData">
-            <template #toolbar="{tool}">
-                    <template v-if="tool=='settlement'">
-                            <el-button type="primary" @click="set_jushuitan" title="设置">
-                                <i class="fa fa-cog"></i>
-                                <span class="title">聚水潭</span>
-                            </el-button>
-                            <el-button type="success" @click="set_fengsu" title="设置">
-                               <i class="fa fa-cog"></i>
-                               <span class="title">风速</span>
-                            </el-button>
+	<el-card shadow="never">
+		<yun-table :columns="columns" ref="yuntable" @render="onTableRender" toolbar="refresh,settlement" :auth="{}"
+			:extend="extend" :total-arr="totalArr" :is-showtotal="true" @data-loaded="handleData">
+			<template #toolbar="{tool}">
+				<template v-if="tool=='settlement'">
+					<el-button type="primary" @click="set_jushuitan" title="设置">
+						<i class="fa fa-cog"></i>
+						<span class="title">聚水潭</span>
+					</el-button>
+					<el-button type="success" @click="set_fengsu" title="设置">
+						<i class="fa fa-cog"></i>
+						<span class="title">风速</span>
+					</el-button>
 
-                        </template>
-                </template>
-        </yun-table>
-    </el-card>
+				</template>
+			</template>
+		</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',
-            },
-            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: '聚水潭'}, 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';
-                        }
-                        return tag;
-                    }
-                },
-                { 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: "order_status", fixed: 'right', title: "订单状态", operate: "select", searchList: { 'Sent': "正常",'OuterSent': "外部已发货",'SentCancelled': "已退款(聚水潭)",'TRADE_CLOSED':"已退款(风速)"}, formatter: function (data, row) {
-                        let tag = Yunqi.formatter.tag;
-                        if (row.order_status == 'OuterSent') {
-                            tag.value = '外部已发货';
-                            tag.type = 'warning';
-                        } else if (row.order_status == 'SentCancelled') {
-                            tag.value = '已退款';
-                            tag.type = 'danger';
-                        }else if (row.order_status == 'TRADE_CLOSED') {
-                            tag.value = '已退款';
-                            tag.type = 'danger';
-                        } else{
-                            tag.value = '正常';
-                            tag.type = 'success';
-                        }
-                        return tag;
-                    }
-                },
-                { 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: "specs_name", 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,sortable: true },
+	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',
+			},
+			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: '聚水潭'
+					},
+					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';
+						}
+						return tag;
+					}
+				},
+				// { field: "trade_from", title: "平台" },
+				{
+					field: 'trade_from',
+					title: __('平台'),
+					operate: "select",
+					searchList:Yunqi.data.trade_from_item_list
+				},
+				{
+					field: "province",
+					title: "省份",
+					operate: false
+				},
+				{
+					field: "city",
+					title: "城市",
+					operate: false
+				},
+				{
+					field: "company_name",
+					title: "快递名称",
+					operate: false
+				},
+				{
+					field: "waybill_no",
+					title: "快递单号"
+				},
+				{
+					field: "order_status",
+					fixed: 'right',
+					title: "订单状态",
+					operate: "select",
+					searchList: {
+						'Sent': "正常",
+						'OuterSent': "外部已发货",
+						'SentCancelled': "已退款(聚水潭)",
+						'TRADE_CLOSED': "已退款(风速)"
+					},
+					formatter: function(data, row) {
+						let tag = Yunqi.formatter.tag;
+						if (row.order_status == 'OuterSent') {
+							tag.value = '外部已发货';
+							tag.type = 'warning';
+						} else if (row.order_status == 'SentCancelled') {
+							tag.value = '已退款';
+							tag.type = 'danger';
+						} else if (row.order_status == 'TRADE_CLOSED') {
+							tag.value = '已退款';
+							tag.type = 'danger';
+						} else {
+							tag.value = '正常';
+							tag.type = 'success';
+						}
+						return tag;
+					}
+				},
+				{
+					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:"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: function (data, row) {
-                        let tag = Yunqi.formatter.tag;
-                        if (row.status == 1) {
-                            tag.value = '无店铺';
-                            tag.type = 'danger';
-                        } else if (row.status == 2) {
-                            tag.value = '无Sku';
-                            tag.type = 'warning';
-                        } else if (row.status == 3) {
-                            tag.value = '正常';
-                            tag.type = 'success';
-                        }
-                        return tag;
-                    }
-                },
-                {
-                    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) {
-                                return row.status == 2;
-                            }
-                        },
-                        edit: {
-                            tooltip: true,
-                            icon: 'fa fa-pencil',
-                            type: 'primary',
-                            text: __('修改关联规格,且只能修改当天发货订单'),
-                            method: 'specs',
-                            visible: function (row, index) {
-                                return row.status == 3;
-                            }
-                        },
-                        // del: true
-                    }
-                }
-            ],
-            totalArr: [
+				{
+					field: "specs_name",
+					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,
+					sortable: true
+				},
 
-            ],
-        },
-        methods: {
-            handleData(data) {
-                console.log(data)
-                this.totalArr = [
-                    {
-                        name: "无店铺",
-                        value: data.shops_num
-                    }, {
-                        name: "无Sku",
-                        value: data.specs_num
-                    }
-                ]
-            },
-            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();
-                        }
-                    }
-                })
+				// {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: function(data, row) {
+						let tag = Yunqi.formatter.tag;
+						if (row.status == 1) {
+							tag.value = '无店铺';
+							tag.type = 'danger';
+						} else if (row.status == 2) {
+							tag.value = '无Sku';
+							tag.type = 'warning';
+						} else if (row.status == 3) {
+							tag.value = '正常';
+							tag.type = 'success';
+						}
+						return tag;
+					}
+				},
+				{
+					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) {
+								return row.status == 2;
+							}
+						},
+						edit: {
+							tooltip: true,
+							icon: 'fa fa-pencil',
+							type: 'primary',
+							text: __('修改关联规格,且只能修改当天发货订单'),
+							method: 'specs',
+							visible: function(row, index) {
+								return row.status == 3;
+							}
+						},
+						// del: true
+					}
+				}
+			],
+			totalArr: [
 
-            },
-            set_jushuitan: function (row) {
-                let that = this;
-                Yunqi.api.open({
-                    url: 'goods/import_list/set_jushuitan',
-                    width: 1000,
-                    title: __('聚水潭同步数据设置'),
-                    icon: 'fa fa-cog',
-                    close: function (r) {
-                        that.$refs.yuntable.reload();
-                    }
-                });
-            },
-            set_fengsu: function (row) {
-                let that = this;
-                Yunqi.api.open({
-                    url: 'goods/import_list/set_fengsu',
-                    width: 1000,
-                    title: __('风速同步数据设置'),
-                    icon: 'fa fa-cog',
-                    close: function (r) {
-                        that.$refs.yuntable.reload();
-                    }
-                });
-            },
+			],
+		},
+		mounted() {
+			
+		},
+		methods: {
+			handleData(data) {
+				console.log(data)
+				this.totalArr = [{
+					name: "无店铺",
+					value: data.shops_num
+				}, {
+					name: "无Sku",
+					value: data.specs_num
+				}]
+			},
+			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();
+						}
+					}
+				})
 
-        },
-        onLoad: function (query) {
+			},
+			set_jushuitan: function(row) {
+				let that = this;
+				Yunqi.api.open({
+					url: 'goods/import_list/set_jushuitan',
+					width: 1000,
+					title: __('聚水潭同步数据设置'),
+					icon: 'fa fa-cog',
+					close: function(r) {
+						that.$refs.yuntable.reload();
+					}
+				});
+			},
+			set_fengsu: function(row) {
+				let that = this;
+				Yunqi.api.open({
+					url: 'goods/import_list/set_fengsu',
+					width: 1000,
+					title: __('风速同步数据设置'),
+					icon: 'fa fa-cog',
+					close: function(r) {
+						that.$refs.yuntable.reload();
+					}
+				});
+			},
 
+		},
+		onLoad: function(query) {
 
-        }
-    }
+		}
+	}
 </script>
 <style>
 

+ 143 - 102
app/admin/view/goods/import_list/set_fengsu.html

@@ -1,109 +1,150 @@
 <template>
-    <el-card shadow="never" style="border: 0;">
-        <yun-form ref="yunform" :columns="columns" @submit="onSubmit">
-            <template #default>
-
-                <div class="el-form-item__label">
-                    <label for="" style="width: 140px;">请选择开始同步时间(3分钟之前):</label>
-                    <el-date-picker v-model="startTime" type="datetime" format="YYYY-MM-DD HH:mm:ss"
-                        value-format="YYYY-MM-DD HH:mm:ss" />
-                </div>
-            </template>
-        </yun-form>
-    </el-card>
 
+	<div class="form_group">
+		<div class="el-form-item__label_item">
+			当前同步时间(修改请选择3分钟之前)
+		</div>
+		
+		<div v-for="item in startTime_list" class="el-form-item__label_item">
+
+			<div>
+				<div class="name">
+					{{item.name}}
+				</div>
+				<div>
+					:
+				</div>
+				<el-date-picker v-model="item.startTime" type="datetime" format="YYYY-MM-DD HH:mm:ss"
+					value-format="YYYY-MM-DD HH:mm:ss" />
+			</div>
+			<div>
+				<el-button type="primary" @click="onSubmit(item)">确认</el-button>
+			</div>
+
+		</div>
+	</div>
 </template>
 <script>
-    import form from "@components/Form.js";
-    export default {
-        components: {
-            'YunForm': form
-        },
-        data: {
-            columns: [
-
-            ],
-            startTime: Yunqi.data.startTime
-        },
-        //页面加载完成时执行
-        onLoad: function (query) {
-
-
-        },
-        //页面初始显示或在框架内显示时执行
-        onShow: function () {
-
-        },
-        //页面在框架内隐藏时执行
-        onHide: function () {
-
-        },
-        //页面在框架内关闭时执行
-        onUnload: function () {
-
-        },
-        methods: {
-
-            onSubmit: function (rows) {
-                if (this.startTime == '' || this.startTime == null) {
-                    ElementPlus.ElMessage({
-                        type: 'warning',
-                        message: '请选择开始时间',
-                    })
-                    return;
-                }
-                let startTime_tamp = new Date(this.startTime); 
-                startTime_tamp=startTime_tamp.getTime()/ 1000
-
-                let now_tamp = Math.floor(Date.now() / 1000);
-                if((now_tamp-startTime_tamp)<=3*60){
-                    ElementPlus.ElMessage({
-                        type: 'warning',
-                        message: '开始时间3分钟之前',
-                    })
-                    return;
-                }
-                ElementPlus.ElMessageBox.confirm(
-                    '请确认开始同步的时间!',
-                    '提示',
-                    {
-                        confirmButtonText: '确认',
-                        cancelButtonText: '取消',
-                        type: 'warning',
-                    }
-                )
-                    .then(() => {
-                        let data = {
-                            startTime: this.startTime
-                        }
-                        Yunqi.ajax.post('goods/import_list/set_fengsu', data, false, false, true).then(res => {
-                            
-                            if (res.code == 200) {
-                                ElementPlus.ElMessage.success(res.msg)
-                            }else{
-                                ElementPlus.ElMessage.error(res.msg)
-                            }
-                            setTimeout(() => {
-                            Yunqi.api.closelayer(Yunqi.app.window.id, true);
-                            
-                        }, 1000);
-                        })
-
-                    })
-                    .catch(() => {
-
-                    })
-
-            },
-            onSuccess: function (response) {
-                //表单提交成功后执行
-                console.log(response)
-            },
-            onFail: function (err) {
-                //表单提交失败后执行
-            }
-        }
-    }
+	export default {
+
+		data: {
+
+			startTime_list: Yunqi.data.startTime_list
+		},
+		//页面加载完成时执行
+		onLoad: function(query) {
+			console.log(this.startTime_list)
+
+		},
+		//页面初始显示或在框架内显示时执行
+		onShow: function() {
+
+		},
+		//页面在框架内隐藏时执行
+		onHide: function() {
+
+		},
+		//页面在框架内关闭时执行
+		onUnload: function() {
+
+		},
+		methods: {
+
+			onSubmit: function(item) {
+				console.log(item)
+				
+				if (item.startTime == '' || item.startTime == null) {
+					ElementPlus.ElMessage({
+						type: 'warning',
+						message: '请选择开始时间',
+					})
+					return;
+				}
+				let startTime_tamp = new Date(item.startTime);
+				startTime_tamp = startTime_tamp.getTime() / 1000
+
+				let now_tamp = Math.floor(Date.now() / 1000);
+				if ((now_tamp - startTime_tamp) <= 3 * 60) {
+					ElementPlus.ElMessage({
+						type: 'warning',
+						message: '开始时间3分钟之前',
+					})
+					return;
+				}
+				ElementPlus.ElMessageBox.confirm(
+						'请确认开始同步的时间!',
+						'提示', {
+							confirmButtonText: '确认',
+							cancelButtonText: '取消',
+							type: 'warning',
+						}
+					)
+					.then(() => {
+						let data = {
+							type:item.type,
+							startTime: item.startTime
+						}
+						console.log(data)
+						Yunqi.ajax.post('goods/import_list/set_fengsu', data, false, false, true).then(res => {
+							if (res.code == 200) {
+								ElementPlus.ElMessage.success(res.msg)
+							} else {
+								ElementPlus.ElMessage.error(res.msg)
+							}
+							setTimeout(() => {
+								Yunqi.api.closelayer(Yunqi.app.window.id, true);
+
+							}, 1000);
+						})
+
+					})
+					.catch(() => {
+
+					})
+
+			},
+			onSuccess: function(response) {
+				//表单提交成功后执行
+				console.log(response)
+			},
+			onFail: function(err) {
+				//表单提交失败后执行
+			}
+		}
+	}
 </script>
 <style>
+	.form_group {
+		display: flex;
+		flex-direction: column;
+		align-items: flex-start;
+		padding: 30px;
+		gap: 15px;
+
+	}
+
+	.el-form-item__label_item {
+		display: flex !important;
+		gap: 15px;
+		color: var(--el-text-color-regular);
+		font-size: var(--el-form-label-font-size);
+		justify-content: flex-end;
+		padding: 0 12px 0 0;
+	}
+	.el-form-item__label_item>div:first-child{
+		display: flex;
+	}
+	.el-form-item__label_item>div:first-child>div:nth-child(2){
+		margin: 0px 15px;
+	}
+	.name {
+		width: 80px;
+		text-align: justify;
+	}
+	.name::after {
+	    content: '';
+	    display: inline-block;
+	    width: 100%;
+	}
+
 </style>