Browse Source

新增标签发放页面

gongwencan 4 months ago
parent
commit
a8b6e0ef3e

+ 9 - 0
src/api/TagDistributeApi.js

@@ -0,0 +1,9 @@
+import BaseCurdApi from './BaseCurdApi'
+
+class TagDistributeApi extends BaseCurdApi {
+  constructor () {
+    super('/tag/distribution')
+  }
+}
+
+export default new TagDistributeApi()

+ 2 - 2
src/entries/MaterialDetail.js

@@ -1,6 +1,6 @@
 import BaseCurdEntry from './BaseCurdEntry'
 import MaterialCategory from './MaterialCategory'
-import materialDetailApiApi from '@@/api/MaterialDetailApi'
+import materialDetailApi from '@@/api/MaterialDetailApi'
 
 export default class MaterialDetail extends BaseCurdEntry {
   id
@@ -27,7 +27,7 @@ export default class MaterialDetail extends BaseCurdEntry {
   }
 
   static get $$api () {
-    return materialDetailApiApi
+    return materialDetailApi
   }
 
   static $$getQuery = () => ({

+ 2 - 2
src/entries/ProviderDetail.js

@@ -1,6 +1,6 @@
 import BaseCurdEntry from './BaseCurdEntry'
 
-import providerDetailApiApi from '@@/api/ProviderDetailApi'
+import providerDetailApi from '@@/api/ProviderDetailApi'
 
 export default class ProviderDetail extends BaseCurdEntry {
   id
@@ -24,7 +24,7 @@ export default class ProviderDetail extends BaseCurdEntry {
   }
 
   static get $$api () {
-    return providerDetailApiApi
+    return providerDetailApi
   }
 
   static $$getQuery = () => ({

+ 1 - 1
src/entries/TagApply.js

@@ -27,7 +27,7 @@ export default class TagApply extends BaseCurdEntry {
     if (config) {
       const option = config.map[this.providerId]
       if (option) {
-        return option[TagApplyState.$$nameProp]
+        return option[Provider.$$nameProp]
       }
     }
 

+ 81 - 0
src/entries/TagDistribute.js

@@ -0,0 +1,81 @@
+import BaseCurdEntry from './BaseCurdEntry'
+
+import tagDistributeApi from '@@/api/TagDistributeApi'
+
+import Provider from './Provider'
+
+import TagApplyState from './TagApplyState'
+
+export default class TagDistribute extends BaseCurdEntry {
+  id
+
+  orderNo
+
+  dataTime
+  get formatDataTime () {
+    return new Date(this.dataTime).format('YYYY-MM-DD')
+  }
+
+  expectedReceiptDate
+  get formatExpectedReceiptDate () {
+    return new Date(this.expectedReceiptDate).format('YYYY-MM-DD')
+  }
+
+  providerId
+  get providerName () {
+    const config = TagDistribute.$$optionData.Provider
+    if (config) {
+      const option = config.map[this.providerId]
+      if (option) {
+        return option[Provider.$$nameProp]
+      }
+    }
+
+    return ''
+  }
+
+  tagTypeName
+
+  number
+
+  amount
+
+  tagApplyStateId
+  get tagApplyStateName () {
+    const config = TagDistribute.$$optionData.TagApplyState
+    if (config) {
+      const option = config.map[this.tagApplyStateId]
+      if (option) {
+        return option[TagApplyState.$$nameProp]
+      }
+    }
+
+    return ''
+  }
+
+  operatorName
+
+  static get $$name () {
+    return 'TagDistribute'
+  }
+
+  static get $$api () {
+    return tagDistributeApi
+  }
+
+  static $$getQuery = () => ({
+    tagApplyStateId: '',
+    order: [['dataTime', 'DESC']]
+  })
+
+  static $$optionTargetConfigGroup = [
+    [{
+      Target: TagApplyState,
+      getQuery: () => ({})
+    }, {
+      Target: Provider
+    }]
+  ]
+
+  static $$optionData = {}
+}

+ 8 - 0
src/router/index.js

@@ -83,6 +83,14 @@ export default new Router({
           permission: 'isAuthenticated'
         },
         component: () => import('@@/views/MaterialTag.vue')
+      }, {
+        path: '/page-in-src/tag-distribute',
+        name: 'TagDistribute',
+        meta: {
+          title: '标签发放',
+          permission: 'isAuthenticated'
+        },
+        component: () => import('@@/views/TagDistribute.vue')
       }]
     }
   ]

+ 155 - 0
src/views/TagDistribute.vue

@@ -0,0 +1,155 @@
+<template>
+    <div class="wrapper flex column layout-gap">
+      <el-card shadow="hover" class="filter-card">
+        <el-form label-width="100px">
+          <el-row :gutter="$$Constant.LAYOUT_GAP">
+            <el-col :span="8">
+                <el-form-item label="申领状态">
+                    <my-select
+                        v-model="query.tagApplyStateId"
+                        :options="optionGroup.TagApplyState ? optionGroup.TagApplyState.list : []"
+                        @change="onSearchBtnClick"
+                    >
+              <el-option label="全部" value=""></el-option>
+            </my-select>
+          </el-form-item>
+            </el-col>
+            <el-col :span="16" class="text-right">
+              <el-button
+                plain
+                class="filter-button"
+                @click="onResetBtnClick"
+              >重置</el-button>
+              <el-button
+                type="primary"
+                class="filter-button"
+                @click="onSearchBtnClick"
+              >查询</el-button>
+            </el-col>
+          </el-row>
+        </el-form>
+      </el-card>
+
+      <el-card
+        shadow="hover"
+        class="z-card flex column flex-1 fit-size"
+      >
+        <div class="wrapper flex column layout-gap">
+
+          <div class="flex-1 fit-size">
+            <el-table
+              ref="table"
+              :data="list"
+              stripe
+              border
+              highlight-current-row
+              height="100%"
+              size="small"
+              class="custom-el-table-style"
+            >
+              <el-table-column
+                type="index"
+                label="序号"
+                width="60"
+                align="center"
+                fixed
+              ></el-table-column>
+              <el-table-column
+                label="订单编号"
+                prop="orderNo"
+                align="center"
+                min-width="110"
+                header-align="center"
+              ></el-table-column>
+              <el-table-column
+                label="申领日期"
+                prop="formatDataTime"
+                min-width="80"
+                header-align="center"
+                align="center"
+              ></el-table-column>
+              <el-table-column
+                label="预期收货日期"
+                prop="formatExpectedReceiptDate"
+                min-width="80"
+                header-align="center"
+                align="center"
+              ></el-table-column>
+              <el-table-column
+                label="供应商名称"
+                prop="providerName"
+                min-width="160"
+                header-align="center"
+                align="left"
+              ></el-table-column>
+              <el-table-column
+                label="标签类型"
+                prop="tagTypeName"
+                min-width="120"
+                header-align="center"
+                align="left"
+              ></el-table-column>
+              <el-table-column
+                label="需求数量"
+                prop="number"
+                min-width="70"
+                header-align="center"
+                align="center"
+              ></el-table-column>
+              <el-table-column
+                label="费用"
+                prop="amount"
+                align="right"
+                min-width="70"
+                header-align="center"
+              ></el-table-column>
+              <el-table-column
+                label="状态"
+                prop="tagApplyStateName"
+                align="center"
+                min-width="70"
+                header-align="center"
+              ></el-table-column>
+              <el-table-column
+                label="操作员"
+                prop="operatorName"
+                align="center"
+                min-width="70"
+                header-align="center"
+              ></el-table-column>
+              <el-table-column
+                label="操作栏"
+                min-width="80"
+                header-align="center"
+                align="center"
+              >
+                <template v-slot="{ row }">
+                  <div class="flex center layout-gap">
+                    <edit-button :data="row" :on-click="onOpenDetailEditorBtnClick">详情</edit-button>
+                  </div>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+
+          <my-pagination
+            :total="total"
+            :pagination="pagination"
+            @current-change="currentPageNoChange"
+          />
+        </div>
+      </el-card>
+    </div>
+  </template>
+
+<script>
+import BaseCurdList from '@@/utils/BaseCurdList'
+import TagDistribute from '@@/entries/TagDistribute'
+
+export default {
+  name: 'TagDistribute',
+  extends: BaseCurdList(TagDistribute)
+}
+</script>
+
+<style lang="scss" scoped></style>