Răsfoiți Sursa

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002390 1 an în urmă
părinte
comite
491fb2bce9

+ 19 - 0
src/api/purchase/equipmentData.js

@@ -0,0 +1,19 @@
+import request from '@/utils/request'
+
+// 设备产品数据库列表
+export function getEquipmentDataList(data) {
+  return request({
+    url: `device/origin/list?pageSize=${data.pageSize}&pageNum=${data.pageNum}`,
+    method: 'post',
+    data: data
+  })
+}
+// 设备产品数据库模板下载
+export function downLoadMb(data) {
+  return request({
+    url: `device/origin/download`,
+    method: 'post',
+    data: data,
+    responseType: 'blob'
+  })
+}

+ 208 - 0
src/components/PopDialog/index2.vue

@@ -0,0 +1,208 @@
+<template>
+  <div>
+    <el-dialog title="物料编码选择" width="1000px" :close-on-click-modal="false" :append-to-body="true" v-dialogDrag
+      class="userDialog" :visible.sync="visible">
+      <el-container style="height: 500px">
+        <el-container>
+          <el-header style="text-align: left; font-size: 12px; height: 30px">
+            <el-form size="small" :inline="true" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()"
+              @submit.native.prevent>
+              <el-form-item prop="code">
+                <el-input size="small" v-model.trim="searchForm.code" placeholder="请输入物料编号查询" clearable></el-input>
+              </el-form-item>
+              <el-form-item prop="name">
+                <el-input size="small" v-model="searchForm.name" placeholder="请输入物料名称查询" clearable></el-input>
+              </el-form-item>
+              <el-form-item>
+                <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
+                <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+              </el-form-item>
+            </el-form>
+          </el-header>
+          <el-main>
+            <el-table :data="dataList" v-loading="loading" size="small" border ref="contractTable"
+              @select="handleSelectionChange" :selection="selectedRows"  height="calc(100% - 40px)" style="width: 100%">
+              <el-table-column type="selection" header-align="center" align="center" width="50">
+              </el-table-column>
+              <el-table-column prop="code" header-align="center" align="center" sortable="custom" min-width="90"
+                label="物料编码">
+              </el-table-column>
+              <el-table-column prop="name" header-align="center" align="center" sortable="custom" min-width="90"
+                label="物料名称">
+              </el-table-column>
+              <el-table-column prop="specification" header-align="center" align="center" sortable="custom" min-width="90"
+                label="规格">
+              </el-table-column>
+              <el-table-column prop="model" header-align="center" align="center" sortable="custom" min-width="90"
+                label="型号">
+              </el-table-column>
+              <el-table-column prop="manufacturerIdName" header-align="center" align="center" sortable="custom" min-width="90"
+                label="生产厂家">
+              </el-table-column>
+            </el-table>
+
+            <el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
+              :current-page="searchForm.pageNo" :page-sizes="[5, 10, 15, 20]" :page-size="searchForm.pageSize"
+              :total="total" layout="total, sizes, prev, pager, next, jumper">
+            </el-pagination>
+          </el-main>
+        </el-container>
+      </el-container>
+      <span slot="footer">
+        <el-button size="small" @click="visible = false" icon="el-icon-circle-close">关闭</el-button>
+        <el-button size="small" type="primary" icon="el-icon-circle-check" @click="doSubmit()">确定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import axios from 'axios'
+import { getMaterialList } from '@/api/changeApply/basic'
+export default {
+  data() {
+    return {
+      searchForm: {
+        code: '',
+        name: '',
+        isSync: '',
+        pageNo: 1,
+        pageSize: 10,
+      },
+      dataListAllSelections: [], // 所有选中的数据包含跨页数据
+      idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
+      dataList: [],
+      total: 0,
+      orders: [],
+      loading: false,
+      visible: false,
+      selectedRows:[]
+    };
+  },
+  props: {
+    selectData: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    // 是否启用单选
+    single: {
+      type: Boolean,
+      default: true
+    }
+  },
+  methods: {
+    init(val) {
+      this.visible = true;
+      this.searchForm.isSync = val
+      this.$nextTick(() => {
+        this.dataListAllSelections = JSON.parse(JSON.stringify(this.selectData));
+        this.resetSearch();
+      });
+    },
+    // 获取数据列表
+    refreshList() {
+      this.loading = true;
+      // axios({
+      //   url: "http://172.16.62.241:8000/drp-admin/system/material/list", // 自己的接口路径
+      //   method: "post",
+      //   data: {
+      //     // current: this.pageNo,
+      //     size: this.pageSize,
+      //     // orders: this.orders,
+      //     // ...this.searchForm,
+      //   },
+      let params = {
+        ...this.searchForm,
+        // 默认查询已启用
+        isEnable: '0'
+      }
+      getMaterialList(params).then(({ data }) => {
+        console.log('data', data)
+        this.dataList = data.tableBody.rows;
+        this.total = data.tableBody.total;
+        this.loading = false;
+        this.$nextTick(() => {
+          this.setSelectRow();
+        });
+      });
+    },
+    // 每页数
+    sizeChangeHandle(val) {
+      console.log('每页数:', val)
+      this.searchForm.pageSize = val;
+      this.refreshList();
+    },
+    // 当前页
+    currentChangeHandle(val) {
+      console.log('当前页:', val)
+      this.searchForm.pageNo = val;
+      this.refreshList();
+    },
+    // 排序
+    resetSearch() {
+      this.$refs['searchForm'].resetFields();
+      this.searchForm.pageNo = 1;
+      this.refreshList();
+    },
+    watchSel(rows) {
+      console.log('监听得到选中吗', rows)
+      this.dataListAllSelections = rows
+    },
+    // 表格选中数据
+    rowSelect(row) {
+      // this.$refs.contractTable.clearSelection();
+      // this.$refs.contractTable.toggleRowSelection(row);
+      // this.dataListAllSelections = this.single ? [row] : selection
+      this.$refs.contractTable.toggleRowSelection(row);
+    },
+    // 选中数据
+    handleSelectionChange(selection, row) {
+      console.log('selection',selection)
+      console.log('row',[row])
+      if (this.single && selection.length > 1) {
+        this.$refs.contractTable.clearSelection();
+        this.$refs.contractTable.toggleRowSelection(row);
+      }
+      this.dataListAllSelections = this.single ? [row] : selection
+    },
+    // 设置选中的方法
+    setSelectRow() {
+      this.$refs.contractTable.clearSelection();
+      if (!this.dataListAllSelections || this.dataListAllSelections.length <= 0) {
+        return;
+      }
+      for (let i = 0; i < this.dataList.length; i++) {
+        if (this.dataListAllSelections.some(item => item[this.idKey] == this.dataList[i][this.idKey])) {
+          // 设置选中,记住table组件需要使用ref="table"
+          this.$refs.contractTable.toggleRowSelection(this.dataList[i], true);
+        }
+      }
+    },
+    doSubmit() {
+      this.visible = false;
+      console.log('选择的数据?', this.dataListAllSelections)
+      this.$emit("doSubmit", this.dataListAllSelections);
+    },
+  },
+};
+</script>
+<style lang="scss">
+.userDialog {
+  .el-dialog__body {
+    padding: 10px 0px 0px 10px;
+    color: #606266;
+    font-size: 14px;
+    word-break: break-all;
+  }
+
+  .el-main {
+    padding: 20px 20px 5px 20px;
+
+    .el-pagination {
+      margin-top: 5px;
+    }
+  }
+}
+</style>

