浏览代码

Merge remote-tracking branch 'origin/dev' into dev

001295 1 年之前
父节点
当前提交
8b4611a46f

+ 9 - 0
src/api/business/purchase/catalogue.js

@@ -55,3 +55,12 @@ export function EXPORT(data) {
     data: data,
   });
 }
+// 采购需求单导出
+export function exportAll(data) {
+  return request({
+    url: `/pu/price/catalogue/export`,
+    method: 'post',
+    data: data,
+    responseType: 'blob'
+  })
+}

+ 21 - 1
src/api/business/purchase/purchase-order.js

@@ -152,6 +152,8 @@ const toOA =(userName, fdId) => {
   })
 }
 
+
+
 // 采购订单修订导出
 const orderExport =(data) => {
   return request({
@@ -161,6 +163,23 @@ const orderExport =(data) => {
   })
 }
 
+// 行导入
+const orderImport = (data) =>{
+  return request({
+    url: "/pu/order/import",
+    method: "POST",
+    data: data,
+  });
+}
+// 模板下载
+const downloadFailData = (data) =>{
+  return request({
+    url: "/pu/order/downloadFailData",
+    method: "POST",
+    data: data,
+  });
+}
+
 export default {
   list,
   details,
@@ -180,5 +199,6 @@ export default {
   returnedGoods,
   toOA,
   orderExport,
-
+  orderImport,
+  downloadFailData,
 }

+ 9 - 0
src/api/classify/basic.js

@@ -40,3 +40,12 @@ export function edit(data) {
     data: data
   })
 }
+// 物料基本分类模板下载
+export function downLoadClassify(data) {
+  return request({
+    url: `/system/classify/download`,
+    method: 'post',
+    data: data,
+    responseType: 'blob'
+  })
+}

+ 65 - 13
src/components/BatchImport/index.vue

