Jelajahi Sumber

change: crm包裹处理页面.功能迭代.

peter 2 hari lalu
induk
melakukan
e42b50e8d7
1 mengubah file dengan 39 tambahan dan 6 penghapusan
  1. 39 6
      src/pages/shipping-tracking2/index.vue

+ 39 - 6
src/pages/shipping-tracking2/index.vue

@@ -50,6 +50,14 @@
           >
             导出Excel
           </el-button>
+          <el-button
+            :disabled="currentListforEdit.length < 1"
+            size="small"
+            type="danger"
+            @click="reGenerateCurrentListEdit"
+          >
+            放弃下方表格改动
+          </el-button>
           <el-button
             class="custom-button"
             type="primary"
@@ -84,7 +92,7 @@
         </div>
       </div>
       <el-table
-        :data="computedList"
+        :data="currentListforEdit"
         max-height="550"
         size="small"
         :row-style="calcRowStyle"
@@ -186,6 +194,20 @@
             </div> -->
           </template>
         </el-table-column>
+        <!-- :prop="col.prop" -->
+        <el-table-column
+          fixed="right"
+          v-for="col in subColumnList"
+          :key="col.prop"
+          :label="col.label"
+        >
+          <template #default="scope">
+            <div v-if="scope.row.Summary_of_Carton_Dimension.length">
+              {{ scope.row.Summary_of_Carton_Dimension[0][col.prop] || '-' }}
+            </div>
+            <div v-else>-</div>
+          </template>
+        </el-table-column>
       </el-table>
     </div>
   </div>
@@ -292,6 +314,13 @@ const columnList = [
   { label: 'Shipping Country', prop: 'Shipping_Country', width: 120 },
 ]
 
+const subColumnList = [
+  // { label: 'Quantity', prop: 'Quantity', width: 70 },
+  { label: 'Length', prop: 'Length', width: 70 },
+  { label: 'Width', prop: 'Width', width: 70 },
+  { label: 'Height', prop: 'Height', width: 70 },
+]
+
 let userList = ref(new Map())
 let getUserList = () => {
   request
@@ -321,13 +350,17 @@ let getName = (id: string) => {
 // 这两个变量是用来记录 当前筛选tab的, 在保存成功之后刷新数据时重新选上这个tab.
 let currentTypeResearch = ref(1)
 let currentTabResearch = ref('')
+let currentListforEdit = ref([] as any[])
 watch(
   () => currentTab.value,
   (newVal: string) => {
     currentTabResearch.value = newVal
+    reGenerateCurrentListEdit()
   },
 )
-
+let reGenerateCurrentListEdit = () => {
+  currentListforEdit.value = cloneDeep(computedList.value)
+}
 let getList = (type = 1) => {
   currentTypeResearch.value = type // 记录当前搜索类型
   if (
@@ -585,7 +618,7 @@ let exportFunc = () => {
       ? result.Summary_of_Carton_Dimension[0]
       : {}
     // 把箱规的数量, 长度, 宽度, 高度, 重量, 体积等信息放到最后
-    ordered['Quantity'] = temp.Length || '-'
+    // ordered['Quantity'] = temp.Length || '-'
     ordered['Length'] = temp.Length || '-'
     ordered['Width'] = temp.Width || '-'
     ordered['Height'] = temp.Height || '-'
@@ -595,7 +628,7 @@ let exportFunc = () => {
   const sheet1 = XLSX.utils.json_to_sheet(sheetData, {
     header: columnList
       .map((i) => i.label)
-      .concat(['Quantity', 'Length', 'Width', 'Height']),
+      .concat(['Length', 'Width', 'Height']),
   })
 
   const wb = XLSX.utils.book_new()
@@ -608,7 +641,7 @@ let exportFunc = () => {
         return { wpx: i.width ? i.width + 30 : 110 }
       }
     })
-    .concat([{ wpx: 140 }, { wpx: 140 }, { wpx: 140 }, { wpx: 140 }])
+    .concat([{ wpx: 140 }, { wpx: 140 }, { wpx: 140 }])
 
   XLSX.utils.book_append_sheet(wb, sheet1, 'sheet1')
   let name = currentTab.value || '未输入箱规'
@@ -617,7 +650,7 @@ let exportFunc = () => {
 const commit = () => {
   if (loading.value) return
 
-  let data = computedList.value.map((i, index) => {
+  let data = currentListforEdit.value.map((i, index) => {
     return {
       editFlag: i.editFlag,
       index,