+ 37 - 15
src/views/WMS/historical-route/index.vue

@@ -213,6 +213,7 @@
                 data: [],
                 type: "line",
                 smooth: true,
+                showSymbol: false,
                 label: {
                   show: true,
                   position: "top",
@@ -245,6 +246,7 @@
                   data: [],
                   type: "line",
                   smooth: true,
+                  showSymbol: false,
                   label: {
                     show: true,
                     position: "top",
@@ -266,7 +268,7 @@
               }
               console.log(this.option.series, 'this.option.series');
             }
-            // 如果车辆温度数组为空,则其它数组前移一位
+            //如果车辆温度数组为空,则其它数组前移一位
             for (let i = 1;;) {
               if (this.option.series[0].data.length == 0) {
                 for (let j = 0; j < this.option.series.length - i; j++) {
@@ -299,16 +301,22 @@
       //地图初始化
       initMap() {
         AMapLoader.load({
-            key: 'f953210b2d5276ffbf5a2bc01ef80f55', // 申请好的Web端开发者Key,首次调用 load 时必填
-            version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
-            plugins: [''] // 需要使用的的插件列表,如比例尺'AMap.Scale'等
+            //申请好的Web端开发者Key,首次调用 load 时必填
+            key: 'f953210b2d5276ffbf5a2bc01ef80f55',
+            //指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
+            version: '2.0',
+            //需要使用的的插件列表,如比例尺'AMap.Scale'等
+            plugins: ['']
           })
           .then(AMap => {
             this.map = new AMap.Map('container', {
               //设置地图容器id
-              viewMode: '3D', //是否为3D地图模式
-              zoom: 13, //初始化地图级别
-              center: [112.976376, 28.195318] //初始化地图中心点位置
+              //是否为3D地图模式
+              viewMode: '3D',
+              //初始化地图级别
+              zoom: 13,
+              //初始化地图中心点位置
+              center: [112.976376, 28.195318]
             })
           })
           .catch(e => {
@@ -322,8 +330,10 @@
           resizeEnable: true
         });
         map.plugin("AMap.DragRoute", function () {
-          route = new AMap.DragRoute(map, path, AMap.DrivingPolicy.LEAST_FEE); //构造拖拽导航类
-          route.search(); //查询导航路径并开启拖拽导航
+          //构造拖拽导航类
+          route = new AMap.DragRoute(map, path, AMap.DrivingPolicy.LEAST_FEE);
+          //查询导航路径并开启拖拽导航
+          route.search();
         });
       },
       //图表属性赋值
@@ -342,23 +352,35 @@
           xAxis: {
             data: this.xData
           },
-          legend: { // 图例
+          //图例
+          legend: {
             data: [],
             // bottom: "0%"
           },
           yAxis: {},
-          dataZoom: [ //加上dataZoom可实现缩放
-            {
-              type: 'slider', //x轴
+          //加上dataZoom可实现缩放
+          dataZoom: [{
+              //x轴
+              type: 'slider',
               xAxisIndex: 0,
 
             },
             {
-              type: 'inside', //x轴
+              //x轴
+              type: 'inside',
               xAxisIndex: 0,
-              zoomOnMouseWheel: 'true', //如何触发缩放。可选值为:true:表示不按任何功能键,鼠标滚轮能触发缩放。false:表示鼠标滚轮不能触发缩放。'shift':表示按住 shift 和鼠标滚轮能触发缩放。'ctrl':表示按住 ctrl 和鼠标滚轮能触发缩放。'alt':表示按住 alt 和鼠标滚轮能触发缩放。
+              /**
+               * 如何触发缩放。可选值为:true:表示不按任何功能键,鼠标滚轮能触发缩放。false:表示鼠标滚轮不能触发缩放。
+               * 'shift':表示按住 shift和鼠标滚轮能触发缩放。
+               * 'ctrl':表示按住 ctrl 和鼠标滚轮能触发缩放。'alt':表示按住 alt 和鼠标滚轮能触发缩放。
+               */
+              zoomOnMouseWheel: 'true',
             },
           ],
+          /**
+           * series中的参数:
+           * smooth:是否曲线,showSymbol:是否显示数据和数据点
+           */
           series: [],
         }
       },

+ 4 - 4
src/views/purchase/apply/add/columns.js

@@ -82,10 +82,6 @@ export default function useColumns() {
       attr: { is: "el-input", disabled: true, readonly: true },
     },
     {
-      item: { key: "file", title: "附件", span: 24 },
-      attr: { is: "el-file-upload" },
-    },
-    {
       item: { key: "sourceType", title: "来源单据类型" },
       attr: { is: "el-input", disabled: true, readonly: true },
     },
@@ -99,6 +95,10 @@ export default function useColumns() {
         value: "0",
       },
     },
+    {
+      item: { key: "file", title: "附件", span: 24 },
+      attr: { is: "el-file-upload" },
+    },
   ].map(({ item, attr }) => ({
     attr,
     item: { ...item, hidden: true, span: item.span || 6 },

+ 8 - 8
src/views/purchase/apply/copy/columns.js

@@ -78,14 +78,6 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "approveTime", title: "单据申请日期" },
-      attr: { is: "el-input", disabled: true, readonly: true },
-    },
-    {
-      item: { key: "file", title: "附件", span: 24 },
-      attr: { is: "el-file-upload" },
-    },
-    {
       item: { key: "sourceType", title: "来源单据类型" },
       attr: { is: "el-input", disabled: true, readonly: true },
     },
@@ -99,6 +91,14 @@ export default function useColumns() {
         value: "0",
       },
     },
+    {
+      item: { key: "approveTime", title: "单据申请日期" },
+      attr: { is: "el-input", disabled: true, readonly: true },
+    },
+    {
+      item: { key: "file", title: "附件", span: 24 },
+      attr: { is: "el-file-upload" },
+    },
   ].map(({ item, attr }) => ({
     attr,
     item: { ...item, hidden: true, span: item.span || 6 },

+ 4 - 4
src/views/purchase/apply/edit/columns.js

@@ -82,10 +82,6 @@ export default function useColumns() {
       attr: { is: "el-input", disabled: true, readonly: true },
     },
     {
-      item: { key: "file", title: "附件", span: 24 },
-      attr: { is: "el-file-upload" },
-    },
-    {
       item: { key: "sourceType", title: "来源单据类型" },
       attr: { is: "el-select", dictName: "price_source", disabled: true, readonly: true },
     },
@@ -99,6 +95,10 @@ export default function useColumns() {
         value: "0",
       },
     },
+    {
+      item: { key: "file", title: "附件", span: 24 },
+      attr: { is: "el-file-upload" },
+    },
   ].map(({ item, attr }) => ({
     attr,
     item: { ...item, hidden: true, span: item.span || 6 },

+ 186 - 0
src/views/purchase/equipmentData/add.vue

@@ -0,0 +1,186 @@
+<template>
+  <div id="addEquipment">
+    <el-card style="position: relative;">
+      <span>基本信息</span>
+      <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto" :show-message="false">
+        <el-row :gutter="10">
+
+          <el-col :span="1.5">
+            <el-form-item label="物料编码" prop="materialCode">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.materialCode">
+                <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial()"></el-button>
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="物料名称" prop="materialName">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.materialName">
+              </el-input>
+            </el-form-item>
+          </el-col>
+          
+          <el-col :span="1.5">
+            <el-form-item label="设备类别" prop="deviceCategory">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.deviceCategory">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="厂家名称" prop="deviceCategory">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.deviceCategory">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="型号" prop="model">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.model">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="价格" prop="price">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.price">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="省份" prop="province">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.province">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="大区负责人" prop="largeZoneCommander">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.largeZoneCommander">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="业务经理" prop="serviceManager">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.serviceManager">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="售后工程师" prop="afterSalesEngineer">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.afterSalesEngineer">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="参数" prop="parameters">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.parameters">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="备注" prop="parameters">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.parameters">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+
+        </el-row>
+      </el-form>
+
+      <div class="btn_group">
+        <el-button type="primary" size="mini"  @click="editPage" v-if="sonPageStu == 'check' && row.status == '0'">编辑</el-button>
+        <el-button type="primary" size="mini"  @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
+        <el-button size="mini" plain @click="back">返回</el-button>
+      </div>
+    </el-card>
+
+    <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
+  </div>
+</template>
+
+<script>
+export default {
+  components: {
+    popDialog: () => import("@/components/PopDialog/index2.vue"),
+  },
+  props: ['pageStu','row', 'disable'],
+  model: {
+    prop: 'isList',
+    event: 'jugislist'
+  },
+  data() {
+    return {
+      // 不能直接改变props传来的值
+      sonPageStu: this.pageStu,
+      sonDisable: this.disable,
+      basicForm: {
+        materialCode: '',
+        materialName: '',
+        materialId: '',
+        deviceCategory: '',
+        factoryName: '',
+        model: '',
+        price: '',
+        parameters: '',
+        province: '',
+        largeZoneCommander: '',
+        serviceManager: '',
+        afterSalesEngineer: '',
+        remark: '',
+      },
+      basicRules: {},
+    }
+  },
+  created() {
+    if(this.pageStu == 'check') {
+      console.log('数据', this.row)
+      this.getDetails(this.row)
+    } else if(this.pageStu == 'edit') {
+      this.getDetails(this.row)
+    } else if (this.pageStu == 'add') {
+
+    }
+  },
+  methods: {
+    getDetails() {
+
+    },
+    editPage() {},
+    save() {},
+    back() {
+      this.$emit('jugislist', true)
+      this.$emit('refresh')
+    },
+    // 选择物料编码带出数据
+    chooseMaterial() {
+      // 传0只展示同步NC了的物料
+      this.$refs.materialRefer.init(0)
+    },
+    selectMaterial(selection) {
+      console.log('选中的物料', selection)
+      this.basicForm.materialCode = selection[0].code
+      this.basicForm.materialName = selection[0].name
+      this.basicForm.materialId = selection[0].id
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.btn_group {
+  // width: 100%;
+  // margin: 20px 0;
+  display: flex;
+  justify-content: space-between;
+  position: absolute;
+  top: 10px;right: 20px;
+
+}  
+</style>

+ 279 - 0
src/views/purchase/equipmentData/index.vue

@@ -0,0 +1,279 @@
+<template>
+  <div id="equipmentData">
+    <div v-if="isList">
+      <el-card
+        v-loading="loading"
+        style="position: relative;"
+      >
+      <!-- <span>设备产品数据库</span> -->
+      <el-form class="search_area" label-width="100px">
+        <el-row :gutter="10">
+          <el-col :span="1.5">
+            <el-form-item label="物料编码">
+                <el-input
+                  v-model.trim="params.materialCode"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="物料名称">
+                <el-input
+                  v-model.trim="params.materialName"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="设备类别">
+                <el-input
+                  v-model.trim="params.deviceCategory"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+          </el-col>
+        </el-row>
+
+        <div style="position: absolute;top: 10px;right: 10px;">
+          <el-button type="primary" size="mini" @click="searchList">搜索</el-button>
+          <el-button size="mini" plain @click="resetList">重置</el-button>
+        </div>
+      </el-form>
+
+      <div class="btn_grooup">
+        <el-button type="primary" size="mini" @click="addDivision">新增</el-button>
+        <el-button type="primary" size="mini" @click="downLoadMb">下载模板</el-button>
+        <el-button type="primary" size="mini" @click="upload.open = true">导入数据</el-button>
+      </div>
+      <el-super-ux-table
+        v-model="tableData"
+        :size="size"
+        :dict="dict"
+        :page="pageInfo"
+        :height=500
+        :columns="TableColumns"
+        pagination
+        convenitentOperation
+        storage-key="equipmentDataSuperTable"
+        @row-dblclick="useSee"
+        @row-select="useSelect"
+        @pagination="useQuery(params, pageInfo)"
+      >
+        <ux-table-column
+          fixed="right"
+          title="操作"
+          align="center"
+          width="100"
+          >
+          <template slot-scope="scope">
+            <el-button type="text" size="mini" v-if="scope.row.status == '1' && scope.row.flowId" @click="reback(scope.row)">收回</el-button>
+          </template>
+        </ux-table-column>
+      </el-super-ux-table>
+      </el-card>
+    </div>
+
+    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="searchList"/>
+
+    <!-- 用户导入对话框 -->
+    <el-dialog title="数据导入" :visible.sync="upload.open" width="400px">
+      <el-upload
+      ref="upload"
+      :limit="1"
+      accept=".xlsx, .xls"
+      :headers="upload.headers"
+      :action="upload.url + '?updateSupport=' + upload.updateSupport"
+      :disabled="upload.isUploading"
+      :on-progress="handleFileUploadProgress"
+      :on-success="handleFileSuccess"
+      :on-error="errorFile"
+      :auto-upload="false"
+      drag
+      >
+      <i class="el-icon-upload"></i>
+      <div class="el-upload__text">
+        将文件拖到此处,或
+        <em>点击上传</em>
+      </div>
+      <!-- <div class="el-upload__tip" slot="tip">
+        <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+      </div> -->
+      <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+      <div slot="footer">
+      <el-button size="mini" type="primary" @click="submitFileForm">确 定</el-button>
+      <el-button size="mini" @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+// 导入的token
+import { getToken } from "@/utils/auth";
+import { getEquipmentDataList, downLoadMb } from '@/api/purchase/equipmentData.js'
+export default {
+  name: "equipmentData",
+  dicts: [],
+  components: {
+    Add: () => import("./add.vue"),
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
+  },
+  data() {
+    return {
+      // 导入参数
+      upload: {
+        // 是否显示弹出层(导入)
+        open: false,
+        // 弹出层标题(导入)
+        title: "数据导入",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 1,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/device/origin/importData"
+      },
+      // 页面配置
+      isList: true,
+      // 页面状态
+      page: '',
+      disable: false,
+      rowDetail: {},
+
+      size: "mini",
+      loading: false,
+      params: {
+        materialCode: '',
+        materialName: '',
+        deviceCategory: ''
+      },
+      pageInfo: {
+        pageNum: 1,
+        pageSize: 20,
+        total: 0
+      },
+      tableData: [],
+      selectData: [],
+      // SearchColumns: SearchColumns,
+      TableColumns: [
+        { item: { key: "materialCode", title: "物料编码", width: 150 }, attr: {} },
+        { item: { key: "materialName", title: "物料名称", width: 150 }, attr: {} },
+        { item: { key: "deviceCategory", title: "设备类别", width: 150 }, attr: {} },
+        { item: { key: "factoryName", title: "厂家名称", width: 150 }, attr: {} },
+        { item: { key: "model", title: "型号", width: 150 }, attr: {} },
+        { item: { key: "price", title: "价格", width: 150 }, attr: {} },
+        { item: { key: "parameters", title: "参数", width: 150 }, attr: {} },
+        { item: { key: "province", title: "省份", width: 150 }, attr: {} },
+        { item: { key: "largeZoneCommander", title: "大区负责人", width: 150 }, attr: {} },
+        { item: { key: "serviceManager", title: "业务经理", width: 150 }, attr: {} },
+        { item: { key: "afterSalesEngineer", title: "售后工程师", width: 150 }, attr: {} },
+        { item: { key: "remark", title: "备注", width: 150 }, attr: {} },
+      ],
+    }
+  },
+  created() {
+    this.useQuery(this.params, this.pageInfo)
+  },
+  methods: {
+    useSee() {},
+    useSelect() {},
+    // 加载列表
+    async useQuery(prop, page) {
+      let params = {...prop, ...page}
+      await getEquipmentDataList(params).then(res => {
+        if( res.code === 200 ) {
+          this.tableData = res.rows
+          this.pageInfo.total = res.total
+        }
+      })
+    },
+    // 新增
+    addDivision() {
+      this.isList = false
+      this.page = 'add'
+      this.disable = false
+    },
+    // 下载模板
+    async downLoadMb() {
+      this.$modal.loading("正在下载模板,请稍后...");
+      downLoadMb().then(res => {
+        this.$modal.closeLoading();
+        const blob = new Blob([res], {
+          type: "application/vnd.ms-excel;charset=UTF-8",
+        });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+        const downloadElement = document.createElement("a"); //创建a标签
+        const href = window.URL.createObjectURL(blob); // 创建下载的链接
+        // var temp = res.headers["content-disposition"]; 
+        // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
+        // var name = fileName.split(";")[0]; //切割成文件名
+        downloadElement.href = href;  //下载地址
+        downloadElement.download = '设备产品数据库模板'+ this.parseTime(new Date().getTime()) + ".xlsx"; // 下载后文件名
+        document.body.appendChild(downloadElement);
+        downloadElement.click(); // 点击下载
+        document.body.removeChild(downloadElement); // 下载完成移除元素
+        window.URL.revokeObjectURL(href); // 释放blob对象
+        this.download.open = false
+      }).catch(err => {
+        this.$modal.closeLoading();
+      })
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+      this.$modal.loading("正在导入数据,请稍后...");
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.$modal.closeLoading();
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+      this.useQuery(this.params, this.pageInfo)
+    },
+    errorFile(err) {
+      this.$modal.closeLoading();
+      this.$modal.notifyError("文件已变动,请重新上传");
+    },
+        // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+    searchList() {
+      this.useQuery(this.params, this.pageInfo)
+    },
+    resetList() {
+      this.params = {
+        materialCode: '',
+        materialName: '',
+        deviceCategory: '',
+      }
+      this.useQuery(this.params, this.pageInfo)
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+#equipmentData {
+  padding: 12px;
+  box-sizing: border-box;
+  overflow-y: scroll;
+}
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+</style>