Browse Source

erp完善

flower_mr 3 hours ago
parent
commit
4ce451e1e9
34 changed files with 781 additions and 244 deletions
  1. 1 0
      container/urls.py
  2. 37 0
      container/views.py
  3. 13 1
      erp/views.py
  4. 13 0
      logs/boundBill.log
  5. 3 0
      logs/server.log
  6. 1 0
      templates/dist/spa/css/10.0776afdc.css
  7. 0 1
      templates/dist/spa/css/10.fcf11716.css
  8. 0 1
      templates/dist/spa/css/21.e0fd7d29.css
  9. 1 0
      templates/dist/spa/css/21.f4e6d623.css
  10. 0 1
      templates/dist/spa/css/8.01a63b42.css
  11. 1 0
      templates/dist/spa/css/8.be050028.css
  12. 1 1
      templates/dist/spa/index.html
  13. 0 1
      templates/dist/spa/js/10.6f3e618a.js
  14. BIN
      templates/dist/spa/js/10.6f3e618a.js.gz
  15. 1 0
      templates/dist/spa/js/10.efaa843e.js
  16. BIN
      templates/dist/spa/js/10.efaa843e.js.gz
  17. 0 1
      templates/dist/spa/js/21.6b3615f0.js
  18. BIN
      templates/dist/spa/js/21.6b3615f0.js.gz
  19. 1 0
      templates/dist/spa/js/21.aab9191c.js
  20. BIN
      templates/dist/spa/js/21.aab9191c.js.gz
  21. 0 1
      templates/dist/spa/js/22.7589cb99.js
  22. BIN
      templates/dist/spa/js/22.7589cb99.js.gz
  23. 1 0
      templates/dist/spa/js/22.9a28159a.js
  24. BIN
      templates/dist/spa/js/22.9a28159a.js.gz
  25. 0 1
      templates/dist/spa/js/8.5e566b7e.js
  26. BIN
      templates/dist/spa/js/8.5e566b7e.js.gz
  27. 1 0
      templates/dist/spa/js/8.e373083e.js
  28. BIN
      templates/dist/spa/js/8.e373083e.js.gz
  29. 1 1
      templates/dist/spa/js/app.f04fecdb.js
  30. BIN
      templates/dist/spa/js/app.f04fecdb.js.gz
  31. 4 4
      templates/src/layouts/MainLayout.vue
  32. 217 6
      templates/src/pages/erp/erpasn.vue
  33. 217 5
      templates/src/pages/erp/erpdn.vue
  34. 267 219
      templates/src/pages/task/task.vue

+ 1 - 0
container/urls.py

@@ -34,6 +34,7 @@ re_path(r'^operate/(?P<pk>\d+)/$', views.ContainerOperateViewSet.as_view({
 }), name="ContainerDetail_1"),
 
 path(r'wcs_task/', views.WCSTaskViewSet.as_view({"get": "list", "post": "create"}), name="Task"),
