From bd25d9a8a058e8c618ee4188ed5f15a898c0f7e8 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期六, 27 一月 2024 11:43:37 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 platform/src/views/business/dispatchUnit.vue |  116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 116 insertions(+), 0 deletions(-)

diff --git a/platform/src/views/business/dispatchUnit.vue b/platform/src/views/business/dispatchUnit.vue
new file mode 100644
index 0000000..52506af
--- /dev/null
+++ b/platform/src/views/business/dispatchUnit.vue
@@ -0,0 +1,116 @@
+<template>
+    <TableLayout :permissions="['business:dispatchunit:query']">
+        <!-- 鎼滅储琛ㄥ崟 -->
+        <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
+            <el-form-item label="娲鹃仯鍗曚綅" prop="name">
+                <el-input v-model="searchForm.name" placeholder="璇疯緭鍏ョ敤宸ュ崟浣嶅悕绉�" @keypress.enter.native="search"></el-input>
+            </el-form-item>
+            <section>
+                <el-button type="primary" @click="search">鎼滅储</el-button>
+                <el-button @click="reset">閲嶇疆</el-button>
+            </section>
+        </el-form>
+        <!-- 琛ㄦ牸鍜屽垎椤� -->
+        <template v-slot:table-wrap>
+            <ul class="toolbar" v-permissions="['business:dispatchunit:create']">
+                <li><el-button type="primary" @click="$refs.operaDispatchUnitWindow.open('娣诲姞娲鹃仯鍗曚綅')" v-permissions="['business:dispatchunit:create']">鏂板娲鹃仯鍗曚綅</el-button></li>
+            </ul>
+            <el-table
+                v-loading="isWorking.search"
+                :data="tableData.list"
+                stripe
+            >
+                <el-table-column label="搴忓彿" width="80px">
+                    <template slot-scope="scope">
+                        <span>{{scope.$index + 1}}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="name" label="娲鹃仯鍗曚綅"></el-table-column>
+                <el-table-column label="浼佷笟鐘舵��">
+                    <template slot-scope="{row}">
+                        <span v-if="row.unitStatus === 0">寰呭鏍�</span>
+                        <span v-if="row.unitStatus === 1" style="color: green;">瀹℃牳閫氳繃</span>
+                        <span v-if="row.unitStatus === 2" style="color: red;">瀹℃牳涓嶉�氳繃</span>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="createDate" label="娣诲姞鏃ユ湡"></el-table-column>
+                <el-table-column label="鏄惁鍋滅敤">
+                    <template slot-scope="{row}">
+                        <el-switch
+                            @change="changeStatus($event, row)"
+                            v-model="row.status"
+                            active-color="#13ce66"
+                            inactive-color="#ff4949"
+                            :active-value="1"
+                            :inactive-value="0">
+                        </el-switch>
+                    </template>
+                </el-table-column>
+                <el-table-column
+                    v-if="containPermissions(['business:dispatchunit:update', 'business:dispatchunit:delete'])"
+                    label="鎿嶄綔"
+                    min-width="120"
+                    fixed="right"
+                >
+                    <template slot-scope="{row}">
+                        <el-button type="text" @click="$refs.dispatchUnitDetails.open('娲鹃仯鍗曚綅璇︽儏', row)" v-permissions="['business:dispatchunit:update']">鏌ョ湅璇︽儏</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+            <pagination
+                @size-change="handleSizeChange"
+                @current-change="handlePageChange"
+                :pagination="tableData.pagination"
+            >
+            </pagination>
+        </template>
+        <!-- 鏂板缓/淇敼 -->
+        <OperaDispatchUnitWindow ref="operaDispatchUnitWindow" @success="handlePageChange"/>
+        <!-- 璇︽儏 -->
+        <dispatchUnitDetails ref="dispatchUnitDetails" @success="handlePageChange"/>
+    </TableLayout>
+</template>
+
+<script>
+import BaseTable from '@/components/base/BaseTable'
+import TableLayout from '@/layouts/TableLayout'
+import Pagination from '@/components/common/Pagination'
+import OperaDispatchUnitWindow from '@/components/business/OperaDispatchUnitWindow'
+import dispatchUnitDetails from '@/components/business/dispatchUnitDetails'
+import { updateById } from '@/api/business/dispatchUnit'
+export default {
+  name: 'DispatchUnit',
+  extends: BaseTable,
+  components: { TableLayout, Pagination, OperaDispatchUnitWindow, dispatchUnitDetails },
+  data () {
+    return {
+      // 鎼滅储
+      searchForm: {
+        name: '',
+        dataType: 0
+      }
+    }
+  },
+  created () {
+    this.config({
+      module: '娲鹃仯鍗曚綅淇℃伅琛�',
+      api: '/business/dispatchUnit',
+      'field.id': 'id',
+      'field.main': 'id'
+    })
+    this.search()
+  },
+  methods: {
+    // 淇敼鐘舵��
+    changeStatus(status, row) {
+      updateById({ status, id: row.id })
+        .then(res => {
+          this.search()
+        })
+        .catch(err => {
+          row.status = row.status === 0 ? 1 : 0
+        })
+    }
+  }
+}
+</script>

--
Gitblit v1.9.3