Bläddra i källkod

Merge branch 'dev_v2' of https://gogs.zfire.top/zfire-front/supply-front into dev_v2

zh 2 år sedan
förälder
incheckning
e56594585a

+ 20 - 0
src/api/basic_data/taker.js

@@ -67,6 +67,26 @@ export function getCodeApi(params) {
     params
   })
 }
+
+// 提货车辆档案-列表
+export function v2TakerCarRecordList(data) {
+  return request({
+    url: `/v2/take-car-record/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//提货车辆档案-导出
+export function v2TakerCarRecordListExport(data, name) {
+  return postBlob({
+    url: '/v2/take-car-record/list/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
 //提货车辆档案列表
 export function getCarList(params) {
   return request({

+ 118 - 146
src/views/basic_data/taker/taker_car.vue

@@ -1,145 +1,15 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div>
-      <Collapse :screen-form="searchForm">
-        <template #right_btn>
-          <el-button size="mini" @click="clearFn">清空</el-button>
-          <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form :model="searchForm" ref="searchForm" label-width="100px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="经销商名称" prop="customerName">
-                  <el-input v-model="searchForm.customerName" placeholder="请输入经销商名称"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="车牌" prop="carBrand">
-                  <el-input v-model="searchForm.carBrand" placeholder="请输入车牌"></el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <!-- 按钮 -->
-    <div class="btn-group clearfix">
-      <div class="fl">
-        <el-button
-          v-if="$checkBtnRole('add', $route.meta.roles)"
-          type="primary"
-          icon="el-icon-plus"
-          size="mini"
-          class="add-right"
-          @click="addDataList"
-          >新增</el-button
-        >
-
-        <el-popconfirm
-          v-if="$checkBtnRole('del', $route.meta.roles)"
-          class="delClass"
-          @onConfirm="delFn"
-          title="这是一段内容确定删除吗?"
-        >
-          <el-button :disabled="ids.length < 1" slot="reference" type="danger" icon="el-icon-minus" size="mini"
-            >批量删除</el-button
-          >
-        </el-popconfirm>
-      </div>
-      <div class="fr">
-        <ExportButton :exUrl="'take-car-record/export'" :exParams="exParams" />
-      </div>
-    </div>
-    <!-- 列表 -->
-    <div class="mymain-container">
-      <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          @select="hanleSelect"
-          @select-all="hanleSelect"
-          border
-          fit
-          highlight-current-row
-          stripe
-        >
-          <el-table-column type="selection" align="center" min-width="51"></el-table-column>
-          <el-table-column align="left" label="经销商名称" prop="customerName" min-width="260" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.customerName" />
-              <span>{{ scope.row.customerName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column
-            align="left"
-            label="车辆车牌号"
-            prop="carBrand"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="创建者"
-            prop="createBy"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="创建时间"
-            prop="createTime"
-            min-width="150"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="更新者"
-            prop="updateBy"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="更新时间"
-            prop="updateTime"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column align="center" label="操作" min-width="160" show-overflow-tooltip fixed="right">
-            <template slot-scope="scope">
-              <el-button type="text" v-if="$checkBtnRole('edit', $route.meta.roles)" @click="editFn(scope.row)"
-                >编辑</el-button
-              >
-              <el-popconfirm
-                @onConfirm="delFn(scope.row.id)"
-                v-if="$checkBtnRole('del', $route.meta.roles)"
-                title="这是一段内容确定删除吗?"
-              >
-                <el-button type="text" slot="reference">删除</el-button>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 分页 -->
-      <div class="fr">
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="currentPage"
-          :page-sizes="[10, 20, 30, 50]"
-          :page-size="10"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="listTotal"
-        >
-        </el-pagination>
-      </div>
-    </div>
-
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+    :operationColumnWidth="200"
+  >
     <!-- 弹窗 -->
     <el-dialog
       title="提货车辆档案"
@@ -186,17 +56,68 @@
         <el-button type="primary" @click="addDataListFn">确 定</el-button>
       </div>
     </el-dialog>
-  </div>
+  </template-page>
 </template>
 
 <script>
-import { getCarList, addDataListApi, delCarFn, editDataListApi } from '@/api/basic_data/taker'
+import TemplatePage from '@/components/template/template-page-1.vue'
+import {
+  getCarList,
+  addDataListApi,
+  delCarFn,
+  editDataListApi,
+  v2TakerCarRecordList,
+  v2TakerCarRecordListExport
+} from '@/api/basic_data/taker'
 import { getDealerList } from '@/api/basic_data/dealer'
 import { downloadFiles } from '@/utils/util'
 
 export default {
+  components: {
+    TemplatePage
+  },
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: () => {
+                this.addDataList()
+              },
+              isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量删除',
+              click: async () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                this.delFn()
+              },
+              isRole: this.$checkBtnRole('del', this.$route.meta.roles)
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
       listLoading: false, // 列表加载loading
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
@@ -250,6 +171,55 @@ export default {
     this.getDealerDataList({ pageNum: 1, pageSize: 10 })
   },
   methods: {
+    // 列表请求函数
+    getList: v2TakerCarRecordList,
+    // 列表导出函数
+    exportList: v2TakerCarRecordListExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {this.$checkBtnRole('del', this.$route.meta.roles) ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.delFn(row.id)
+                }}
+                title="是否确定需要删除该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {this.$checkBtnRole('edit', this.$route.meta.roles) ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={async () => {
+                  this.editFn(row)
+                }}
+              >
+                编辑
+              </el-button>
+            ) : (
+              ''
+            )}
+          </div>
+        )
+      }
+    },
+
     // 筛选部分数据或者单个
     hanleSelect(selection) {
       // this.ids = selection.map((k) => {
@@ -305,13 +275,14 @@ export default {
         let res = arr.toString()
         await delCarFn({ ids: res })
       } else {
-        let res = this.ids.toString()
+        let res = this.recordSelected.map(v => v.id).toString()
         await delCarFn({ ids: res })
       }
 
       this.$message.success('删除成功')
       this.ids = []
-      this.getDataList()
+      // this.getDataList()
+      this.$refs.pageRef.refreshList()
     },
     //获取经销商数据
     async getDealerDataList(data) {
@@ -353,7 +324,8 @@ export default {
       //   carBrand: "",
       // };
       await this.$refs.addForm.resetFields()
-      this.getDataList()
+      // this.getDataList()
+      this.$refs.pageRef.refreshList()
       this.dialogForm = false
     },
     //获取列表数据

+ 13 - 8
src/views/basic_data/taker/taker_list.vue

@@ -135,7 +135,10 @@ export default {
           [
             {
               name: '新增',
-              click: () => {}
+              click: () => {
+                this.addFn()
+              },
+              isRole: this.$checkBtnRole('add', this.$route.meta.roles)
             }
           ]
         ]
@@ -143,7 +146,7 @@ export default {
       // 表格属性
       tableAttributes: {
         // 启用勾选列
-        selectColumn: true
+        selectColumn: false
       },
       // 表格事件
       tableEvents: {
@@ -232,7 +235,6 @@ export default {
     },
     operation() {
       return (h, { row, index, column }) => {
-        console.log(row)
         return (
           <div class="operation-btns">
             <el-button
@@ -248,7 +250,7 @@ export default {
             {this.$checkBtnRole('del', this.$route.meta.roles) ? (
               <el-popconfirm
                 onOnConfirm={async () => {
-                  this.handleSubmit(row.enginInfoId)
+                  this.deleFn(row.id)
                 }}
                 title="是否确定需要删除该项内容?"
               >
@@ -278,7 +280,7 @@ export default {
                 size="mini"
                 type="text"
                 onClick={async () => {
-                  this.stopFn(row)
+                  this.rebuild(row)
                 }}
               >
                 重建
@@ -312,7 +314,8 @@ export default {
     async deleFn(ids) {
       await deleDataList({ ids })
       this.$message.success('删除成功')
-      this.getDataList()
+      // this.getDataList()
+      this.$refs.pageRef.refreshList()
     },
     //查看
     seeFn(data) {
@@ -356,7 +359,8 @@ export default {
     async stopFn(id) {
       await stopTaker({ id })
       this.$message.success('成功')
-      this.getDataList()
+      // this.getDataList()
+      this.$refs.pageRef.refreshList()
     },
     //获取验证码
     async getCodeFn() {
@@ -456,7 +460,8 @@ export default {
       //   code: "",
       // };
       this.count = 0
-      this.getDataList()
+      // this.getDataList()
+      this.$refs.pageRef.refreshList()
       this.dialogForm = false
     },
     addFn() {

+ 12 - 18
src/views/supply/displace/displace_list.vue

@@ -344,9 +344,8 @@
                 size="mini"
                 @click="submitChooseBeiGoods(scope.row)"
                 :disabled="scope.row.selected"
-              >选择
-              </el-button
-              >
+                >选择
+              </el-button>
             </template>
           </el-table-column>
           <el-table-column
@@ -390,7 +389,7 @@
             <el-pagination
               @current-change="changeBeiGoodsDialogPage"
               :current-page="beiGoodsDialog_currentPage"
-              :page-size="10"
+              :page-size="100"
               background
               layout="prev, pager, next"
               :total="beiGoodsDialog_listTotal"
@@ -514,9 +513,8 @@
                 size="mini"
                 @click="submitChooseKeGoods(scope.row)"
                 :disabled="scope.row.selected"
-              >选择
-              </el-button
-              >
+                >选择
+              </el-button>
             </template>
           </el-table-column>
           <el-table-column
@@ -553,7 +551,7 @@
             <el-pagination
               @current-change="changeKeGoodsDialogPage"
               :current-page="keGoodsDialog_currentPage"
-              :page-size="10"
+              :page-size="100"
               background
               layout="prev, pager, next"
               :total="keGoodsDialog_listTotal"
@@ -616,9 +614,8 @@
           <el-table-column align="center" width="80">
             <template slot-scope="scope">
               <el-button type="primary" size="mini" @click="submitChooseOrder(scope.row)" :disabled="scope.row.selected"
-              >选择
-              </el-button
-              >
+                >选择
+              </el-button>
             </template>
           </el-table-column>
           <el-table-column
@@ -740,7 +737,7 @@
             <el-pagination
               @current-change="changeOrderDialogPage"
               :current-page="orderDialog_currentPage"
-              :page-size="10"
+              :page-size="100"
               background
               layout="prev, pager, next"
               :total="orderDialog_listTotal"
@@ -816,8 +813,7 @@ export default {
     }
   },
 
-  created() {
-  },
+  created() {},
 
   methods: {
     // 切换置换类型
@@ -896,10 +892,8 @@ export default {
           package: '',
           signType: 'MD5',
           paySign: '',
-          success(res) {
-          },
-          fail(res) {
-          }
+          success(res) {},
+          fail(res) {}
         })
       })
     },

+ 1 - 1
src/views/supply/implement/components/displace_detail.vue

@@ -30,7 +30,7 @@
         ></el-table-column>
         <el-table-column align="left" label="" min-width="80" show-overflow-tooltip>
           <template slot-scope="scope">
-            {{ scope.row.isOld ? '新机' : '旧机' }}
+            {{ scope.row.isOld ? '旧机' : '新机' }}
           </template>
         </el-table-column>
         <el-table-column