+path(r'send_again/', views.WCSTaskViewSet.as_view({"post": "send_task_to_wcs"}), name="Task"),
 
 path(r'task/', views.TaskViewSet.as_view({"get": "list", "post": "create"}), name="Task"),
 re_path(r'^task/(?P<pk>\d+)/$', views.TaskViewSet.as_view({

+ 37 - 0
container/views.py

@@ -156,7 +156,43 @@ class WCSTaskViewSet(viewsets.ModelViewSet):
             return WCSTaskGetSerializer
         else:
             return self.http_method_not_allowed(request=self.request)
+        
+    def send_task_to_wcs(self, request, *args, **kwargs):
+        data = self.request.data
+        task_id = data.get('taskid')
+        logger.info(f"请求任务:{task_id}")
+        data_return = {}
+        try:
+            task_obj = ContainerWCSModel.objects.get(id=task_id)
+            if not task_obj:
+                data_return = {
+                    'code': '400',
+                    'message': '任务不存在',
+                    'data': data
+                }
+                return Response(data_return, status=status.HTTP_400_BAD_REQUEST)
+            if task_obj.working == 1:
+                OutboundService.send_task_to_wcs(task_obj)
+                data_return = {
+                    'code': '200',
+                    'message': '任务已在执行中,再次下发',
+                    'data': data
+                }
 
+            else:
+                data_return = {
+                    'code': '200',
+                    'message': '任务已执行完成',
+                    'data': data
+                }
+        except ContainerWCSModel.DoesNotExist:
+            data_return = {
+                'code': '404',
+                'message': '任务不存在',
+                'data': data
+            }
+        return Response(data_return, status=status.HTTP_200_OK)
+    
 # 入库任务视图
 class TaskViewSet(viewsets.ModelViewSet):
     """
@@ -376,6 +412,7 @@ class ContainerWCSViewSet(viewsets.ModelViewSet):
                         tasktype='inbound',
                         working=1,
                     )
+                    OutboundService.send_task_to_wcs(current_task)
                     data_return = {
                         'code': '200',
                         'message': '任务下发成功',

+ 13 - 1
erp/views.py

@@ -1466,7 +1466,12 @@ class PurchaseInboundSaveSync(ERPSyncBase):
                  
     def process_erp_response(self, response):
         logger.info("ERP审核响应:",response['message'])
-        # if response['status']:
+        if response['status']:
+            InboundBillOperateLog.objects.create(
+                billId=self.wms_bill,
+                log_type ='erp_save',
+                log_content = f"保存入库单{self.wms_bill.number}信息",
+            )
             
         return response['status']
 """销售出库保存"""
@@ -1498,6 +1503,13 @@ class SaleOutboundSaveSync(ERPSyncBase):
                  
     def process_erp_response(self, response):
         logger.info("ERP审核响应:",response)
+        if response['status']:
+            OutboundBillOperateLog.objects.create(
+                billId=self.wms_bill,
+                log_type ='erp_save',
+                log_content = f"保存出库单{self.wms_bill.number}信息",
+            )
+
         return response['status']
 
 """审核与保存接口"""

File diff suppressed because it is too large
+ 13 - 0
logs/boundBill.log


+ 3 - 0
logs/server.log

@@ -30515,3 +30515,6 @@ TypeError: release_location() missing 1 required positional argument: 'request'
 [2025-06-09 16:20:44,681][django.server.log_message():187] [INFO] "GET /container/locationdetail/?container=53 HTTP/1.1" 200 453
 [2025-06-09 16:20:44,761][django.server.log_message():187] [INFO] "GET /container/operate/?status=1&container=53 HTTP/1.1" 200 4459
 [2025-06-09 16:20:44,773][django.server.log_message():187] [INFO] "GET /container/containerdetail/?container=53 HTTP/1.1" 200 6421
+[2025-06-09 17:29:20,895][django.request.log_response():241] [WARNING] Not Found: /container/send_again/
+[2025-06-09 22:29:13,189][django.request.log_response():241] [WARNING] Not Found: /wms/boundBills/audit/
+[2025-06-10 00:14:30,254][django.request.log_response():241] [WARNING] Not Found: /wms/boundBills/audit/

File diff suppressed because it is too large
+ 1 - 0
templates/dist/spa/css/10.0776afdc.css


File diff suppressed because it is too large
+ 0 - 1
templates/dist/spa/css/10.fcf11716.css


+ 0 - 1
templates/dist/spa/css/21.e0fd7d29.css

@@ -1 +0,0 @@
-.q-date__calendar-item--selected[data-v-21d19112]{transition:all 0.3s ease;background-color:#1976d2!important}.q-date__range[data-v-21d19112]{background-color:rgba(25,118,210,0.1)}

+ 1 - 0
templates/dist/spa/css/21.f4e6d623.css

@@ -0,0 +1 @@
+.q-date__calendar-item--selected[data-v-44e0a5ca]{transition:all 0.3s ease;background-color:#1976d2!important}.q-date__range[data-v-44e0a5ca]{background-color:rgba(25,118,210,0.1)}

File diff suppressed because it is too large
+ 0 - 1
templates/dist/spa/css/8.01a63b42.css


File diff suppressed because it is too large
+ 1 - 0
templates/dist/spa/css/8.be050028.css


File diff suppressed because it is too large
+ 1 - 1
templates/dist/spa/index.html


File diff suppressed because it is too large
+ 0 - 1
templates/dist/spa/js/10.6f3e618a.js


BIN
templates/dist/spa/js/10.6f3e618a.js.gz


File diff suppressed because it is too large
+ 1 - 0
templates/dist/spa/js/10.efaa843e.js


BIN
templates/dist/spa/js/10.efaa843e.js.gz


File diff suppressed because it is too large
+ 0 - 1
templates/dist/spa/js/21.6b3615f0.js


BIN
templates/dist/spa/js/21.6b3615f0.js.gz


File diff suppressed because it is too large
+ 1 - 0
templates/dist/spa/js/21.aab9191c.js


BIN
templates/dist/spa/js/21.aab9191c.js.gz


File diff suppressed because it is too large
+ 0 - 1
templates/dist/spa/js/22.7589cb99.js


BIN
templates/dist/spa/js/22.7589cb99.js.gz


File diff suppressed because it is too large
+ 1 - 0
templates/dist/spa/js/22.9a28159a.js


BIN
templates/dist/spa/js/22.9a28159a.js.gz


File diff suppressed because it is too large
+ 0 - 1
templates/dist/spa/js/8.5e566b7e.js


BIN
templates/dist/spa/js/8.5e566b7e.js.gz


File diff suppressed because it is too large
+ 1 - 0
templates/dist/spa/js/8.e373083e.js


BIN
templates/dist/spa/js/8.e373083e.js.gz


File diff suppressed because it is too large
+ 1 - 1
templates/dist/spa/js/app.f04fecdb.js


BIN
templates/dist/spa/js/app.f04fecdb.js.gz


+ 4 - 4
templates/src/layouts/MainLayout.vue

@@ -980,15 +980,15 @@ export default {
   mounted () {
     var _this = this
     _this.warehouseOptionsGet()
-    // _this.handleTimer()
+    _this.handleTimer()
     _this.link = localStorage.getItem('menulink')
     Bus.$on('needLogin', (val) => {
       _this.isLoggedIn()
     })
 
-    // _this.timer = setInterval(() => {
-    //   _this.handleTimer();
-    // }, 100000);
+    _this.timer = setInterval(() => {
+      _this.handleTimer();
+    }, 10000);
   },
   // 修改时间 :10000
   updated () {},

+ 217 - 6
templates/src/pages/erp/erpasn.vue

@@ -351,7 +351,6 @@
                   <template>
                     <div class="text-h6 q-mb-md" style="max-width: 800px">
                       {{ "批次信息" }}
-
                     </div>
                     <template v-if="batch_detail.length > 0">
                       <q-table
@@ -437,6 +436,39 @@
                       <div class="q-pa-md col">
                         <q-timeline color="primary">
                           <q-timeline-entry
+                            v-for="(stage, stageIndex) in getTimelineStages(
+                              table_detail.type
+                            )"
+                            :key="stageIndex"
+                            :subtitle="stage.timestamp"
+                            side="left"
+                          >
+                            <div class="row items-center">
+                              <q-btn
+                                round
+                                dense
+                                flat
+                                :icon="stage.icon"
+                                :color="stage.color"
+                                class="q-mr-sm"
+                                @click="checkStage(stage)"
+                              />
+                              <q-expansion-item
+                                class="col"
+                                v-model="stage.expanded"
+                                expand-icon-class="text-primary"
+                                :label="stage.title"
+                                header-class="text-primary"
+                              >
+                                <div class="q-pl-md">
+                                  <div class="text-body2">
+                                    {{ stage.content }}
+                                  </div>
+                                </div>
+                              </q-expansion-item>
+                            </div>
+                          </q-timeline-entry>
+                          <!-- <q-timeline-entry
                             v-for="(item, index) in timeline"
                             :key="index"
                             :subtitle="item.timestamp"
@@ -447,8 +479,8 @@
                                 round
                                 dense
                                 flat
-                                icon="done_outline"
-                                color="primary"
+                                :icon="getButtonIcon(item)"
+                                :color="getButtonColor(item)"
                                 class="q-mr-sm"
                                 @click="check_erp(item)"
                               />
@@ -463,7 +495,7 @@
                                   <div class="text-body2">
                                     {{ item.content }}
                                   </div>
-                                  <!-- 可添加更多详情 -->
+
                                   <div
                                     v-if="item.details"
                                     class="text-caption text-grey q-pt-sm"
@@ -473,7 +505,7 @@
                                 </div>
                               </q-expansion-item>
                             </div>
-                          </q-timeline-entry>
+                          </q-timeline-entry> -->
                         </q-timeline>
                       </div>
                     </div>
@@ -590,7 +622,7 @@ export default {
           align: 'center'
         },
         {
-          name: 'id',
+          name: 'entryid',
           label: '详单ID',
           field: (row) => row.entryIds,
           align: 'center'
@@ -700,6 +732,185 @@ export default {
     }
   },
   methods: {
+    // 检查阶段处理
+    checkStage (stage) {
+      const _this = this
+
+      if (stage.type === 1) {
+        // 业务汇报阶段处理
+        _this.get_log_list()
+      } else if (stage.type === 2) {
+        // 业务审核阶段处理
+        postauth('wms/boundBills/audit/', {
+          billid: _this.detailid,
+          billtype: _this.detail_type,
+          billbase: 0
+        }).catch((err) => {
+          _this.$q.notify({
+            message: err.detail || '审核失败',
+            icon: 'close',
+            color: 'negative'
+          })
+        })
+      } else if (stage.type === 3) {
+        // 业务保存阶段处理
+        postauth('wms/boundBills/save/', {
+          billid: _this.detailid,
+          billtype: _this.detail_type,
+          billbase: 0
+        })
+      }
+    },
+    // 根据业务类型获取时间线阶段
+    getTimelineStages (billType) {
+      const stageDefinitions = {
+        1: [
+          // 生产入库申请 (类型1)
+          {
+            type: 1,
+            icon: '1',
+            color: 'primary',
+            timestamp: '入库汇报',
+            title: '生产汇报'
+          },
+          {
+            type: 2,
+            icon: 'verified',
+            color: 'orange',
+            timestamp: '生产审核',
+            title: '生产审核'
+          }
+          // {
+          //   type: 3,
+          //   icon: "save",
+          //   color: "green",
+          //   timestamp: "入库保存",
+          //   title: "生产入库",
+          // },
+        ],
+        2: [
+          // 采购入库申请 (类型2)
+          {
+            type: 1,
+            icon: '1',
+            color: 'primary',
+            timestamp: '采购汇报',
+            title: '采购单据'
+          },
+          {
+            type: 2,
+            icon: 'verified',
+            color: 'orange',
+            timestamp: '验收审核',
+            title: '采购验收'
+          },
+          {
+            type: 3,
+            icon: 'save',
+            color: 'green',
+            timestamp: '采购保存',
+            title: '采购入库'
+          }
+        ],
+        3: [
+          // 其他入库 (类型3)
+          {
+            type: 1,
+            icon: '1',
+            color: 'primary',
+            timestamp: '入库准备',
+            title: '入库准备'
+          },
+          {
+            type: 2,
+            icon: 'verified',
+            color: 'orange',
+            timestamp: '验收审核',
+            title: '入库审核'
+          }
+          // {
+          //   type: 3,
+          //   icon: "save",
+          //   color: "green",
+          //   timestamp: "入库完成",
+          //   title: "入库完成",
+          // },
+        ],
+        4: [
+          // 调拨入库 (类型4)
+          {
+            type: 1,
+            icon: '1',
+            color: 'primary',
+            timestamp: '调拨发起',
+            title: '调拨单据'
+          },
+          {
+            type: 2,
+            icon: 'verified',
+            color: 'orange',
+            timestamp: '调拨审核',
+            title: '调拨审核'
+          }
+          // {
+          //   type: 3,
+          //   icon: "save",
+          //   color: "green",
+          //   timestamp: "调拨入库",
+          //   title: "调拨完成",
+          // },
+        ],
+        // 默认类型
+        default: [
+          {
+            type: 1,
+            icon: '1',
+            color: 'primary',
+            timestamp: '业务开始',
+            title: '业务开始'
+          },
+          {
+            type: 2,
+            icon: 'verified',
+            color: 'orange',
+            timestamp: '业务处理',
+            title: '业务处理'
+          },
+          {
+            type: 3,
+            icon: 'save',
+            color: 'green',
+            timestamp: '业务完成',
+            title: '业务完成'
+          }
+        ]
+      }
+
+      // 获取对应业务类型的阶段定义
+      const stages = stageDefinitions[billType] || stageDefinitions.default
+
+      // 返回带有默认值的副本
+      return stages.map((stage) => ({
+        expanded: true,
+        content: '暂无',
+        ...stage
+      }))
+    },
+    getButtonIcon (item) {
+      // 根据业务类型决定图标
+      if (item.type === 1) return '1' // 入库汇报
+      if (item.type === 2) return 'verified' // 入库审核
+      if (item.type === 3) return 'save' // 入库保存
+      return 'help' // 默认图标
+    },
+
+    getButtonColor (item) {
+      // 根据业务类型决定颜色
+      if (item.type === 1) return 'primary' // 蓝色
+      if (item.type === 2) return 'orange' // 橙色
+      if (item.type === 3) return 'green' // 绿色
+      return 'grey' // 默认颜色
+    },
     check_erp (item) {
       var _this = this
       if (item.type === 1) {

+ 217 - 5
templates/src/pages/erp/erpdn.vue

@@ -436,6 +436,39 @@
                       <div class="q-pa-md col">
                         <q-timeline color="primary">
                           <q-timeline-entry
+                            v-for="(stage, stageIndex) in getTimelineStages(
+                              table_detail.type
+                            )"
+                            :key="stageIndex"
+                            :subtitle="stage.timestamp"
+                            side="left"
+                          >
+                            <div class="row items-center">
+                              <q-btn
+                                round
+                                dense
+                                flat
+                                :icon="stage.icon"
+                                :color="stage.color"
+                                class="q-mr-sm"
+                                @click="checkStage(stage)"
+                              />
+                              <q-expansion-item
+                                class="col"
+                                v-model="stage.expanded"
+                                expand-icon-class="text-primary"
+                                :label="stage.title"
+                                header-class="text-primary"
+                              >
+                                <div class="q-pl-md">
+                                  <div class="text-body2">
+                                    {{ stage.content }}
+                                  </div>
+                                </div>
+                              </q-expansion-item>
+                            </div>
+                          </q-timeline-entry>
+                          <!-- <q-timeline-entry
                             v-for="(item, index) in timeline"
                             :key="index"
                             :subtitle="item.timestamp"
@@ -446,8 +479,8 @@
                                 round
                                 dense
                                 flat
-                                icon="done_outline"
-                                color="primary"
+                                :icon="getButtonIcon(item)"
+                                :color="getButtonColor(item)"
                                 class="q-mr-sm"
                                 @click="check_erp(item)"
                               />
@@ -462,7 +495,7 @@
                                   <div class="text-body2">
                                     {{ item.content }}
                                   </div>
-                                  <!-- 可添加更多详情 -->
+
                                   <div
                                     v-if="item.details"
                                     class="text-caption text-grey q-pt-sm"
@@ -472,7 +505,7 @@
                                 </div>
                               </q-expansion-item>
                             </div>
-                          </q-timeline-entry>
+                          </q-timeline-entry> -->
                         </q-timeline>
                       </div>
                     </div>
@@ -589,7 +622,7 @@ export default {
           align: 'center'
         },
         {
-          name: 'id',
+          name: 'entryid',
           label: '详单ID',
           field: (row) => row.entryIds,
           align: 'center'
@@ -699,6 +732,185 @@ export default {
     }
   },
   methods: {
+    // 检查阶段处理
+    checkStage (stage) {
+      const _this = this
+
+      if (stage.type === 1) {
+        // 业务汇报阶段处理
+        _this.get_log_list()
+      } else if (stage.type === 2) {
+        // 业务审核阶段处理
+        postauth('wms/boundBills/audit/', {
+          billid: _this.detailid,
+          billtype: _this.detail_type,
+          billbase: 1
+        }).catch((err) => {
+          _this.$q.notify({
+            message: err.detail || '审核失败',
+            icon: 'close',
+            color: 'negative'
+          })
+        })
+      } else if (stage.type === 3) {
+        // 业务保存阶段处理
+        postauth('wms/boundBills/save/', {
+          billid: _this.detailid,
+          billtype: _this.detail_type,
+          billbase: 1
+        })
+      }
+    },
+    // 根据业务类型获取时间线阶段
+    getTimelineStages (billType) {
+      const stageDefinitions = {
+        1: [
+          // 销售出库申请 (类型1)
+          {
+            type: 1,
+            icon: '1',
+            color: 'primary',
+            timestamp: '出库汇报',
+            title: '销售出库'
+          },
+          // {
+          //   type: 2,
+          //   icon: 'verified',
+          //   color: 'orange',
+          //   timestamp: '生产审核',
+          //   title: '生产审核'
+          // }
+          {
+            type: 3,
+            icon: "save",
+            color: "green",
+            timestamp: "出库保存",
+            title: "销售出库",
+          },
+        ],
+        2: [
+          // 生产领料申请 (类型2)
+          {
+            type: 1,
+            icon: '1',
+            color: 'primary',
+            timestamp: '领料申请',
+            title: '领料申请'
+          },
+          {
+            type: 2,
+            icon: 'verified',
+            color: 'orange',
+            timestamp: '领料审核',
+            title: '领料审核'
+          },
+          // {
+          //   type: 3,
+          //   icon: 'save',
+          //   color: 'green',
+          //   timestamp: '采购保存',
+          //   title: '采购入库'
+          // }
+        ],
+        3: [
+          // 其他出库申请 (类型3)
+          {
+            type: 1,
+            icon: '1',
+            color: 'primary',
+            timestamp: '出库申请',
+            title: '出库申请'
+          },
+          {
+            type: 2,
+            icon: 'verified',
+            color: 'orange',
+            timestamp: '出库审核',
+            title: '出库审核'
+          },
+          // {
+          //   type: 3,
+          //   icon: "save",
+          //   color: "green",
+          //   timestamp: "入库完成",
+          //   title: "入库完成",
+          // },
+        ],
+        4: [
+          // 调拨入库 (类型4)
+          {
+            type: 1,
+            icon: '1',
+            color: 'primary',
+            timestamp: '调拨发起',
+            title: '调拨单据'
+          },
+          {
+            type: 2,
+            icon: 'verified',
+            color: 'orange',
+            timestamp: '调拨审核',
+            title: '调拨审核'
+          }
+          // {
+          //   type: 3,
+          //   icon: "save",
+          //   color: "green",
+          //   timestamp: "调拨入库",
+          //   title: "调拨完成",
+          // },
+        ],
+        // 默认类型
+        default: [
+          {
+            type: 1,
+            icon: '1',
+            color: 'primary',
+            timestamp: '业务开始',
+            title: '业务开始'
+          },
+          {
+            type: 2,
+            icon: 'verified',
+            color: 'orange',
+            timestamp: '业务处理',
+            title: '业务处理'
+          },
+          {
+            type: 3,
+            icon: 'save',
+            color: 'green',
+            timestamp: '业务完成',
+            title: '业务完成'
+          }
+        ]
+      }
+
+      // 获取对应业务类型的阶段定义
+      const stages = stageDefinitions[billType] || stageDefinitions.default
+
+      // 返回带有默认值的副本
+      return stages.map((stage) => ({
+        expanded: true,
+        content: '暂无',
+        ...stage
+      }))
+    },
+    getButtonIcon (item) {
+      // 根据业务类型决定图标
+      if (item.type === 1) return '1' // 入库汇报
+      if (item.type === 2) return 'verified' // 入库审核
+      if (item.type === 3) return 'save' // 入库保存
+      return 'help' // 默认图标
+    },
+
+    getButtonColor (item) {
+      // 根据业务类型决定颜色
+      if (item.type === 1) return 'primary' // 蓝色
+      if (item.type === 2) return 'orange' // 橙色
+      if (item.type === 3) return 'green' // 绿色
+      return 'grey' // 默认颜色
+    },
     check_erp (item) {
       var _this = this
       if (item.type === 1) {

+ 267 - 219
templates/src/pages/task/task.vue

@@ -89,8 +89,27 @@
         </template>
         <template v-slot:body="props">
           <q-tr :props="props">
+            <q-td key="id" :props="props" style="width: 100px">
+              <q-btn
+                round
+                flat
+                push
+                color="dark"
+                icon="send"
+                @click="sendTask(props.row)"
+              >
+                <q-tooltip
+                  content-class="bg-amber text-black shadow-4"
+                  :offset="[10, 10]"
+                  content-style="font-size: 12px"
+                  >{{ "WCS长时间未收到" }}</q-tooltip
+                >
+              </q-btn>
+            </q-td>
             <q-td
-              v-for="col in columns.filter((c) => c.name !== 'action')"
+              v-for="col in columns.filter(
+                (c) => c.name !== 'action' && c.name !== 'id'
+              )"
               :key="col.name"
               :props="props"
             >
@@ -126,7 +145,7 @@
                     content-class="bg-amber text-black shadow-4"
                     :offset="[10, 10]"
                     content-style="font-size: 12px"
-                    >{{ '手动确认到位'}}</q-tooltip
+                    >{{ "手动确认到位" }}</q-tooltip
                   >
                 </q-btn>
               </q-td>
@@ -241,91 +260,102 @@
 <router-view />
 
 <script>
-import { getauth, postauth, putauth, deleteauth } from 'boot/axios_request'
-import { date, exportFile, LocalStorage } from 'quasar'
+import { getauth, postauth, putauth, deleteauth } from "boot/axios_request";
+import { date, LocalStorage } from "quasar";
 
 export default {
-  name: 'Pageflowlist',
-  data () {
+  name: "Pageflowlist",
+  data() {
     return {
-      createDate1: '',
-      createDate2: '',
-      date_range: '',
-      proxyDate: '',
-      date: '',
-      goods_code: '',
-      goods_desc: '',
-      openid: '',
-      login_name: '',
-      authin: '0',
-      searchUrl: '',
-      pathname: 'container/wcs_task/',
-      finishtaskUrl: 'container/container_wcs/',
-      pathname_previous: '',
-      pathname_next: '',
-      separator: 'cell',
+      createDate1: "",
+      createDate2: "",
+      date_range: "",
+      proxyDate: "",
+      date: "",
+      goods_code: "",
+      goods_desc: "",
+      openid: "",
+      login_name: "",
+      authin: "0",
+      searchUrl: "",
+      pathname: "container/wcs_task/",
+      finishtaskUrl: "container/container_wcs/",
+      pathname_previous: "",
+      pathname_next: "",
+      separator: "cell",
       loading: false,
-      height: '',
+      height: "",
       viewForm: false,
 
       table_list: [],
 
       columns: [
         {
-          name: 'tasknumber',
+          name: "id",
+          label: "任务",
+          align: "center",
+          field: "id",
+          sortable: true,
+        },
+
+        {
+          name: "tasknumber",
           required: true,
-          label: '任务ID',
-          align: 'center',
-          field: 'tasknumber'
+          label: "任务ID",
+          align: "center",
+          field: "tasknumber",
         },
         {
-          name: 'tasktype',
-          label: '任务类型',
-          field: 'tasktype',
-          align: 'center'
+          name: "tasktype",
+          label: "任务类型",
+          field: "tasktype",
+          align: "center",
+          sortable: true,
         },
         {
-          name: 'container',
-          label: '托盘号',
-          field: 'container',
-          align: 'center'
+          name: "container",
+          label: "托盘号",
+          field: "container",
+          align: "center",
+          sortable: true,
         },
         {
-          name: 'current_location',
-          label: '任务起始位置',
-          field: 'current_location',
-          align: 'center'
+          name: "current_location",
+          label: "任务起始位置",
+          field: "current_location",
+          align: "center",
         },
         {
-          name: 'target_location',
-          label: '任务目标位置',
-          field: 'target_location',
-          align: 'center'
+          name: "target_location",
+          label: "任务目标位置",
+          field: "target_location",
+          align: "center",
         },
         {
-          name: 'working',
-          label: '工作状态',
-          field: 'working',
-          align: 'center'
+          name: "working",
+          label: "工作状态",
+          field: "working",
+          align: "center",
+          sortable: true,
         },
         {
-          name: 'message',
-          label: '备注',
-          field: 'message',
-          align: 'center'
+          name: "message",
+          label: "备注",
+          field: "message",
+          align: "center",
         },
         {
-          name: 'create_time',
-          label: '创建时间',
-          field: 'create_time',
-          align: 'center'
+          name: "create_time",
+          label: "创建时间",
+          field: "create_time",
+          align: "center",
         },
-        { name: 'action', label: '操作', align: 'center' }
+        { name: "action", label: "操作", align: "center" },
       ],
-      filter: '',
+      filter: "",
       pagination: {
         page: 1,
-        rowsPerPage: 11
+        rowsPerPage: 11,
       },
 
       editid: 0,
@@ -333,271 +363,289 @@ export default {
       editMode: false,
       deleteForm: false,
       deleteid: 0,
-      bar_code: '',
-      error1: this.$t('goods.view_goodslist.error1'),
-      error2: this.$t('goods.view_goodslist.error2'),
-      error3: this.$t('goods.view_goodslist.error3'),
-      error4: this.$t('goods.view_goodslist.error4'),
-      error5: this.$t('goods.view_goodslist.error5'),
-      error6: this.$t('goods.view_goodslist.error6'),
-      error7: this.$t('goods.view_goodslist.error7'),
-      error8: this.$t('goods.view_unit.error1'),
-      error9: this.$t('goods.view_class.error1'),
-      error10: this.$t('goods.view_brand.error1'),
-      error11: this.$t('goods.view_color.error1'),
-      error12: this.$t('goods.view_shape.error1'),
-      error13: this.$t('goods.view_specs.error1'),
-      error14: this.$t('goods.view_origin.error1'),
-      error15: this.$t('goods.view_goodslist.error8'),
-      error16: this.$t('goods.view_goodslist.error9'),
+      bar_code: "",
+      error1: this.$t("goods.view_goodslist.error1"),
+      error2: this.$t("goods.view_goodslist.error2"),
+      error3: this.$t("goods.view_goodslist.error3"),
+      error4: this.$t("goods.view_goodslist.error4"),
+      error5: this.$t("goods.view_goodslist.error5"),
+      error6: this.$t("goods.view_goodslist.error6"),
+      error7: this.$t("goods.view_goodslist.error7"),
+      error8: this.$t("goods.view_unit.error1"),
+      error9: this.$t("goods.view_class.error1"),
+      error10: this.$t("goods.view_brand.error1"),
+      error11: this.$t("goods.view_color.error1"),
+      error12: this.$t("goods.view_shape.error1"),
+      error13: this.$t("goods.view_specs.error1"),
+      error14: this.$t("goods.view_origin.error1"),
+      error15: this.$t("goods.view_goodslist.error8"),
+      error16: this.$t("goods.view_goodslist.error9"),
       current: 1,
       max: 0,
       total: 0,
-      paginationIpt: 1
-    }
+      paginationIpt: 1,
+    };
   },
   computed: {
-    interval () {
+    interval() {
       return (
-        this.$t('download_center.start') +
-        ' - ' +
-        this.$t('download_center.end')
-      )
-    }
+        this.$t("download_center.start") +
+        " - " +
+        this.$t("download_center.end")
+      );
+    },
   },
   methods: {
-    finishtask (row) {
+    sendTask(row) {
+      postauth("container/send_again/", { taskid: row.id })
+        .then((res) => {
+          this.$q.notify({
+            message: res.message,
+            icon: "check",
+            color: "green",
+          });
+          this.getSearchList();
+        })
+        .catch((err) => {
+          this.$q.notify({
+            message: err.message,
+            icon: "close",
+            color: "negative",
+          });
+        });
+    },
+    finishtask(row) {
       putauth(this.finishtaskUrl, {
         taskNumber: row.tasknumber - 20000000000,
         container_number: row.container,
-        current_location: row.target_location
+        current_location: row.target_location,
       }).then((res) => {
         this.$q.notify({
-          message: '手动切换任务状态成功',
-          icon: 'check',
-          color: 'green',
-          position: 'bottom-right', // 核心定位参数
+          message: "手动切换任务状态成功",
+          icon: "check",
+          color: "green",
+          position: "bottom-right", // 核心定位参数
           timeout: 2500, // 推荐与操作节奏匹配的时长
-          actions: [{ icon: 'close', color: 'white' }] // 添加关闭按钮提升交互
-        })
-        this.getSearchList()
-      })
+          actions: [{ icon: "close", color: "white" }], // 添加关闭按钮提升交互
+        });
+        this.getSearchList();
+      });
     },
-    getList (params = {}) {
-      var _this = this
-      _this.loading = true
+    getList(params = {}) {
+      var _this = this;
+      _this.loading = true;
       // 合并基础参数
       const baseParams = {
         page: _this.current,
-        page_size: _this.pagination.rowsPerPage
-      }
+        page_size: _this.pagination.rowsPerPage,
+      };
 
       // 创建URLSearchParams处理参数
       const queryParams = new URLSearchParams({
         ...baseParams,
-        ...params
-      })
-      console.log(queryParams)
+        ...params,
+      });
+      console.log(queryParams);
       // 过滤空值参数
       Array.from(queryParams.entries()).forEach(([key, value]) => {
-        if (value === '' || value === null || value === undefined) {
-          queryParams.delete(key)
+        if (value === "" || value === null || value === undefined) {
+          queryParams.delete(key);
         }
-      })
+      });
 
       getauth(`${_this.pathname}?${queryParams}`)
         .then((res) => {
-          _this.table_list = res.results
-          _this.total = res.count
-          _this.max = Math.ceil(res.count / _this.pagination.rowsPerPage) || 0
-          _this.pathname_previous = res.previous
-          _this.pathname_next = res.next
+          _this.table_list = res.results;
+          _this.total = res.count;
+          _this.max = Math.ceil(res.count / _this.pagination.rowsPerPage) || 0;
+          _this.pathname_previous = res.previous;
+          _this.pathname_next = res.next;
         })
         .catch((err) => {
           _this.$q.notify({
             message: err.detail,
-            icon: 'close',
-            color: 'negative'
-          })
+            icon: "close",
+            color: "negative",
+          });
         })
         .finally(() => {
-          _this.loading = false
-        })
+          _this.loading = false;
+        });
     },
-    changePageEnter () {
+    changePageEnter() {
       if (Number(this.paginationIpt) < 1) {
-        this.current = 1
-        this.paginationIpt = 1
+        this.current = 1;
+        this.paginationIpt = 1;
       } else if (Number(this.paginationIpt) > this.max) {
-        this.current = this.max
-        this.paginationIpt = this.max
+        this.current = this.max;
+        this.paginationIpt = this.max;
       } else {
-        this.current = Number(this.paginationIpt)
+        this.current = Number(this.paginationIpt);
       }
-      this.getSearchList(this.current)
+      this.getSearchList(this.current);
     },
 
     // 带搜索条件加载
-    getSearchList (page = 1) {
-      this.current = page
-      this.paginationIpt = page
+    getSearchList(page = 1) {
+      this.current = page;
+      this.paginationIpt = page;
       this.getList({
         goods_desc__icontains: this.filter,
-        create_time__range: this.date_range
-      })
+        create_time__range: this.date_range,
+      });
     },
 
-    getListPrevious () {
-      var _this = this
-      if (LocalStorage.has('auth')) {
+    getListPrevious() {
+      var _this = this;
+      if (LocalStorage.has("auth")) {
         getauth(_this.pathname_previous, {})
           .then((res) => {
-            _this.table_list = res.results
-            _this.pathname_previous = res.previous
-            _this.pathname_next = res.next
+            _this.table_list = res.results;
+            _this.pathname_previous = res.previous;
+            _this.pathname_next = res.next;
           })
           .catch((err) => {
             _this.$q.notify({
               message: err.detail,
-              icon: 'close',
-              color: 'negative'
-            })
-          })
+              icon: "close",
+              color: "negative",
+            });
+          });
       } else {
       }
     },
-    getListNext () {
-      var _this = this
-      if (LocalStorage.has('auth')) {
+    getListNext() {
+      var _this = this;
+      if (LocalStorage.has("auth")) {
         getauth(_this.pathname_next, {})
           .then((res) => {
-            _this.table_list = res.results
+            _this.table_list = res.results;
 
-            _this.pathname_previous = res.previous
-            _this.pathname_next = res.next
+            _this.pathname_previous = res.previous;
+            _this.pathname_next = res.next;
           })
           .catch((err) => {
             _this.$q.notify({
               message: err.detail,
-              icon: 'close',
-              color: 'negative'
-            })
-          })
+              icon: "close",
+              color: "negative",
+            });
+          });
       }
     },
-    reFresh () {
-      var _this = this
-      _this.getSearchList()
+    reFresh() {
+      var _this = this;
+      _this.getSearchList();
     },
 
-    deleteData (e) {
-      var _this = this
-      _this.deleteForm = true
-      _this.deleteid = e
+    deleteData(e) {
+      var _this = this;
+      _this.deleteForm = true;
+      _this.deleteid = e;
     },
-    deleteDataSubmit () {
-      var _this = this
-      deleteauth(_this.pathname + _this.deleteid + '/')
+    deleteDataSubmit() {
+      var _this = this;
+      deleteauth(_this.pathname + _this.deleteid + "/")
         .then((res) => {
-          _this.deleteDataCancel()
-          _this.getSearchList()
+          _this.deleteDataCancel();
+          _this.getSearchList();
           _this.$q.notify({
-            message: 'Success Edit Data',
-            icon: 'check',
-            color: 'green'
-          })
+            message: "Success Edit Data",
+            icon: "check",
+            color: "green",
+          });
         })
         .catch((err) => {
           _this.$q.notify({
             message: err.detail,
-            icon: 'close',
-            color: 'negative'
-          })
-        })
+            icon: "close",
+            color: "negative",
+          });
+        });
     },
-    deleteDataCancel () {
-      var _this = this
-      _this.deleteForm = false
-      _this.deleteid = 0
+    deleteDataCancel() {
+      var _this = this;
+      _this.deleteForm = false;
+      _this.deleteid = 0;
     },
 
-    updateProxy () {
-      var _this = this
-      _this.proxyDate = _this.date
-    }
+    updateProxy() {
+      var _this = this;
+      _this.proxyDate = _this.date;
+    },
   },
-  created () {
-    var _this = this
-    if (LocalStorage.has('openid')) {
-      _this.openid = LocalStorage.getItem('openid')
+  created() {
+    var _this = this;
+    if (LocalStorage.has("openid")) {
+      _this.openid = LocalStorage.getItem("openid");
     } else {
-      _this.openid = ''
-      LocalStorage.set('openid', '')
+      _this.openid = "";
+      LocalStorage.set("openid", "");
     }
-    if (LocalStorage.has('login_name')) {
-      _this.login_name = LocalStorage.getItem('login_name')
+    if (LocalStorage.has("login_name")) {
+      _this.login_name = LocalStorage.getItem("login_name");
     } else {
-      _this.login_name = ''
-      LocalStorage.set('login_name', '')
+      _this.login_name = "";
+      LocalStorage.set("login_name", "");
     }
-    if (LocalStorage.has('auth')) {
-      const timeStamp = Date.now()
-      const formattedString = date.formatDate(timeStamp, 'YYYY/MM/DD')
-      _this.date = formattedString
-      console.log(_this.date)
-      _this.authin = '1'
-      _this.getList()
+    if (LocalStorage.has("auth")) {
+      const timeStamp = Date.now();
+      const formattedString = date.formatDate(timeStamp, "YYYY/MM/DD");
+      _this.date = formattedString;
+      console.log(_this.date);
+      _this.authin = "1";
+      _this.getList();
     } else {
-      _this.authin = '0'
+      _this.authin = "0";
     }
   },
-  mounted () {
-    var _this = this
+  mounted() {
+    var _this = this;
     if (_this.$q.platform.is.electron) {
-      _this.height = String(_this.$q.screen.height - 290) + 'px'
+      _this.height = String(_this.$q.screen.height - 290) + "px";
     } else {
-      _this.height = _this.$q.screen.height - 290 + '' + 'px'
+      _this.height = _this.$q.screen.height - 290 + "" + "px";
     }
   },
-  updated () {},
-  destroyed () {},
+  updated() {},
+  destroyed() {},
   // 在 watch 或方法中添加调试代码
   watch: {
-    createDate1 (val) {
+    createDate1(val) {
       if (val) {
         if (val.to) {
-          this.createDate2 = `${val.from} - ${val.to}`
-          this.date_range = `${val.from},${val.to} `
+          this.createDate2 = `${val.from} - ${val.to}`;
+          this.date_range = `${val.from},${val.to} `;
 
           // this.downloadhUrl = this.pathname + 'filelist/?' + 'document_date__range=' + this.date_range
         } else {
-          this.createDate2 = `${val}`
-          this.dateArray = val.split('/')
+          this.createDate2 = `${val}`;
+          this.dateArray = val.split("/");
           this.searchUrl =
             this.pathname +
-            '?' +
-            'document_date__year=' +
+            "?" +
+            "document_date__year=" +
             this.dateArray[0] +
-            '&' +
-            'document_date__month=' +
+            "&" +
+            "document_date__month=" +
             this.dateArray[1] +
-            '&' +
-            'document_date__day=' +
-            this.dateArray[2]
+            "&" +
+            "document_date__day=" +
+            this.dateArray[2];
           // this.downloadhUrl = this.pathname + 'filelist/?' + 'document_date__year=' + this.dateArray[0] + '&' + 'document_date__month=' + this.dateArray[1] + '&' + 'document_date__day=' + this.dateArray[2]
         }
-        this.date_range = this.date_range.replace(/\//g, '-')
+        this.date_range = this.date_range.replace(/\//g, "-");
 
-        this.getSearchList()
-        this.$refs.qDateProxy.hide()
+        this.getSearchList();
+        this.$refs.qDateProxy.hide();
       } else {
-        this.createDate2 = ''
-        this.date_range = ''
-        this.getSearchList()
+        this.createDate2 = "";
+        this.date_range = "";
+        this.getSearchList();
       }
-    }
-  }
-}
+    },
+  },
+};
 </script>
 <style scoped>
 /* 添加在 <style> 中 */