From 17efddc6a667670dca682bf36b51a43e99615e6d Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期三, 16 十月 2024 15:59:38 +0800
Subject: [PATCH] 代码初始化

---
 admin/src/views/platform/LogisticsRecord/operation.vue |  297 ++++++++++++++++++++++++++++++++++------------------------
 1 files changed, 173 insertions(+), 124 deletions(-)

diff --git a/admin/src/views/platform/LogisticsRecord/operation.vue b/admin/src/views/platform/LogisticsRecord/operation.vue
index 15e1955..95dd8c5 100644
--- a/admin/src/views/platform/LogisticsRecord/operation.vue
+++ b/admin/src/views/platform/LogisticsRecord/operation.vue
@@ -1,168 +1,217 @@
 <template>
   <div class="main_app">
-    <QueryForm
-      v-model="filters"
-      :query-form-config="queryFormConfig"
-      @handleQuery="getList(1)"
-      @clear="clear"
-    />
-    <el-table v-loading="loading" :data="list" stripe>
-      <el-table-column
-        prop="name"
-        label="杞︾墝鍓嶇収鍙�"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="杞︾墝鍚庣収鍙�"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="椹鹃┒鍛�"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="鑱旂郴鏂瑰紡"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="纭鏃堕棿"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="绛惧埌鏃堕棿"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="鍙彿鏃堕棿"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="浣滀笟寮�濮嬫椂闂�"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="浣滀笟瀹屾垚鏃堕棿"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="浣滀笟鏃堕暱"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="鍙彿鏈堝彴"
-        min-width="100"
-      />
-      <el-table-column
-        prop="name"
-        label="鏈堝彴缁�"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="杩愯緭鍗曞彿/鍚堝悓鍙�"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="浣滀笟鎯呭喌"
-        min-width="100"
-        show-overflow-tooltip
-      />
-    
+    <QueryForm v-model="filters" :query-form-config="queryFormConfig" @changeForm='changeForm' @handleQuery="getList(1)" @clear="clear">
+      <template #fastdate>
+        <el-radio-group
+          v-model="filters.fastdate"
+          size="small"
+          @input="changeRadio"
+        >
+          <el-radio-button label="0">褰撳ぉ</el-radio-button>
+          <el-radio-button label="6">杩�7澶�</el-radio-button>
+          <el-radio-button label="29">杩�30澶�</el-radio-button>
+        </el-radio-group>
+      </template>
+    </QueryForm>
+    <div class="pt16">
+      <el-button :loading="exLoading" @click="handleEx" v-permissions="['business:platformjob:exportExcel']">瀵煎嚭</el-button>
+    </div>
+    <el-table class="mb20" v-loading="loading" :data="list" stripe>
+      <el-table-column prop="billCode" label="杩愬崟鍙�" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="totalNum" label="鎬讳綔涓氶噺(涓囨敮)" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="carCodeFront" label="杞︾墝鍓嶇収鍙�" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="carCodeBack" label="杞︾墝鍚庣収鍙�" min-width="100" show-overflow-tooltip />
+      <!-- <el-table-column prop="taskOrigin" label="浠诲姟鏉ユ簮" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="carrierName" label="杩愯緭鍏徃" min-width="100" show-overflow-tooltip /> -->
+      <el-table-column prop="driverName" label="椹鹃┒鍛�" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="drivierPhone" label="鑱旂郴鏂瑰紡" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="confirmTaskDate" label="纭鏃堕棿" min-width="150" show-overflow-tooltip />
+      <el-table-column prop="signDate" label="绛惧埌鏃堕棿" min-width="150" show-overflow-tooltip />
+      <el-table-column prop="callDate" label="鍙彿鏃堕棿" min-width="150" show-overflow-tooltip />
+      <el-table-column prop="startDate" label="浣滀笟寮�濮嬫椂闂�" min-width="150" show-overflow-tooltip />
+      <el-table-column prop="doneDate" label="浣滀笟瀹屾垚鏃堕棿" min-width="150" show-overflow-tooltip />
+      <el-table-column prop="workTime" label="浣滀笟鏃堕暱" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="platformNames" label="鍙彿鏈堝彴" min-width="100" show-overflow-tooltip />
+      <el-table-column label="浣滀笟鎯呭喌" fixed="right" min-width="100" show-overflow-tooltip>
+        <template v-slot="scope">
+          <span>{{ statusMap[scope.row.status] }}</span>
+        </template>
+      </el-table-column>
     </el-table>
-    <pagination
-      @size-change="handleSizeChange"
-      @current-change="getList"
-      :pagination="pagination"
-    />
+    <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" />
+    <!--  -->
+    <!--  -->
+    <DriverDetail v-if="isShowDriver" ref="DriverDetailRef" />
   </div>
 </template>
 
 <script>
 import Pagination from '@/components/common/Pagination'
 import QueryForm from '@/components/common/QueryForm'