@@ -34,16 +34,13 @@ export default {
     },
   },
   computed:{
-    tips:{
-      get(){
-        // this.accept.
-      },
-      set(){},
-    },
      // 是否显示提示
      showTip() {
       return this.isShowTip && (this.fileType || this.fileSize);
     },
+    accept(){
+      return this.fileType.map(item =>(`.${item}`)).join(',');
+    }
   },
   data(){
     return {
@@ -51,21 +48,33 @@ export default {
       visible:false,
       loading:false,
       fileList:[],
+      number: 0,
 
     }
   },
   methods:{
     // 确认上传
     async submitUpload(){
+      if(this.fileList.length){
+        this.$emit('import',this.fileList);
+      }else{
+      this.$notify.warning({
+        title:'警告',
+        message: '请上传文件之后在确认!',
+      });
 
+      }
+      
     },
     // 模板下载
     async templateDownload(){
+      this.$emit('temDownload')
       // 放父组件
       // this.download('/system/material/download', {}, `物料基本信息模板.xlsx`);
     },
     // 
     beforeClose(done){
+      this.fileList = [];
       // 关闭前清空
       done();
     },
@@ -79,9 +88,44 @@ export default {
     onChange(file, fileList){
       this.fileList = fileList;
     },
+    setVisible(prop){
+      this.visible = prop;
+      if(!prop){
+        this.fileList = [];
+      }
+    },
+    open(){
+      this.setVisible(true);
+    },
     // 取消
     cancal(){
-      this.visible = false;
+      this.setVisible(false);
+    },
+     // 上传前校检格式和大小
+     handleBeforeUpload(file) {
+      // 校检文件类型
+      if (this.fileType) {
+        const fileName = file.name.split(".");
+        const fileExt = fileName[fileName.length - 1];
+        const isTypeOk = this.fileType.indexOf(fileExt) >= 0;
+        if (!isTypeOk) {
+          this.$modal.msgError(
+            `文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
+          );
+          return false;
+        }
+      }
+      // 校检文件大小
+      if (this.fileSize) {
+        const isLt = file.size / 1024 / 1024 < this.fileSize;
+        if (!isLt) {
+          this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize} MB!`);
+          return false;
+        }
+      }
+      this.$modal.loading("正在上传文件,请稍候...");
+      this.number++;
+      return true;
     },
     
   },
@@ -90,7 +134,12 @@ export default {
 </script>
 
 <template>
-  <el-button :disabled="disabled">
+  <el-button 
+    :disabled="disabled"
+    :size="size"
+    @click="open"
+    type="primary"
+  >
     {{ title }}
     <el-dialog 
       :title="title" 
@@ -99,25 +148,28 @@ export default {
       width="35%" 
       center
       :before-close="beforeClose"
+      append-to-body
     >
       <el-upload
         ref="upload"
-        :accept="accept"
         action="#"
         :on-preview="handlePreview"
+        :accept="accept"
+        :before-upload="handleBeforeUpload"
         :on-remove="handleRemove"
         :file-list="fileList"
         :auto-upload="false"
         :on-change="onChange" 
         :limit="limit"
-        append-to-body
+        :disabled="disabled"
+        style="text-align: center;"
       >
         <el-button 
           slot="trigger" 
           :size="size" 
           type="primary"
         >选取文件</el-button>
-        <el-button 
+        <el-button
           v-if="isTemplate"
           style="margin-left: 10px;" 
           :size="size" 
@@ -136,8 +188,8 @@ export default {
       </el-upload>
 
       <div slot="footer" class="dialog-footer">
-        <el-button @click="cancal">取 消</el-button>
-        <el-button type="primary" @click="submitUpload">确 定</el-button>
+        <el-button type="primary" @click="submitUpload" :size="size">确 定</el-button>
+        <el-button @click="cancal" :size="size">取 消</el-button>
       </div>
     </el-dialog>
   </el-button>

+ 1 - 1
src/utils/init.js

@@ -50,5 +50,5 @@ export const initDicts = (prop) => {
 };
 
 export const initPage = () => {
-  return { pageNum: 1, pageSize: 20, total: 0 };
+  return { pageNum: 1, pageSize: 100, total: 0 };
 };

+ 15 - 7
src/views/material/basicFile/index.vue

@@ -111,7 +111,7 @@
         border 
         :data="taskList" 
         ref="materialTable" 
-        max-height="550"
+        max-height="525"
         @cell-dblclick="handledbClick" 
         :row-key="getRowKey"
         @selection-change="handleSelectionChange" 
@@ -153,15 +153,23 @@
         </el-table-column>
       </el-table>
 
-      <el-pagination 
+      <pagination
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="handleQuery"
+        style="height: 32px; padding: 0 !important; "
+      />
+
+      <!-- <el-pagination 
         @size-change="handleSizeChange" 
         @current-change="handleCurrentChange"
         :current-page="queryParams.pageNum" 
-        :page-sizes="[10, 20, 50, 100]"
+        :page-sizes="[10, 20, 50, 100,200,500]"
         layout="total, sizes, prev, pager, next, jumper" 
         :total="total"
       >
-      </el-pagination>
+      </el-pagination> -->
     </el-card>
 
     <!-- 操作提示 -->
@@ -234,7 +242,7 @@
         // 查询参数
         queryParams: {
           pageNum: 1,
-          pageSize: 10,
+          pageSize: 100,
           code: null,
           name: null
         },
@@ -335,7 +343,7 @@
 
         this.queryParams.pageNum = 1;
       
-        this.queryParams.pageSize = 10;
+        this.queryParams.pageSize = 100;
 
         this.params = this.$init.params(SearchColumns);
 
@@ -664,7 +672,7 @@
       padding: 10px;
 
       .el-table {
-        overflow: auto;
+        // overflow: auto;
 
         .el-table__body-wrapper {
           overflow-y: auto !important;

+ 2 - 1
src/views/material/changeApply/add/column.js

@@ -370,7 +370,8 @@ export default function useColumns(){
         {
           item:{
             key:'medicalDevices',
-            title:'医疗器械',
+            // title:'医疗器械',
+            title:'管理类别',
           },
           attr:{
             is: "el-select",

+ 1 - 1
src/views/material/changeApply/index.vue

@@ -99,7 +99,7 @@ export default {
       size:'mini',
       tableList: [],
       TableColumns:TableColumns,
-      page: { pageNum: 1, pageSize: 10, total: 0 },
+      page: { pageNum: 1, pageSize: 100, total: 0 },
       params:params,
       SearchColumns:SearchColumns,
       optionType:'add',

+ 103 - 2
src/views/material/classify/index.vue

@@ -5,6 +5,8 @@
 
       <el-row :gutter="10" class="mb10">
         <div>
+          <el-button type="primary" size="mini" @click="mbDownload">模板下载</el-button>
+          <el-button type="primary" size="mini" @click="importMb">导入</el-button>
           <el-button type="primary" size="mini" plain @click="addClassify">新增</el-button>
           <el-button type="primary" size="mini" plain @click="editClassify">修改</el-button>
           <el-button type="primary" size="mini" plain @click="refreshData">{{refreshName ? '全部分类': '过滤停用'}}</el-button>
@@ -140,10 +142,10 @@
             <el-row :gutter="20">
               <el-col :span="24">
                 <el-form-item v-if="!disable">
-                  <el-button type="primary" @click="submitForm('ruleForm')"
+                  <el-button size="mini" type="primary" @click="submitForm('ruleForm')"
                     >保存</el-button
                   >
-                  <el-button @click="resetForm('ruleForm')">取消</el-button>
+                  <el-button size="mini" @click="resetForm('ruleForm')">取消</el-button>
                 </el-form-item>
               </el-col>
             </el-row>
@@ -151,22 +153,71 @@
         </el-col>
       </el-row>
     </el-card>
+
+    <!-- 导入对话框 -->
+    <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="submitFile">确 定</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 {
   getTree,
   getDetail,
   add,
   delClassify,
   edit,
+  downLoadClassify,
 } from "@/api/classify/basic";
 export default {
   name: "classify",
   dicts: ["material_enable", "sys_assist_condtion"],
   data() {
     return {
+      // 导入参数
+      upload: {
+        // 是否显示弹出层(导入)
+        open: false,
+        // 弹出层标题(导入)
+        title: "数据导入",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 1,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/system/classify/import"
+      },
       loading: false,
       filterText: "",
       data: [],
@@ -406,6 +457,56 @@ export default {
         this.getTreeData();
       }
     },
+    // 模板下载
+    mbDownload() {
+      this.$modal.loading("正在下载模板,请稍后...");
+      downLoadClassify({}).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();
+      })
+    },
+    // 文件导入
+    importMb() {
+      this.upload.open = true
+    },
+    // 文件上传中处理
+    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.getTreeData();
+    },
+    errorFile(err) {
+      this.$modal.closeLoading();
+      this.$modal.notifyError("文件已变动,请重新上传");
+    },
+    // 提交上传文件
+    submitFile() {
+      this.$refs.upload.submit();
+    },
   },
 };
 </script>

+ 6 - 4
src/views/material/requisition/add.vue

@@ -509,7 +509,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="6">
-              <el-form-item label="医疗器械" prop="medicalInstruments">
+              <el-form-item label="管理类别" prop="medicalInstruments">
                 <el-select v-model="basicForm2.medicalInstruments" placeholder="请选择" clearable
                            :disabled="disable || isControl">
                   <el-option v-for="dict in dict.type.medical_instruments" :key="dict.value" :label="dict.label"
@@ -991,10 +991,10 @@
         }
       } else if (this.pageStu == 'edit') {
         // alert('修改页面')
-        console.log('页面状态', this.pageStu)
-        console.log('数据', this.row)
+        // console.log('页面状态', this.pageStu)
+        // console.log('数据', this.row)
         this.getDetails(this.row)
-        console.log('修改页面-批号库存管理状态', this.row.isInventoryStatus)
+        // console.log('修改页面-批号库存管理状态', this.row.isInventoryStatus)
         this.stockControl(this.row.isInventoryStatus)
         // 控制效期单位后面的是否可填写
         if (this.row.expiryDateManagerment == '0') {
@@ -1159,7 +1159,9 @@
       },
       // 用于回显四级分类树形选择
       getTreeDetails(id) {
+        console.log(id,'用于回显四级分类树形选择');
         getDetail(id).then(res => {
+          console.log(res,'用于回显四级分类树形选择');
           if (res.code === 200) {
             this.testOptions.push(res.data)
             this.basicForm.oneClass = res.data.oneClass

+ 1 - 1
src/views/material/requisition/index.vue

@@ -156,7 +156,7 @@
         params:params,
         SearchColumns:SearchColumns,
         TableColumns:TableColumns,
-        pageStatus: { pageNum: 1, pageSize: 10, total: 0 },
+        pageStatus: { pageNum: 1, pageSize: 100, total: 0 },
         queryParams: {
           billCode: '',
           name: '',

+ 0 - 3
src/views/purchase/DemandSummary/index.vue

@@ -235,7 +235,6 @@
         <el-table
           v-loading="loading"
           :data="tableList" 
-          fit
           :cell-style="{ borderColor: '#c0c0c0' }"
           :header-cell-style="{ borderColor: '#c0c0c0' }"
           class="exporttable"
@@ -250,7 +249,6 @@
           @row-click="rowSelect"
           @row-dblclick="doubleClick"
           ref="table"
-          :key="isUpdate"
         >
           <el-table-column type="selection" width="60" fixed="left"/>
           <el-table-column show-overflow-tooltip  label="序号" type="index" align="center" width="50px" fixed="left"/>
@@ -441,7 +439,6 @@ export default {
             return '手工新增'
         }
       },
-      isUpdate: false,
       expanded: false,
       // 页面配置
       isList: true,

+ 4 - 0
src/views/purchase/PurchaseDemandList/index.vue

@@ -592,6 +592,8 @@ export default {
             downloadElement.click(); // 点击下载
             document.body.removeChild(downloadElement); // 下载完成移除元素
             window.URL.revokeObjectURL(href); // 释放blob对象
+          }).catch(err => {
+            this.$modal.closeLoading();
           })
         }
       } else {
@@ -613,6 +615,8 @@ export default {
           downloadElement.click(); // 点击下载
           document.body.removeChild(downloadElement); // 下载完成移除元素
           window.URL.revokeObjectURL(href); // 释放blob对象
+        }).catch(err => {
+          this.$modal.closeLoading();
         })
       }
     },

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

@@ -337,36 +337,36 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { priceDiffer = 0, recentlyPrice = 0 } = prop;
-              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) + '%' : "0.0%");
+              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) : 0);
             },
           },
         },
 
         {
-          item: { width: 100, key: "ypurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
           attr: {
             // is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop.ypurchaseQuantity
+              return prop.yPurchaseQuantity
             },
           },
         },
         {
-          item: { width: 100, key: "ypurchaseVolume", title: "预计年采购额" },
+          item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
           attr: {
             formatter: (prop) => {
-              const { taxPrice = 0, ypurchaseQuantity = 0 } = prop;
-              return (prop.ypurchaseVolume = (Number(taxPrice) * Number(ypurchaseQuantity)).toFixed(2));
+              const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
+              return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
             },
           },
         },
         {
-          item: { width: 100, key: "yaffectedAmount", title: "预计年影响金额" },
+          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
           attr: {
             formatter: (prop) => {
-              const { priceDiffer = 0, ypurchaseQuantity = 0 } = prop;
-              return (prop.yaffectedAmount =
-                Number(priceDiffer) * Number(ypurchaseQuantity));
+              const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
+              return (prop.yAffectedAmount =
+                Number(priceDiffer) * Number(yPurchaseQuantity));
             },
           },
         },

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

