Просмотр исходного кода

拣货任务-活动单增加结束攒单

zhaohuanhuan 8 месяцев назад
Родитель
Сommit
4725d56a2d
2 измененных файлов с 66 добавлено и 13 удалено
  1. 14 0
      src/api/picking/index.ts
  2. 52 13
      src/views/outbound/picking/task/index.vue

+ 14 - 0
src/api/picking/index.ts

@@ -96,6 +96,19 @@ export function setPickingDetail(data: any[]) {
   })
 }
 
+/**
+ * 结束攒单
+ * @param data
+ */
+export function deleteAndClearOrderUid(params: any) {
+  return request({
+    url: 'api/erp/order/deleteAndClearOrderUid',
+    method: 'post',
+    params
+  })
+}
+
+
 /**
  * 云打印
  * @param data
@@ -109,6 +122,7 @@ export function fluxPrint(data: any) {
 }
 
 
+
 /**
  * 大件拣货
  */

+ 52 - 13
src/views/outbound/picking/task/index.vue

@@ -81,15 +81,36 @@
       </div>
       <div class="order-list">
         <div v-if="model.type=='*'">
-          <van-cell v-for="(item,index) in taskDetailList" class="order-cell" center
-                    is-link value="获取" @click="onSubCreateTask(item)" >
-            <template #title>
-              <div style="display: flex;justify-content:space-evenly;">
-                <div style="width: 65%">{{item.carrierName}}</div>
-                <div style="flex: 1"><span :style="item.hours>=2?'color:#ee0a24;font-weight: 500':''">{{item.residualOrderQty}}单</span></div>
-              </div>
-            </template>
-          </van-cell>
+          <table border="1" style="width: 100%;border-collapse: collapse;text-align: center;table-layout: fixed;font-size: 14px" >
+            <thead>
+            <tr>
+              <th>承运商</th>
+              <th style="width: 60px">数量</th>
+              <th>操作</th>
+            </tr>
+            </thead>
+            <tbody>
+            <tr v-for="(item, rowIndex) in taskDetailList" :key="rowIndex">
+              <td style="word-wrap: break-word" >
+                <div>{{ item.carrierName }}</div>
+              </td>
+              <td style="word-wrap: break-word;"><span :style="item.hours>=2?'color:#ee0a24;font-weight: 500':''">{{item.residualOrderQty}}单</span></td>
+              <td>
+                <van-button type="danger" size="mini" @click="remove(item)" >结束攒单</van-button>
+                <van-button type="primary" size="mini" @click="onSubCreateTask(item)" >获取任务</van-button>
+              </td>
+            </tr>
+            </tbody>
+          </table>
+<!--          <van-cell v-for="(item,index) in taskDetailList" class="order-cell" center-->
+<!--                    is-link value="获取" @click="onSubCreateTask(item)" >-->
+<!--            <template #title>-->
+<!--              <div style="display: flex;justify-content:space-evenly;">-->
+<!--                <div style="width: 65%">{{item.carrierName}}</div>-->
+<!--                <div style="flex: 1"><span :style="item.hours>=2?'color:#ee0a24;font-weight: 500':''">{{item.residualOrderQty}}单</span></div>-->
+<!--              </div>-->
+<!--            </template>-->
+<!--          </van-cell>-->
         </div>
         <div v-else >
           <van-checkbox-group  v-model="checkedResult" @change="checkedResultChange" >
@@ -105,7 +126,7 @@
           </van-checkbox-group>
         </div>
       </div>
-      <div v-if="model.type=='*' && model.province"><van-notice-bar :background="'none'" style="font-size: 12px" :speed="20" :text="model.province" /></div>
+      <div v-if="model.type=='*' && model.province" style="padding: 0 15px"><van-notice-bar :background="'none'" style="font-size: 12px" :speed="20" :text="model.province" /></div>
     </van-dialog>
     <van-dialog v-model:show="createTaskTrueFalseBy"
                 :beforeClose="beforeClose"
@@ -172,10 +193,10 @@ import nodataUrl from '@/assets/nodata.png'
 import { useRoute, useRouter } from 'vue-router'
 import { getTaskList } from '@/views/outbound/picking/task/hooks/task'
 import { computed, defineAsyncComponent, nextTick, ref } from 'vue'
-import { showConfirmDialog, showDialog, showFailToast, showToast } from 'vant'
+import { showConfirmDialog, showDialog, showFailToast, showNotify, showToast } from 'vant'
 import { basicStore } from '@/store/modules/basic'
 import {
-  createPickingTask,
+  createPickingTask, deleteAndClearOrderUid,
   getBigPickingTaskDetail,
   getMixPickActivityOrders,
   getPickingTaskDetail,
@@ -454,6 +475,7 @@ const countRefLength = () => {
     }
   });
 };
+//获取任务
 const onSubCreateTask=(row)=>{
   subModel.value=row
   if(row.residualOrderQty<=60){
@@ -528,7 +550,24 @@ const route = useRoute()
 const onClickLeft = () => {
   goBack()
 };
-
+// 结束攒单
+const remove=(item)=>{
+  showConfirmDialog({
+    title: '温馨提示',
+    message:`您正在结束攒单是否继续`,
+    allowHtml:true,
+    keyboardEnabled:false
+  }).then(() => {
+    showLoading()
+    deleteAndClearOrderUid({ warehouse,uid:item.uid }).then(res => {
+      orderTrueFalseBy.value=false
+      showNotify({ type: 'success', duration: 3000, message: `结束攒单成功,正在刷新数据` })
+      loadData()
+    }).finally(()=>{
+      closeLoading()
+    })
+  }).catch(() => {})
+}
 //查看更多承运人
 const onMore= async (row)=>{
   const carrierArray = row.carrier.split(',').map(code => store.carrierMap[code] || code)