Jelajahi Sumber

1.新增表格 操作列 宽度自适应工具方法
2.修改申请提前出库操作逻辑
3.新增我的订单-标记送达

GouGengquan 1 tahun lalu
induk
melakukan
5e86d122d9

+ 3 - 0
src/api/modules/assets.js

@@ -145,5 +145,8 @@ export default {
     // 条件查询资产已终止列表
     selectRepertoryPage(params){
         return request.get(`assets/selectRepertoryPage`, { params: params })
+    },
+    markDelivery(params){
+        return request.get(`assetsProduction/markDelivery/${params}`)
     }
 }

+ 34 - 0
src/utils/tableUtil.js

@@ -0,0 +1,34 @@
+/**
+ * 获取操作列最大宽度
+ * @returns 
+ */
+export function getOperatorWidth() {
+    // 默认宽度
+    let width = 100
+    // 内间距
+    let paddingSpacing = 5
+    // 外边距
+    let margin = 20;
+
+    const operatorColumn = document.getElementsByClassName('optionDiv')
+    // 如果节点数量大于0-循环这个节点,
+    if (operatorColumn.length > 0) {
+        let buttonCount = 0;
+        for (let i = 0; i < operatorColumn.length; i++) {
+            // 最宽的宽度
+            width = width > operatorColumn[i].offsetWidth ? width : operatorColumn[i].offsetWidth;
+
+            // 计算 <el-button> 标签的数量
+            const buttons = operatorColumn[i].getElementsByClassName('el-button');
+            buttonCount = buttons.length;
+            buttonCount = buttonCount > buttons.length ? buttonCount : buttons.length;
+        }
+
+        // 如果按钮数量大于2,宽度要加上边距*(按钮数量-1)
+        if (buttonCount > 2) {
+            width += (paddingSpacing * (buttonCount - 1))
+        }
+        width += margin;
+    }
+    return width
+}

+ 10 - 16
src/views/assets/archivedList.vue

@@ -252,22 +252,16 @@ export default {
             })
         },
         orderDetail(row) {
-            if (row.currentNodeCode === 'REPORT_OUT_DEPARTMENT_CHECK') {
-                this.$router.push(`/out/warehouse/check?todoBusinessId=${row.assetsId}&sNo=${row.statementNo}&rNo=${row.reportNo}&tId=${row.recordId}&cId=${row.currentNodeId}&nCode=${row.currentNodeCode}&businessType=ASSET_BUSINESS`)
-                return;
-            } else {
-                this.$router.push({
-                    path: "/assets/orderDetail",
-                    query: {
-                        row: JSON.stringify(row),
-                        back: '/assets/archivedList',
-                        couldEdit: false,
-                        couldBack: false,
-                        disabledStatus: true
-                    }
-                })
-            }
-
+            this.$router.push({
+                path: "/assets/orderDetail",
+                query: {
+                    row: JSON.stringify(row),
+                    back: '/assets/archivedList',
+                    couldEdit: false,
+                    couldBack: false,
+                    disabledStatus: true
+                }
+            })
         }
     }
 }

+ 41 - 13
src/views/assets/myOrderList.vue

@@ -131,20 +131,29 @@
                         <span>{{ row.invoiceRealAmount }}</span>
                     </template>
                 </el-table-column>
-                <el-table-column label="操作" align="center" width="280" fixed="right">
+                <el-table-column label="送达状态" align="center" width="150">
                     <template slot-scope="{row}">
-                        <el-button type="success" size="mini" @click="orderDetail(row)">查看</el-button>
-                        <el-button type="primary" size="mini" @click="openShouldAmountDialog(row)">订单应收款</el-button>
-                        <el-button v-if="row.reportNo !== null" type="success" size="mini"
-                            @click="openProShouldAmountDialog(row)">产品应收款</el-button>
-                        <el-button v-if="row.currentNodeCode === 'REPORT_OUT_APPLY'" type="danger" size="mini"
-                            @click="openRepertoryOutWarehouse(row)">
-                            申请提前出库
-                        </el-button>
-                        <!-- <el-button v-if="row.currentNodeCode === 'REPORT_OUT_APPLY'" type="text"
+                        <el-tag v-if="row.reportDelivery" type='success'>已送达</el-tag>
+                        <el-button type="danger" size="mini"
+                            v-if="(!row.reportDelivery || row.reportDelivery == null) && row.reportRepertoryState">标记送达</el-button>
+                    </template>
+                </el-table-column>
+                <el-table-column label="操作" align="center" :min-width="dynamicWidth" fixed="right">
+                    <template slot-scope="{row}">
+                        <div class="optionDiv" style="white-space: nowrap; display: inline-block">
+                            <el-button type="success" size="mini" @click="orderDetail(row)">查看</el-button>
+                            <el-button type="primary" size="mini" @click="openShouldAmountDialog(row)">订单应收款</el-button>
+                            <el-button v-if="row.reportNo !== null" type="success" size="mini"
+                                @click="openProShouldAmountDialog(row)">产品应收款</el-button>
+                            <el-button v-if="row.currentNodeCode === 'REPORT_OUT_APPLY'" type="danger" size="mini"
+                                @click="openRepertoryOutWarehouse(row)">
+                                申请提前出库
+                            </el-button>
+                            <!-- <el-button v-if="row.currentNodeCode === 'REPORT_OUT_APPLY'" type="text"
                             @click="canceladdRepertoryOutWarehouse(row)">
                             撤销出库申请
