Browse Source

no message

linwenxin 9 months ago
parent
commit
2c034aba76

+ 64 - 5
src/views/workOrder/settleAccountsManagement/shoppingGuideCommission/index.vue

@@ -4,10 +4,10 @@
     :get-list="getList"
     :table-attributes="tableAttributes"
     :table-events="tableEvents"
-    :options-evens-group="optionsEvensGroup"
     :moreParameters="moreParameters"
     :column-parsing="columnParsing"
     :exportList="exportList"
+    :optionsEvensGroup="optionsEvensGroup"
     :operation="operation()"
   >
   </template-page>
@@ -25,12 +25,11 @@ export default {
   mixins: [import_mixin, operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
-        selectColumn: false
+        selectColumn: true,
+        selectable: this.selectable
       },
       // 表格事件
       tableEvents: {
@@ -46,19 +45,66 @@ export default {
     }
   },
   computed: {
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('bulkSettlement', {
+              click: () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.warning('请勾选工单')
+                  return
+                }
+                recycSettleBatchSettle(this.recordSelected.map(item => item.id)).then(res => {
+                  this.$message({ type: 'success', message: `成功!` })
+                  this.$refs.pageRef.refreshList()
+                })
+              }
+            })
+          ]
+        ]
+      ]
+    },
+    //bulkSettlement
     // 更多参数
     moreParameters() {
-      return []
+      return [
+        {
+          name: '状态',
+          key: 'status',
+          value: '',
+          conditions: [
+            {
+              label: '全部',
+              value: ''
+            },
+            {
+              label: '待结算',
+              value: 'ING'
+            },
+            {
+              label: '已完成',
+              value: 'OVER'
+            }
+          ]
+        }
+      ]
     },
     formItems() {
       return []
     }
   },
   methods: {
+    selectable(row, index) {
+      return ['ING'].includes(Object.entries(row.selectMapData.status).find(([key, val]) => val == row.status)?.[0])
+    },
     // 列表请求函数
     getList(p, cb) {
       try {
         var pam = JSON.parse(JSON.stringify(p))
+        if (pam.status) {
+          pam.params.push({ param: 'a.status', compare: '=', value: pam.status })
+        }
         cb && cb(pam)
         return recycSettleShopList(pam)
       } catch (error) {
@@ -77,6 +123,19 @@ export default {
     },
     operation() {
       return this.operationBtn({
+        orderDetails: {
+          click: ({ row, index, column }) => {
+            this.$router.push({
+              name: 'workOrderPool',
+              params: {
+                pageName: row.orderBaseId,
+                pageType: 'detail',
+                pageCode: row.orderBaseId,
+                pagePam: 'workOrderInfo'
+              }
+            })
+          }
+        },
         settleAccounts: {
           conditions: ({ row, index, column }) => {
             return row.status == 'ING'