@@ -337,36 +337,36 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { priceDiffer = 0, recentlyPrice = 0 } = prop;
-              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) + '%' : "0.0%");
+              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) : 0);
             },
           },
         },
 
         {
-          item: { width: 100, key: "ypurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
           attr: {
             // is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop.ypurchaseQuantity
+              return prop.yPurchaseQuantity
             },
           },
         },
         {
-          item: { width: 100, key: "ypurchaseVolume", title: "预计年采购额" },
+          item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
           attr: {
             formatter: (prop) => {
-              const { taxPrice = 0, ypurchaseQuantity = 0 } = prop;
-              return (prop.ypurchaseVolume = (Number(taxPrice) * Number(ypurchaseQuantity)).toFixed(2));
+              const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
+              return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
             },
           },
         },
         {
-          item: { width: 100, key: "yaffectedAmount", title: "预计年影响金额" },
+          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
           attr: {
             formatter: (prop) => {
-              const { priceDiffer = 0, ypurchaseQuantity = 0 } = prop;
-              return (prop.yaffectedAmount = (
-                Number(priceDiffer) * Number(ypurchaseQuantity)
+              const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
+              return (prop.yAffectedAmount = (
+                Number(priceDiffer) * Number(yPurchaseQuantity)
               ));
             },
           },

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

@@ -337,36 +337,36 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { priceDiffer = 0, recentlyPrice = 0 } = prop;
-              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) + '%': "0.0%");
+              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1): 0);
             },
           },
         },
 
         {
-          item: { width: 100, key: "ypurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
           attr: {
             // is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop.ypurchaseQuantity
+              return prop.yPurchaseQuantity
             },
           },
         },
         {
-          item: { width: 100, key: "ypurchaseVolume", title: "预计年采购额" },
+          item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
           attr: {
             formatter: (prop) => {
-              const { taxPrice = 0, ypurchaseQuantity = 0 } = prop;
-              return (prop.ypurchaseVolume = (Number(taxPrice) * Number(ypurchaseQuantity)).toFixed(2));
+              const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
+              return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
             },
           },
         },
         {
-          item: { width: 100, key: "yaffectedAmount", title: "预计年影响金额" },
+          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
           attr: {
             formatter: (prop) => {
-              const { priceDiffer = 0, ypurchaseQuantity = 0 } = prop;
-              return (prop.yaffectedAmount = (
-                Number(priceDiffer) * Number(ypurchaseQuantity)
+              const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
+              return (prop.yAffectedAmount = (
+                Number(priceDiffer) * Number(yPurchaseQuantity)
               ));
             },
           },

+ 186 - 178
src/views/purchase/apply/index.vue

@@ -1,137 +1,105 @@
 <script>
-import { dicts } from "./dicts";
-import useColumns from "./columns";
-import { LIST, mbDownload, failDownload} from "@/api/business/purchase/apply";
-// 导入的token
-import { getToken } from "@/utils/auth";
+  import {dicts} from "./dicts";
+  import useColumns from "./columns";
+  import {LIST, mbDownload, failDownload} from "@/api/business/purchase/apply";
+  // 导入的token
+  import {getToken} from "@/utils/auth";
 
-export default {
-  name: "PuchaseApply",
-  dicts: dicts,
-  components: {
-    SeeButton: () => import("./see/index.vue"),
-    AddButton: () => import("./add/index.vue"),
-    CopyButton: () => import("./copy/index.vue"),
-    EditButton: () => import("./edit/index.vue"),
-    DeleButton: () => import("./delete/index.vue"),
-    SubmButton: () => import("./submit/index.vue"),
-    ElSuperTable: () => import("@/components/super-table/index.vue"),
-    ElSuperSearch: () => import("@/components/super-search/index.vue"),
-  },
-  data() {
-    const { TableColumns, SearchColumns } = useColumns();
-    const page = this.$init.page();
-    const params = this.$init.params(SearchColumns);
-    return {
-      // 导入参数
-      upload: {
-        // 是否显示弹出层(导入)
-        open: false,
-        // 弹出层标题(导入)
-        title: "数据导入",
-        // 是否禁用上传
-        isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 1,
-        // 设置上传的请求头部
-        headers: { Authorization: "Bearer " + getToken() },
-        // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/pu/priceApply/import"
-      },
-      size: "mini",
-      loading: false,
-      params: params,
-      page: page,
-      tableData: [],
-      selectData: [],
-      SearchColumns: SearchColumns,
-      TableColumns: TableColumns,
-    };
-  },
-  computed: {},
-  created() {
-    this.useQuery(this.params, this.page);
-  },
-  methods: {
-    //
-    async fetchList(prop, page) {
-      try {
-        this.loading = true;
-        const { pageNum, pageSize } = page;
-        const { code, rows, total } = await LIST(
-          { ...prop },
-          { pageNum, pageSize }
-        );
-        if (code === 200) {
-          this.tableData = rows.map((item, index) => ({
-            ...item,
-            $index: (pageNum - 1) * pageSize + index + 1,
-          }));
-          this.page.total = total;
-        }
-      } catch (err) {
-        // catch
-        console.error(err);
-      } finally {
-        // finally
-        this.loading = false;
-      }
+  export default {
+    name: "PuchaseApply",
+    dicts: dicts,
+    components: {
+      SeeButton: () => import("./see/index.vue"),
+      AddButton: () => import("./add/index.vue"),
+      CopyButton: () => import("./copy/index.vue"),
+      EditButton: () => import("./edit/index.vue"),
+      DeleButton: () => import("./delete/index.vue"),
+      SubmButton: () => import("./submit/index.vue"),
+      ElSuperTable: () => import("@/components/super-table/index.vue"),
+      ElSuperSearch: () => import("@/components/super-search/index.vue"),
     },
-    // 查 询
-    useQuery(prop, page) {
-      this.fetchList(prop, page);
+    data() {
+      const {TableColumns, SearchColumns} = useColumns();
+      const page = this.$init.page();
+      const params = this.$init.params(SearchColumns);
+      return {
+        // 导入参数
+        upload: {
+          // 是否显示弹出层(导入)
+          open: false,
+          // 弹出层标题(导入)
+          title: "数据导入",
+          // 是否禁用上传
+          isUploading: false,
+          // 是否更新已经存在的用户数据
+          updateSupport: 1,
+          // 设置上传的请求头部
+          headers: {Authorization: "Bearer " + getToken()},
+          // 上传的地址
+          url: process.env.VUE_APP_BASE_API + "/pu/priceApply/import"
+        },
+        size: "mini",
+        loading: false,
+        params: params,
+        page: page,
+        tableData: [],
+        selectData: [],
+        SearchColumns: SearchColumns,
+        TableColumns: TableColumns,
+      };
     },
-    // 重 置
-    useReset() {
-      this.page = this.$init.page();
-      this.params = this.$init.params(this.SearchColumns);
+    computed: {},
+    created() {
       this.useQuery(this.params, this.page);
     },
-    // 选 择
-    useSelect(prop) {
-      this.selectData = prop;
-    },
-    // 明 细
-    async useSee(prop) {
-      const { open } = this.$refs.SeeButton;
-      await open([prop]);
-    },
-    // 下载模板
-    downLoadMb() {
-      this.$modal.loading("正在下载模板,请稍后...");
-      mbDownload().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); // 创建下载的链接
-        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对象
-      }).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.data.msg, "导入结果", { dangerouslyUseHTMLString: true });
-      // 有失败的再次下载下来
-      if(response.data.flag) {
-        this.$modal.loading("正在下载导入失败数据,请稍后...");
-        failDownload({failDatas:response.data.datas}).then(res => {
+    methods: {
+      //
+      async fetchList(prop, page) {
+        try {
+          this.loading = true;
+          const {pageNum, pageSize} = page;
+          const {code, rows, total} = await LIST(
+            {...prop},
+            {pageNum, pageSize}
+          );
+          if (code === 200) {
+            this.tableData = rows.map((item, index) => ({
+              ...item,
+              $index: (pageNum - 1) * pageSize + index + 1,
+            }));
+            this.page.total = total;
+          }
+        } catch (err) {
+          // catch
+          console.error(err);
+        } finally {
+          // finally
+          this.loading = false;
+        }
+      },
+      // 查 询
+      useQuery(prop, page) {
+        this.fetchList(prop, page);
+      },
+      // 重 置
+      useReset() {
+        this.page = this.$init.page();
+        this.params = this.$init.params(this.SearchColumns);
+        this.useQuery(this.params, this.page);
+      },
+      // 选 择
+      useSelect(prop) {
+        this.selectData = prop;
+      },
+      // 明 细
+      async useSee(prop) {
+        const {open} = this.$refs.SeeButton;
+        await open([prop]);
+      },
+      // 下载模板
+      downLoadMb() {
+        this.$modal.loading("正在下载模板,请稍后...");
+        mbDownload().then(res => {
           this.$modal.closeLoading();
           const blob = new Blob([res], {
             type: "application/vnd.ms-excel;charset=UTF-8",
@@ -139,7 +107,7 @@ export default {
           const downloadElement = document.createElement("a"); //创建a标签
           const href = window.URL.createObjectURL(blob); // 创建下载的链接
           downloadElement.href = href;  //下载地址
-          downloadElement.download = '价格申报单导入失败数据' + this.parseTime(new Date().getTime()) + ".xlsx"; // 下载后文件名
+          downloadElement.download = '价格申报单导入模板' + this.parseTime(new Date().getTime()) + ".xlsx"; // 下载后文件名
           document.body.appendChild(downloadElement);
           downloadElement.click(); // 点击下载
           document.body.removeChild(downloadElement); // 下载完成移除元素
@@ -147,24 +115,63 @@ export default {
         }).catch(err => {
           this.$modal.closeLoading();
         })
-      }
-      this.useQuery(this.params, this.page);
-    },
-    errorFile(err) {
-      this.$modal.closeLoading();
-      this.$modal.notifyError("文件已变动,请重新上传");
-    },
-    // 提交上传文件
-    submitFileForm() {
-      this.$refs.upload.submit();
-    },
-    // 导入数据
-    importMb() {
-      this.upload.title = "文件导入"
-      this.upload.open = true
+      },
+      // 文件上传中处理
+      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();
+        if (response.code == 200) {
+          this.$alert(response.data.msg, "导入结果", {dangerouslyUseHTMLString: true});
+          // 有失败的再次下载下来
+          if (response.data.flag) {
+            this.$modal.loading("正在下载导入失败数据,请稍后...");
+            failDownload({failDatas: response.data.datas}).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); // 创建下载的链接
+              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对象
+            }).catch(err => {
+              this.$modal.closeLoading();
+            })
+          }
+        }else{
+          this.$notify({
+            message: response.msg,
+            type: response.code == 200 ? 'success' : 'warning'
+          });
+        }
+        this.useQuery(this.params, this.page);
+      },
+      errorFile(err) {
+        this.$modal.closeLoading();
+        this.$modal.notifyError("文件已变动,请重新上传");
+      },
+      // 提交上传文件
+      submitFileForm() {
+        this.$refs.upload.submit();
+      },
+      // 导入数据
+      importMb() {
+        this.upload.title = "文件导入"
+        this.upload.open = true
+      },
     },
-  },
-};
+  };
 </script>
 
 <template>
@@ -253,44 +260,45 @@ export default {
     <!-- 文件导入对话框 -->
     <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
+        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>
+        <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>
+        <el-button size="mini" type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button size="mini" @click="upload.open = false">取 消</el-button>
       </div>
     </el-dialog>
   </el-card>
 </template>
 <style scoped lang="scss">
-.el-card {
-  width: calc(100% - 32px);
-  height: calc(100vh - 32px);
-  margin: 16px;
-  padding: 16px;
-  border-radius: 8px;
-}
-.el-button-group + .el-button-group {
-  margin: 0 0 0 8px;
-}
+  .el-card {
+    width: calc(100% - 32px);
+    height: calc(100vh - 32px);
+    margin: 16px;
+    padding: 16px;
+    border-radius: 8px;
+  }
+
+  .el-button-group + .el-button-group {
+    margin: 0 0 0 8px;
+  }
 </style>

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

@@ -214,35 +214,35 @@ export default function useColumns() {
         },
 
         {
-          item: { width: 100, key: "increase", title: "涨幅" },
+          item: { width: 100, key: "increase", title: "涨幅(%)" },
           attr: {
             formatter: (prop) => {
               const { priceDiffer = 0, recentlyPrice = 0 } = prop;
-              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) + '%' : "0.0%");
+              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) + '%' : "0%");
             },
           },
         },
 
         {
-          item: { width: 100, key: "ypurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
           attr: {
             // is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop.ypurchaseQuantity
+              return prop.yPurchaseQuantity
             },
           },
         },
         {
-          item: { width: 100, key: "ypurchaseVolume", title: "预计年采购额" },
+          item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
           attr: {
             formatter: (prop) => {
-              const { taxPrice = 0, ypurchaseQuantity = 0 } = prop;
-              return (prop.ypurchaseVolume = (Number(taxPrice) * Number(ypurchaseQuantity)).toFixed(2));
+              const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
+              return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
             },
           },
         },
         {
-          item: { width: 100, key: "yaffectedAmount", title: "预计年影响金额" },
+          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {

+ 5 - 5
src/views/purchase/catalogue/columns.js

@@ -46,15 +46,15 @@ export default function useColumns() {
     },
     {
       item: { width: 100, key: "status", title: "有效状态" },
-      attr: { is: "el-dict-tag", dictName: "is_effective" },
+      attr: { is: "el-dict-tag", dictName: "price_invalid" },
     },
     {
       item: { width: 100, key: "enableStatus", title: "启用状态" },
-      attr: { is: "el-dict-tag", dictName: "is_effective" },
+      attr: { is: "el-dict-tag", dictName: "price_enable" },
     },
     {
       item: { width: 100, key: "materialStatus", title: "物料启用状态" },
-      attr: { is: "el-dict-tag", dictName: "is_effective" },
+      attr: { is: "el-dict-tag", dictName: "material_enable" },
     },
     {
       item: { width: 100, key: "isDistribution", title: "配送价" },
@@ -167,11 +167,11 @@ export default function useColumns() {
     },
     {
       item: { width: 100, key: "status", title: "有效状态" },
-      attr: { is: "el-select", dictName: "is_effective" },
+      attr: { is: "el-select", dictName: "price_invalid" },
     },
     {
       item: { width: 100, key: "enableStatus", title: "启用状态", span: 4 },
-      attr: { is: "el-select", dictName: "is_effective" },
+      attr: { is: "el-select", dictName: "price_enable" },
     },
     {
       item: { width: 100, key: "createTime", title: "价格日期", span: 8 },

+ 27 - 1
src/views/purchase/catalogue/index.vue

@@ -1,7 +1,7 @@
 <script>
 import { dicts } from "./dicts";
 import useColumns from "./columns";
-import { LIST } from "@/api/business/purchase/catalogue";
+import { LIST, exportAll } from "@/api/business/purchase/catalogue";
 
 export default {
   name: "PuchaseCatalogue",
@@ -90,6 +90,29 @@ export default {
       const { open } = this.$refs.SeeButton;
       await open([prop]);
     },
+    // 导出全部
+    exportAll() {
+      this.$modal.loading("正在导出数据,请稍后...");
+      exportAll().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对象
+      }).catch(err => {
+        this.$modal.closeLoading();
+      })
+    },
   },
 };
 </script>
@@ -150,6 +173,9 @@ export default {
           @success="useQuery(params, page)"
         ></exp-button>
       </el-button-group>
+      <el-button-group>
+        <el-button size="mini" @click="exportAll">全部导出</el-button>
+      </el-button-group>
     </div>
     <el-super-table
       v-model="tableData"

+ 3 - 3
src/views/purchase/catalogue/see/columns.js

@@ -45,15 +45,15 @@ export default function useColumns() {
     },
     {
       item: { width:100,key: "status", title: "有效状态" },
-      attr: { is: "el-dict-tag", dictName: "is_effective" },
+      attr: { is: "el-dict-tag", dictName: "price_invalid" },
     },
     {
       item: { width:100,key: "enableStatus", title: "启用状态" },
-      attr: { is: "el-dict-tag", dictName: "is_effective" },
+      attr: { is: "el-dict-tag", dictName: "price_enable" },
     },
     {
       item: { width:100,key: "materialStatus", title: "物料启用状态" },
-      attr: { is: "el-dict-tag", dictName: "is_effective" },
+      attr: { is: "el-dict-tag", dictName: "material_enable" },
     },
     {
       item: { width:100,key: "isDistribution", title: "配送价" },

+ 4 - 0
src/views/purchase/purchase-order/add/column.js

@@ -50,6 +50,7 @@ export const Columns = [
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
     width: 200, 
+    require: true,
     isShow:true,
   },
   {
@@ -61,6 +62,8 @@ export const Columns = [
     dataMapping: {
       supplier: "id",
       supplierName: "name",
+      paymentAgreement: 'paymentId',
+      paymentAgreementName: 'paymentName',
     },
     queryParams: () => ({}),
     require: true,
@@ -78,6 +81,7 @@ export const Columns = [
     },
     queryParams: () => ({}),
     isShow:true,
+    disabled:true,
     require: true,
   },
   {

+ 49 - 1
src/views/purchase/purchase-order/add/index.vue

@@ -24,6 +24,7 @@ export default {
   components: {
     FileUploadCenter: () => import("../components/FileUploadCenter/index.vue"),
     popDialog: () => import("@/components/PopDialog/index.vue"),
+    BatchImport: () => import("@/components/BatchImport/index.vue"),
   },
 
   data() {
@@ -388,7 +389,8 @@ export default {
               key != "buyerName" &&
               key != "puDept" &&
               key != "puDeptName" &&
-              key != "status"
+              key != "status" &&
+              key != "billDate" 
             ) {
               this.params[key] = "";
             } else {
@@ -499,6 +501,47 @@ export default {
     
     },
 
+    async handelImport(fileList){
+
+      try {
+
+        let formData = new FormData();
+
+        formData.append('file',fileList[0].raw);
+
+        this.$modal.loading("正在上传文件,请稍候...");
+
+        let {code,data} = await orderApi.orderImport(formData);
+
+        if(code == 200) {
+          // puOrderExecuteList puOrderItemList
+
+          for (const key in data) {
+          //  this.params[key] = data[key];
+          this.params[key].push(...data[key]);
+          }
+
+          let {setVisible} =  this.$refs.batchImport;
+
+          setVisible(false);
+
+          this.handleGetPrice();
+        }
+        
+      } catch (error) {
+        
+      }finally{
+        this.$modal.closeLoading();
+      }
+
+    },
+    
+    async handleTemDownload(){
+
+      this.download('/pu/order/downloadFailData',{}, `物料信息模板${new Date().getTime()}.xlsx`);
+    },
+
+
   },
   created() {
     console.log("ADD CREATED", this.params);
@@ -812,6 +855,11 @@ export default {
           <el-button size="mini" @click="addTableRow(params[tabName])"
             >增行</el-button
           >
+          <BatchImport
+            ref="batchImport"
+            @import="handelImport"
+            @temDownload="handleTemDownload"
+          ></BatchImport>
         </el-row>
       </el-card>
     </el-form>

+ 135 - 86
src/views/purchase/purchase-order/column.js

@@ -471,6 +471,8 @@ export const TableColumns = [
 }));
 
 export const TabColumns = [
+
+
   {
     title: '物料信息',
     key: 'puOrderItemList',
@@ -1086,24 +1088,27 @@ export const TabColumns = [
 export const SearchColumns = [
   {
     item:{
-      key: "source",
-      title: "订单来源",  
+      key: "orderCode",
+      title: "订单编号",  
     },
-    attr:{
+    attr: {
       clearable:true,
-      is: "el-select",
-      dictName: "order_source",
+      is: "el-input",
+      placeholder:'请输入订单编号,多个使用,隔开',
     },
   },
   {
     item:{
-      key: "orderCode",
-      title: "订单编号",  
+      key: "materialCode",
+      title: "物料编码",
     },
     attr: {
       clearable:true,
       is: "el-input",
-      placeholder:'请输入订单编号,多个使用,隔开',
+      placeholder:'请输入物料编码,多个使用,隔开',
+      // is: "el-popover-multiple-select-v2",
+      // valueKey: "code",
+      // referName: "MATERIAL_PARAM",
     },
   },
   {
@@ -1126,80 +1131,95 @@ export const SearchColumns = [
   },
   {
     item:{
-      key: "status",
-      title: "单据状态",
+      key: "puOrgIds",
+      title: "采购组织",
+    },
+    attr: {
+      clearable:true,
+      is: "el-popover-multiple-select-v2",
+      valueKey: "id",
+      referName: "ORG_PARAM",
+    },
+  },
+  {
+    item:{
+      key: "source",
+      title: "订单来源",  
     },
     attr:{
       clearable:true,
       is: "el-select",
-      dictName: "documents_status",
+      dictName: "order_source",
     },
   },
   { 
     item:{
-      key: "supplierName", 
-      title: "供应商", 
+      key: "erpOrderCode",
+      title: "ERP订单号", 
     },
     attr: {
       clearable:true,
-      is: "el-popover-select-v2",
-      valueKey: "name",
-      referName: "SUPPLIER_PARAM",
+      is: "el-input",
     },
   },
-  {
+  { 
     item:{
-      key: "puOrgIds",
-      title: "采购组织",
+      key: "supplierName", 
+      title: "供应商", 
     },
     attr: {
       clearable:true,
-      is: "el-popover-multiple-select-v2",
-      valueKey: "id",
-      referName: "ORG_PARAM",
+      is: "el-popover-select-v2",
+      valueKey: "name",
+      referName: "SUPPLIER_PARAM",
     },
   },
   {
     item:{
-      key: "materialCode",
-      title: "物料编码",
-    },
-    attr: {
-      clearable:true,
-      is: "el-input",
-      placeholder:'请输入物料编码,多个使用,隔开',
-      // is: "el-popover-multiple-select-v2",
-      // valueKey: "code",
-      // referName: "MATERIAL_PARAM",
+      key: "customerName",
+      title: "收货客户",
     },
+    attr:{
+      // clearable:true,
+      is: "el-popover-select-v2",
+      valueKey: "name",
+      referName: "CUSTOMER_PARAM",
+      dataMapping: {
+        customer: 'id',
+        customerName: 'name'
+      },
+    }
   },
+
+  // 物料分类
+
   {
     item:{
-      key: "materialName",
-      title: "物料名称",
+      key: "status",
+      title: "单据状态",
     },
-    attr: {
+    attr:{
       clearable:true,
-      is: "el-popover-select-v2",
-      valueKey: "name",
-      referName: "MATERIAL_PARAM",
+      is: "el-select",
+      dictName: "documents_status",
     },
   },
   { 
     item:{
-      key: "deliveryStatus",
-      title: "erp发送状态", 
+      key: "demandCode",
+      title: "采购需求单号", 
     },
-    attr:{
+    attr: {
       clearable:true,
-      is: "el-select",
-      dictName: "order_delivery_status",
+      is: "el-input",
+      placeholder:'请输入采购需求单号,多个使用,隔开',
     },
   },
   { 
+    // 生产厂家
     item:{
-      key: "contractNo",
-      title: "合同号", 
+      key: "manufacturerName",
+      title: "生产厂家代理人",
     },
     attr: {
       clearable:true,
@@ -1208,14 +1228,14 @@ export const SearchColumns = [
   },
   {
     item:{
-      key: "projectNowName",
-      title: "在建工程项目",
+      key: "createByName",
+      title: "制单人",
     },
     attr: {
       clearable:true,
       is: "el-popover-select-v2",
+      referName: "CONTACTS_PARAM",
       valueKey: "name",
-      referName: "PROJECT_PARAM",
     },
   },
   {
@@ -1230,51 +1250,80 @@ export const SearchColumns = [
       valueKey: "code",
     },
   },
-  {
-    item:{
-      key: "billTypes",
-      title: "订单类型",
-    },
-    attr:{
-      is: "el-select",
-      multiple:true,
-      tags:true,
-      clearable:true,
-      dictName: "sys_order_type",
-    },
-  },
-  { 
-    item:{
-      key: "demandCode",
-      title: "采购需求单号", 
-    },
-    attr: {
-      clearable:true,
-      is: "el-input",
-      placeholder:'请输入采购需求单号,多个使用,隔开',
-    },
-  },
   { 
     item:{
-      key: "isDrug",
-      title: "物料药品属性", 
+      key: "deliveryStatus",
+      title: "erp发送状态", 
     },
-    attr: {
+    attr:{
       clearable:true,
       is: "el-select",
-      dictName: "sys_yes_no",
-    },
-  },
-  { 
-    item:{
-      key: "erpOrderCode",
-      title: "erp订单号", 
-    },
-    attr: {
-      clearable:true,
-      is: "el-input",
+      dictName: "order_delivery_status",
     },
   },
+  
+  // {
+  //   item:{
+  //     key: "materialName",
+  //     title: "物料名称",
+  //   },
+  //   attr: {
+  //     clearable:true,
+  //     is: "el-popover-select-v2",
+  //     valueKey: "name",
+  //     referName: "MATERIAL_PARAM",
+  //   },
+  // },
+  
+  // { 
+  //   item:{
+  //     key: "contractNo",
+  //     title: "合同号", 
+  //   },
+  //   attr: {
+  //     clearable:true,
+  //     is: "el-input",
+  //   },
+  // },
+  // {
+  //   item:{
+  //     key: "projectNowName",
+  //     title: "在建工程项目",
+  //   },
+  //   attr: {
+  //     clearable:true,
+  //     is: "el-popover-select-v2",
+  //     valueKey: "name",
+  //     referName: "PROJECT_PARAM",
+  //   },
+  // },
+ 
+  // {
+  //   item:{
+  //     key: "billTypes",
+  //     title: "订单类型",
+  //   },
+  //   attr:{
+  //     is: "el-select",
+  //     multiple:true,
+  //     tags:true,
+  //     clearable:true,
+  //     dictName: "sys_order_type",
+  //   },
+  // },
+ 
+  // { 
+  //   item:{
+  //     key: "isDrug",
+  //     title: "物料药品属性", 
+  //   },
+  //   attr: {
+  //     clearable:true,
+  //     is: "el-select",
+  //     dictName: "sys_yes_no",
+  //   },
+  // },
+ 
 ].map(({ item, attr }) => ({
   attr,
   item: { ...item, hidden: true, span: item.span || 6 },

+ 47 - 0
src/views/purchase/purchase-order/edit/index.vue

@@ -8,6 +8,7 @@ export default {
   dicts: initDicts(SelectColumns),
   components: {
     FileUploadCenter: () => import('../components/FileUploadCenter/index.vue'),
+    BatchImport: () => import("@/components/BatchImport/index.vue"),
   },
   data() {
     return {
@@ -478,6 +479,45 @@ export default {
 
       return Infinity;
     },
+
+    async handelImport(fileList){
+
+      try {
+
+        let formData = new FormData();
+
+        formData.append('file',fileList[0].raw);
+
+        this.$modal.loading("正在上传文件,请稍候...");
+
+        let {code,data} = await orderApi.orderImport(formData);
+
+        if(code == 200) {
+          // puOrderExecuteList puOrderItemList
+
+          for (const key in data) {
+            this.params[key].push(...data[key]);
+          }
+
+          let {setVisible} =  this.$refs.batchImport;
+
+          setVisible(false);
+
+          this.handleGetPrice();
+        }
+        
+      } catch (error) {
+        
+      }finally{
+        this.$modal.closeLoading();
+      }
+
+      },
+
+    async handleTemDownload(){
+
+      this.download('/pu/order/downloadFailData',{}, `物料信息模板${new Date().getTime()}.xlsx`);
+    },
   },
   created() {},
   mounted() { },
@@ -624,6 +664,7 @@ export default {
           </el-col>
         </el-row>
       </el-card>
+
       <el-card :body-style="{
         padding: '20px',
         display: 'flex',
@@ -758,6 +799,12 @@ export default {
         <el-row style="position: absolute; top: 20px; right: 20px">
           <el-button v-if="params.source == '3' && !handleIsRevise()" :size="size"
             @click="addTableRow(params[tabName])">增行</el-button>
+          <BatchImport
+            v-if="params.source == '3' && !handleIsRevise()"
+            ref="batchImport"
+            @import="handelImport"
+            @temDownload="handleTemDownload"
+          ></BatchImport>
         </el-row>
       </el-card>
     </el-form>

+ 4 - 4
src/views/purchase/task/xie-yi-zhi-cai/column.js

@@ -29,10 +29,10 @@ export const TableColumns = [
     },
   },
   
-  // {
-  //   item: { key: "customerName", title: "客户" },
-  //   attr: {},
-  // },
+  {
+    item: { key: "customerName", title: "客户" },
+    attr: {},
+  },
   {
     item: { key: "priceType", title: "价格类型" ,width:145},
     attr: { is: "el-dict-tag", dictName: "sys_price_type" },

+ 1 - 1
src/views/purchase/transferOrder/index.vue

@@ -97,6 +97,7 @@
           <el-table-column show-overflow-tooltip label="单据状态" align="center" prop="status" width="100px" :formatter="formatterStatus"/>
           <el-table-column show-overflow-tooltip label="调出库存组织" align="center" prop="deliveryInventoryOrgName" width="200px"/>
           <el-table-column show-overflow-tooltip label="订单类型" align="center" prop="billType" width="220px" :formatter="formatterBillType"/>
+          <el-table-column show-overflow-tooltip label="制单人" align="center" prop="createByName" width="100px"/>
           <el-table-column show-overflow-tooltip label="单据日期" align="center" prop="billDate" width="100px"/>
           <el-table-column show-overflow-tooltip label="调拨方式" align="center" prop="allotType" width="180px">
             <template slot-scope="scope">
@@ -120,7 +121,6 @@
           <el-table-column show-overflow-tooltip label="利润中心" align="center" prop="liacenterName" width="150px"/>
           <!-- <el-table-column show-overflow-tooltip label="已同步WMS" align="center" prop="isSendWms" width="150px"/> -->
           <el-table-column show-overflow-tooltip label="备注" align="center" prop="remark" width="150px"/>
-          <el-table-column show-overflow-tooltip label="制单人" align="center" prop="createByName" width="100px"/>
           <el-table-column show-overflow-tooltip label="制单日期" align="center" prop="createTime" width="150px"/>
           <!-- <el-table-column show-overflow-tooltip label="审批人" align="center" prop="code" width="150px"/> -->
           <!-- <el-table-column show-overflow-tooltip label="审批日期" align="center" prop="code" width="150px"/> -->