-                        </el-button> -->
+                            </el-button> -->
+                        </div>
                     </template>
                 </el-table-column>
             </parentTable>
@@ -224,16 +233,18 @@
 import YPageListLayout from '@/components/YPageListLayout'
 import Breadcrumb from '@/components/Breadcrumb'
 import PermissionButton from '@/components/PermissionButton/PermissionButton'
+import { getOperatorWidth } from '@/utils/tableUtil.js'
 
 export default {
     name: 'AssetsAllList',
     components: {
         Breadcrumb,
         YPageListLayout,
-        PermissionButton,
+        PermissionButton
     },
     data() {
         return {
+            dynamicWidth: 0,
             pageData: { records: [] },
             listLoading: false,
             listQuery: {
@@ -313,6 +324,9 @@ export default {
         // 获取我的资产业务订单
         this.selectMyOrderPage();
     },
+    updated() {
+        this.dynamicWidth = getOperatorWidth();
+    },
     methods: {
         // 无条件分页查询
         selectMyOrderPage() {
@@ -387,7 +401,6 @@ export default {
                 } else {
                     this.productionFundFrom.productionType = 'STATEMENT'
                 }
-                this.productionFundFrom.productionType = row.productionType;
                 this.productionFundFrom.productionShouldAmount = row.productionShouldAmount;
                 this.productionFundFrom.remark = row.remark;
             } else {
@@ -485,6 +498,7 @@ export default {
                         });
                         this.commitNode('PASS', this.outWarehouse.remark);
                         this.repertoryOutWarehouseVisible = false;
+                        this.selectMyOrderPage();
                     } else {
                         this.$notify({
                             title: '失败',
@@ -565,6 +579,7 @@ export default {
                 }
             })
         },
+        // 保存产品应收款
         saveProShouldAmount() {
             this.$refs.productionFundFrom.validate(valid => {
                 if (valid) {
@@ -612,6 +627,19 @@ export default {
                 }
             })
         }
+    },
+    // 标记产品送达
+    markDelivery(row) {
+        this.$api.assets.markDelivery(row.reportNo).then(res => {
+            if (res.code === 200 && res.data) {
+                this.$notify({
+                    title: '成功',
+                    message: '标记送达成功!',
+                    type: 'success',
+                    duration: 1000
+                });
+            }
+        })
     }
 }
 </script>

+ 0 - 1
src/views/assets/orderDetail.vue

@@ -1747,7 +1747,6 @@ export default {
 
     },
     workflowCommitVerify(val, callback) {
-      console.log(val);
       let commit = val.commit;
       let verify = new Object();
       verify.state = true;

+ 18 - 10
src/views/assets/todoList.vue

@@ -219,16 +219,24 @@ export default {
             })
         },
         orderDetail(row) {
-            this.$router.push({
-                path: "/assets/orderDetail",
-                query: {
-                    row: JSON.stringify(row),
-                    back: '/assets/todoList',
-                    couldEdit: true,
-                    couldBack: true,
-                    disabledStatus: true
-                }
-            })
+            if (row.currentNodeCode === 'REPORT_OUT_APPLY') {
+                this.$router.push(`/assets/myOrderList`)
+                return;
+            } else if (row.currentNodeCode === 'REPORT_OUT_DEPARTMENT_CHECK') {
+                this.$router.push(`/out/warehouse/check?todoBusinessId=${row.assetsId}&sNo=${row.statementNo}&rNo=${row.reportNo}&tId=${row.recordId}&cId=${row.currentNodeId}&nCode=${row.currentNodeCode}&businessType=ASSET_BUSINESS`)
+                return;
+            } else {
+                this.$router.push({
+                    path: "/assets/orderDetail",
+                    query: {
+                        row: JSON.stringify(row),
+                        back: '/assets/todoList',
+                        couldEdit: true,
+                        couldBack: true,
+                        disabledStatus: true
+                    }
+                })
+            }
         }
     }
 }