فهرست منبع

调价列表批量导入处理

FengChaoYu 3 سال پیش
والد
کامیت
1c40185cc6

+ 54 - 3
src/views/basic_data/material/modify_list.vue

@@ -116,8 +116,32 @@
       <!-- 按钮 -->
       <div class="btn-group clearfix">
         <div class="fl">
-          <el-button type="primary"  v-if="$checkBtnRole('add', $route.meta.roles)"  icon="el-icon-plus" size="mini" @click="addFn">新增</el-button>
+<!--          <el-button type="primary"  v-if="$checkBtnRole('add', $route.meta.roles)"  icon="el-icon-plus" size="mini" @click="addFn">新增</el-button>-->
           <!-- <el-button type="primary" size="mini">编辑</el-button> -->
+          <el-upload
+            v-if="$checkBtnRole('add', $route.meta.roles)"
+            style="margin-bottom: 10px;"
+            class="import-btn"
+            :action="baseURL + 'student/import'"
+            :http-request="handleImport"
+            :file-list="importFileList"
+            :show-file-list="false"
+            :disabled="importLoading"
+            v-loading="importLoading"
+          >
+            <el-button
+              type="primary"
+              size="mini"
+            >导入调价单
+            </el-button>
+          </el-upload>
+          <el-button
+            v-if="$checkBtnRole('add', $route.meta.roles)"
+            type="primary"
+            size="mini"
+            @click="hanleDownloadFiles"
+          >下载模板
+          </el-button>
           <el-popconfirm
            v-if="$checkBtnRole('del', $route.meta.roles)"
             confirm-button-text="好的"
@@ -499,13 +523,16 @@ import {
   getTypeList,
   examineData
 } from '@/api/basic_data/material'