+import { platformJobPage,  platformJobExport,platformJobDel } from '@/api'
+import { statusMap } from '../config'
+import DriverDetail from "@/views/task/driverDetail"
+import GlobalWindow from '@/components/common/GlobalWindow'
+import UploadFaceImg from '@/components/common/UploadFaceImg'
+import { Message } from 'element-ui'
+import dayjs from 'dayjs'
+import duration from 'dayjs/plugin/duration'
+dayjs.extend(duration);
 export default {
   components: {
     Pagination,
-    QueryForm
+    QueryForm,
+    DriverDetail,
+    GlobalWindow,
+    UploadFaceImg
   },
-  data () {
+  data() {
     return {
+      statusMap,
+      isShowDriver: false,
+      exLoading: false,
       loading: false,
       pagination: {
-        capacity: 10,
-        page: 1
+        pageSize: 10,
+        page: 1,
+        total: 0
       },
-      filters: {},
+      filters: {
+        selDate: [],
+        fastdate: 0
+      },
       list: [],
-      total: 0,
-      isShowEdit: false,
-      param: {},
-      rules: {},
       queryFormConfig: {
         formItems: [
+        {
+            filed: 'code',
+            type: 'input',
+            label: '杩愬崟鍙�'
+          },
           {
-            filed: 'aaaa',
+            filed: 'carCodeFront',
             type: 'input',
             label: '杞︾墝鍙�'
           },
           {
-            filed: 'bbb',
+            filed: 'driverName',
             type: 'input',
             label: '椹鹃┒鍛�'
           },
           {
             filed: 'selDate',
-            type: 'daterange',
-            label: '鎿嶄綔鏃堕棿'
+            type: 'datetimerange',
+            label: '',
+            pickerOptions: {}
+          },
+          {
+            type: 'slot',
+            filed: 'fastdate',
+            label: ''
           }
         ],
         online: true
       },
     }
   },
+  created() {
+    this.changeRadio('0')
+    this.getList()
+  },
   methods: {
-    handleSub () {
-      this.$refs.ruleForm.validate((valid) => {
-        if (valid) {
-          alert('submit!')
-        }
+    changeRadio (day) {
+      const arr = [dayjs().subtract(day, 'day').format('YYYY-MM-DD') + ' 00:00:00', dayjs().format('YYYY-MM-DD') + ' 23:59:59']
+      this.$set(this.filters, 'selDate', arr)
+      this.getList()
+    },
+    changeForm (str) {
+      if (str === 'selDate') {
+        this.$set(this.filters, 'fastdate', null)
+        this.getList()
+      }
+    },
+    getList(page) {
+      const { pagination, filters } = this
+      this.loading = true
+      platformJobPage({
+        model: {
+          ...filters,
+          jobType: '0',
+          beginWorkDateStart: filters.selDate && filters.selDate.length > 0 ? filters.selDate[0] : null,
+          beginWorkDateEnd: filters.selDate && filters.selDate.length > 0 ? filters.selDate[1] : null,
+        },
+        capacity: pagination.pageSize,
+        page: page || pagination.page,
+      }).then(res => {
+        this.loading = false
+        this.list = res.records || []
+        this.list.forEach(item => {
+          item.inTypeTemp = item.inType == 0 ? '鏁存墭鐩�' : '浠剁儫'
+          item.taskOrigin = 'WMS鑾峰彇'
+          item.workTime = dayjs.duration(item.workTime, 'seconds').format('H鏃秏鍒唖绉�');
+        })
+        this.pagination.total = res.total || 0
+      }, () => {
+        this.loading = false
       })
     },
-    getList (page) { },
-    clear () { },
-    handleEdit (row) {
-      this.isShowEdit = true
+    handleDel(row) {
+      this.$dialog.exportConfirm('纭鍒犻櫎鍚楋紵').then(() => {
+        platformJobDel({ id: row.id }).then(res => {
+          Message.success('鍒犻櫎鎴愬姛')
+          this.getList()
+        })
+      })
     },
-    handleDel () { },
-    handleSizeChange (capacity) {
-      this.pagination.capacity = capacity
+    handleEx() {
+      this.$dialog.exportConfirm('纭瀵煎嚭鍚楋紵')
+        .then(() => {
+          this.exLoading = true
+          platformJobExport({
+            page: this.pagination.page,
+            capacity: 1000000,
+            jobType: '0',
+            model: this.filters
+          })
+            .then(response => {
+              this.download(response)
+            })
+            .catch(e => {
+              this.$tip.apiFailed(e)
+            })
+            .finally(() => {
+              this.exLoading = false
+            })
+        })
+    },
+    clear() {
+      this.pagination.page = 1
+      this.filters = {
+        selDate: [],
+        fastdate: 0
+      }
+      this.getList()
+    },
+    handleDetail(row) {
+      this.isShowDriver = true
+      this.$nextTick(() => {
+        this.$refs.DriverDetailRef.id = row.id
+        this.$refs.DriverDetailRef.type = 6
+        this.$refs.DriverDetailRef.getDetail()
+        this.$refs.DriverDetailRef.isShowModal = true
+      })
+    },
+    handleSizeChange(capacity) {
+      this.pagination.pageSize = capacity
     }
   }
 }
 </script>
-
-<style>
-</style>
+<style lang="scss" scoped>
+.param_title {
+  font-size: 18px;
+  font-weight: 600;
+  color: #000000;
+  margin-bottom: 15px;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3