-import { downloadFiles } from '@/utils/util'
+import {downloadFiles, handleImport} from '@/utils/util'
 import { getCategoryList } from '@/api/common'
 
 export default {
   mixins: [Mixin],
   data() {
     return {
+      baseURL: '',
+      importFileList: [],
+      importLoading: false,
       show: 1,
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
@@ -753,7 +780,6 @@ export default {
     },
     resetInfo() {
       this.diaLogForm = {
-        id: null,
         composeNumber: "",
         id: "",
         items: [],
@@ -763,6 +789,31 @@ export default {
         productVolume: "",
       };
     },
+    // 导入
+    async handleImport(param) {
+      this.importLoading = true
+      const file = param.file
+      const formData = new FormData()
+      formData.append('file', file)
+
+      const result = await handleImport('/product-upd-price/material/import', formData)
+      this.importLoading = false
+      this.importFileList = []
+      if (result.code === 200) {
+        this.$alert('成功处理记录数:' + result.data, '导入成功', {
+          confirmButtonText: '确定'
+        })
+        this.getList()
+      } else {
+        this.$alert(result.message, '导入失败', {
+          confirmButtonText: '确定'
+        })
+      }
+    },
+    // 下载经销商模板
+    hanleDownloadFiles() {
+      downloadFiles('/product-upd-price/download')
+    },
   },
 };
 </script>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 381 - 351
src/views/supply/price/components/modify_list-apply.vue


+ 74 - 8
src/views/supply/price/modify_list.vue

@@ -100,7 +100,14 @@
                   ></el-input>
                 </el-form-item>
               </el-col>
-
+              <el-col :xs="24" :sm="12" :lg="6">
+                <el-form-item label="备注" prop="remark">
+                  <el-input
+                    placeholder="请输入备注"
+                    v-model="screenForm.remark"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
               <el-col :xs="24" :sm="24" :lg="24" class="tr">
                 <el-form-item label="">
                   <el-button size="mini" @click="resetScreenForm">清空</el-button>
@@ -116,8 +123,32 @@
       <!-- 按钮 -->
       <div class="btn-group clearfix">
         <div class="fl">
-          <el-button type="primary"  v-if="$checkBtnRole('add', $route.meta.roles)"  icon="el-icon-plus" size="mini" @click="addFn">新增</el-button>
+<!--          <el-button type="primary"  v-if="$checkBtnRole('add', $route.meta.roles)"  icon="el-icon-plus" size="mini" @click="addFn">新增</el-button>-->
           <!-- <el-button type="primary" size="mini">编辑</el-button> -->
+          <el-upload
+            v-if="$checkBtnRole('add', $route.meta.roles)"
+            style="margin-bottom: 10px;"
+            class="import-btn"
+            :action="baseURL + 'student/import'"
+            :http-request="handleImport"
+            :file-list="importFileList"
+            :show-file-list="false"
+            :disabled="importLoading"
+            v-loading="importLoading"
+          >
+            <el-button
+              type="primary"
+              size="mini"
+            >导入调价单
+            </el-button>
+          </el-upload>
+          <el-button
+            v-if="$checkBtnRole('add', $route.meta.roles)"
+            type="primary"
+            size="mini"
+            @click="hanleDownloadFiles"
+          >下载模板
+          </el-button>
           <el-popconfirm
            v-if="$checkBtnRole('del', $route.meta.roles)"
             confirm-button-text="好的"
@@ -131,7 +162,7 @@
             <el-button
               type="primary"
               size="mini"
-                icon="el-icon-delete"
+              icon="el-icon-delete"
               slot="reference"
               class="el-popover-left"
               >删除</el-button
@@ -499,13 +530,15 @@ import {
   getTypeList,
   examineData
 } from '@/api/basic_data/material'
-import { downloadFiles } from '@/utils/util'
+import {downloadFiles, handleImport} from '@/utils/util'
 import { getCategoryList } from '@/api/common'
 
 export default {
   mixins: [Mixin],
   data() {
     return {
+      baseURL: '',
+      importFileList: [],
       show: 1,
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
@@ -539,7 +572,8 @@ export default {
         materialOldNumber:'',
         saleTypeId:'',
         k3CategoryNumber:'',
-        specification:''
+        specification:'',
+        remark: ''
       },
       liDetail: {},
       detail: {},
@@ -584,8 +618,13 @@ export default {
       return {
         materialName: this.screenForm.materialName,
         materialNumber: this.screenForm.materialNumber,
-        startDate:this.screenForm.startDate,
-         billType:'HOME'
+        startDate: this.screenForm.startDate,
+        materialOldNumber:this.screenForm.materialOldNumber,
+        saleTypeId:this.screenForm.saleTypeId,
+        k3CategoryNumber:this.screenForm.k3CategoryNumber,
+        specification:this.screenForm.specification,
+        remark: this.screenForm.remark,
+        billType:'HOME'
       };
     },
   },
@@ -684,6 +723,7 @@ export default {
         saleTypeId:this.screenForm.saleTypeId,
         k3CategoryNumber:this.screenForm.k3CategoryNumber,
         specification:this.screenForm.specification,
+        remark: this.screenForm.remark,
         billType:'HOME'
       };
       getProductRriceList(params).then((res) => {
@@ -740,13 +780,13 @@ export default {
         customerName: this.screenForm.customerName,
         freeDay: this.screenForm.freeDay,
         toll: this.screenForm.toll,
+        remark: this.screenForm.remark,
         billType:'HOME'
       };
       downloadFiles("/product-compose/export", screenData);
     },
     resetInfo() {
       this.diaLogForm = {
-        id: null,
         composeNumber: "",
         id: "",
         items: [],
@@ -756,6 +796,32 @@ export default {
         productVolume: "",
       };
     },
+    // 导入
+    async handleImport(param) {
+      this.importLoading = true
+      const file = param.file
+      const formData = new FormData()
+      formData.append('file', file)
+      formData.append('billType', 'HOME')
+
+      const result = await handleImport('/product-upd-price/material/import', formData)
+      this.importLoading = false
+      this.importFileList = []
+      if (result.code === 200) {
+        this.$alert('成功处理记录数:' + result.data, '导入成功', {
+          confirmButtonText: '确定'
+        })
+        this.getList()
+      } else {
+        this.$alert(result.message, '导入失败', {
+          confirmButtonText: '确定'
+        })
+      }
+    },
+    // 下载经销商模板
+    hanleDownloadFiles() {
+      downloadFiles('/product-upd-price/download')
+    },
   },
 };
 </script>

+ 1 - 1
src/views/supply/price/price_list.vue

@@ -98,7 +98,7 @@
             </el-form-item>
           </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="备注" prop="specification">
+            <el-form-item label="备注" prop="remark">
               <el-input
                 v-model="screenForm.remark"
                 placeholder="请输入备注"

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است