Quellcode durchsuchen

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

002201 vor 1 Jahr
Ursprung
Commit
38e86a554d

+ 25 - 14
src/api/material/basic.js

@@ -42,7 +42,7 @@ const medcineDetails = (id) => {
   })
 }
 
-// 根据物料id获取医药行业信息详细信息  
+// 根据物料id获取医药行业信息详细信息
 const medcineDetailsInfo = (id) => {
   return request({
     url: `/system/medcine/detailsInfo/${id}`,
@@ -69,7 +69,7 @@ const costList = (data) => {
   })
 }
 
-// 成本信息详情 
+// 成本信息详情
 const costDetails = (id) => {
   return request({
     url: `/system/cost/details/${id}`,
@@ -144,7 +144,7 @@ const planList = (data) => {
   })
 }
 
-// 查询计划信息详情 
+// 查询计划信息详情
 const planDetails = (id) => {
   return request({
     url: `/system/plan/details/${id}`,
@@ -153,7 +153,7 @@ const planDetails = (id) => {
   })
 }
 
-// 获取利润中心信息列表 
+// 获取利润中心信息列表
 const centerList = (data) => {
   return request({
     url: `/system/center/list`,
@@ -162,7 +162,7 @@ const centerList = (data) => {
   })
 }
 
-// 获取利润中心详细信息 
+// 获取利润中心详细信息
 const centerDetails = (id) => {
   return request({
     url: `/system/center/details/${id}`,
@@ -171,7 +171,7 @@ const centerDetails = (id) => {
   })
 }
 
-// 获取采购信息列表  
+// 获取采购信息列表
 const purchaseList = (data) => {
   return request({
     url: `/system/purchase/list`,
@@ -180,7 +180,7 @@ const purchaseList = (data) => {
   })
 }
 
-// 获取采购详细信息 
+// 获取采购详细信息
 const purchaseDetails = (id) => {
   return request({
     url: `/system/purchase/details/${id}`,
@@ -189,7 +189,7 @@ const purchaseDetails = (id) => {
   })
 }
 
-// 获取库存信息列表  
+// 获取库存信息列表
 const inventoryList = (data) => {
   return request({
     url: `/system/inventory/list`,
@@ -198,7 +198,7 @@ const inventoryList = (data) => {
   })
 }
 
-// 获取库存详细信息 
+// 获取库存详细信息
 const inventoryDetails = (id) => {
   return request({
     url: `/system/inventory/details/${id}`,
@@ -232,7 +232,7 @@ const materialEdit = (data) => {
   })
 }
 
-// 修改医药行业信息 /dev-api/drp-admin/system/medcine/edit   
+// 修改医药行业信息 /dev-api/drp-admin/system/medcine/edit
 const medcineEdit = (data) => {
   return request({
     url: `/system/medcine/edit `,
@@ -278,7 +278,7 @@ const medcineitemBatchSave = (data) => {
   })
 }
 
-// 修改财务信息 /dev-api/drp-admin/system/finance/edit 
+// 修改财务信息 /dev-api/drp-admin/system/finance/edit
 const financeEdit = (data) => {
   return request({
     url: `/system/finance/edit `,
@@ -432,7 +432,15 @@ const saveVersions = (data) => {
     data,
   })
 }
-
+// 物料导出
+export function exportMartial(data) {
+  return request({
+    url: `/system/material/downloadFailData`,
+    method: 'post',
+    data: data,
+    responseType: 'blob'
+  })
+}
 export default {
   // 查询
   materialList,
@@ -485,5 +493,8 @@ export default {
   delPurchase,
   // 维护新版本
   versions,
-  saveVersions
-}
+  saveVersions,
+
+  //导出
+  exportMartial
+}

+ 1 - 1
src/api/purchase/basic.js

@@ -41,7 +41,7 @@ export function delDivision(ids) {
 // 参照统一接口
 export function getRefer(data) {
   return request({
-    url: `/refer/query?pageSize=${data.pageSize}&pageNum=${data.pageNo}`,
+    url: `/refer/query?pageSize=1000&pageNum=1`,
     method: 'post',
     data: data
   })

+ 8 - 0
src/components/Refers/refers.vue

@@ -35,6 +35,7 @@
               <el-table-column show-overflow-tooltip v-if="remark" prop="remark" header-align="center" align="center" min-width="90" label="备注"/>
               <el-table-column show-overflow-tooltip v-if="shortName" prop="shortName" header-align="center" align="center" min-width="90" label="简称"/>
               <el-table-column show-overflow-tooltip v-if="mneCode" prop="mneCode" header-align="center" align="center" min-width="90" label="助记码"/>
+              <el-table-column show-overflow-tooltip v-if="deptName" prop="deptName" header-align="center" align="center" min-width="90" label="部门"/>
             </el-table>
             <el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
               :current-page="searchForm.pageNo" :page-sizes="[5, 10, 15, 20]" :page-size="searchForm.pageSize"
@@ -67,6 +68,7 @@ export default {
       dataList: [],
       total: 0,
       orgName: false,
+      deptName: false,
       warehouseAttributes: false,
       warehouseCode: false,
       warehouseName: false,
@@ -137,6 +139,12 @@ export default {
           this.orgName = false
           this.warehouseAttributes = false
         }
+        // 人员内加部门
+        if(res.rows.length !== 0 && res.rows[0].deptId) {
+          this.deptName = true
+        } else {
+          this.deptName = false
+        }
         // 选择货位里面加仓库
         if(res.rows.length !== 0 && res.rows[0].warehouseCode) {
           this.warehouseCode = true

+ 409 - 386
src/views/material/basicFile/index.vue

@@ -1,6 +1,7 @@
 <!-- 物料信息基础档案 -->
+<script src="../../../main.js"></script>
 <template>
-  <div class="material-basic">
+  <div class="material-basic" v-loading="failLoad">
 
     <!-- 操作栏 -->
     <div>
@@ -39,7 +40,7 @@
         <el-col :span="1.5">
           <el-button-group>
             <el-button size="small" @click="handleIsInvoke" :disabled="checkedList.length != 1"
-              v-hasPermi="['system:material:add']">
+                       v-hasPermi="['system:material:add']">
               <!-- 0:启用  2:停用 -->
               {{ handleJudgeIsUsing() ? '停用' : '启用' }}
             </el-button>
@@ -95,26 +96,26 @@
     <!-- 主体列表 -->
     <el-card class="material-list" v-loading="loading">
       <el-table :data="taskList" ref="materialTable" @cell-dblclick="handledbClick" :row-key="getRowKey"
-        @selection-change="handleSelectionChange" @select="handleSelect" @select-all="handleSelectAll">
+                @selection-change="handleSelectionChange" @select="handleSelect" @select-all="handleSelectAll">
         <!--  -->
-        <el-table-column type="selection" width="30" :reserve-selection="true" />
-        <el-table-column type="index" label="序号" width="55" align="center" />
+        <el-table-column type="selection" width="30" :reserve-selection="true"/>
+        <el-table-column type="index" label="序号" width="55" align="center"/>
         <el-table-column width="150" v-for="h in  tableHeader" v-if="h.show" :label="h.name" align="center"
-          show-overflow-tooltip>
+                         show-overflow-tooltip>
           <!-- :prop="h.attribute == 'select' ? `${h.prop}Name` : h.prop" -->
           <template slot-scope="scope">
             {{ h.attribute == 'select' ? scope.row[`${h.prop}Name`] :
-              (h.attribute == 'checkbox' ?
-                (scope.row[h.prop] == '0' ? '√' : '')
-                : scope.row[h.prop])
+            (h.attribute == 'checkbox' ?
+            (scope.row[h.prop] == '0' ? '√' : '')
+            : scope.row[h.prop])
             }}
           </template>
         </el-table-column>
       </el-table>
 
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-        :current-page="queryParams.pageNum" :page-sizes="[10, 20, 50, 100]"
-        layout="total, sizes, prev, pager, next, jumper" :total="total">
+                     :current-page="queryParams.pageNum" :page-sizes="[10, 20, 50, 100]"
+                     layout="total, sizes, prev, pager, next, jumper" :total="total">
       </el-pagination>
     </el-card>
 
@@ -131,7 +132,7 @@
     <el-dialog title="批量导入" :visible.sync="importData.show" width="35%" center :before-close="handlefileDialogColse">
       <div class="mb-import">
         <el-upload class="upload-demo" accept=".xls, .xlsx" ref="upload" action="#" :on-remove="handleFileRemove"
-          :file-list="importData.list" :auto-upload="false" :on-change="handleChangeFile" :limit="1">
+                   :file-list="importData.list" :auto-upload="false" :on-change="handleChangeFile" :limit="1">
           <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
           <el-button style="margin-left: 10px;" size="small" type="success" @click="handleDownTemplate">下载模板</el-button>
           <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
@@ -148,94 +149,150 @@
 </template>
 
 <script>
-import './style/index.scss';
-import materialApi from '@/api/material/basic';
-
-export default {
-  name: "material-basic",
-  data() {
-    return {
-      // 物料基本信息数据
-      taskList: [],
-      // 查询表单字段
-      queryForm: {
-        name: '',
-        code: '',
-        isEnable: '',
-      },
-      // 总条数
-      total: 1,
-      loading: false,
-      importData: {
-        show: false,
-        list: []
-      },
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        code: null,
-        name: null
-      },
-      // 表头
-      tableHeader: [],
-      // 多选数组
-      checkedList: [],
-      // 列表选中数据
-      // checkedList: [],
-      // 操作弹窗
-      optionDialog: {
-        show: false,
-        op: ''
-      },
-    }
-  },
+  import './style/index.scss';
+  import materialApi from '@/api/material/basic';
 
-  methods: {
-    // 判读是否启用
-    handleJudgeIsUsing() {
-      return this.checkedList.length == 1 && this.checkedList[0].isEnable == '已启用';
-    },
-    // 改变分页大小
-    handleSizeChange(e) {
-      this.queryParams.pageSize = e;
-      this.handleQuery();
-    },
-    // 改变当前页
-    handleCurrentChange(e) {
-      this.queryParams.pageNum = e;
-      this.handleQuery();
-    },
-    // 新增
-    handleInster() {
-      this.$message({
-        message: '物料只能通过申请审批增加,不能在节点直接录入!',
-        type: 'warning'
-      });
+  export default {
+    name: "material-basic",
+    data() {
+      return {
+        failLoad: false,
+        // 物料基本信息数据
+        taskList: [],
+        // 查询表单字段
+        queryForm: {
+          name: '',
+          code: '',
+          isEnable: '',
+        },
+        // 总条数
+        total: 1,
+        loading: false,
+        importData: {
+          show: false,
+          list: []
+        },
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          code: null,
+          name: null
+        },
+        // 表头
+        tableHeader: [],
+        // 多选数组
+        checkedList: [],
+        // 列表选中数据
+        // checkedList: [],
+        // 操作弹窗
+        optionDialog: {
+          show: false,
+          op: ''
+        },
+      }
     },
-    // 修改
-    handleEdit() {
-      if (this.checkedList.length == 1) {
-        this.$router.push({
-          path: `/material/basicFile/detail/${this.checkedList[0].id}`,
-          query: {
-            isEdit: true
-          }
-        });
-      } else {
+
+    methods: {
+      // 判读是否启用
+      handleJudgeIsUsing() {
+        return this.checkedList.length == 1 && this.checkedList[0].isEnable == '已启用';
+      },
+      // 改变分页大小
+      handleSizeChange(e) {
+        this.queryParams.pageSize = e;
+        this.handleQuery();
+      },
+      // 改变当前页
+      handleCurrentChange(e) {
+        this.queryParams.pageNum = e;
+        this.handleQuery();
+      },
+      // 新增
+      handleInster() {
         this.$message({
-          message: `${this.checkedList.length > 1 ? '修改只能选择单个数据!' : '请选择需要修改的信息!'}`,
+          message: '物料只能通过申请审批增加,不能在节点直接录入!',
           type: 'warning'
         });
-      }
-    },
-    // 删除
-    handleDel() {
-      console.log('删除', this.checkedList);
-      // delMaterial
-      if (this.checkedList.length) {
-        let ids = this.checkedList.map(i => i.id);
-        materialApi.delMaterial(ids).then(res => {
+      },
+      // 修改
+      handleEdit() {
+        if (this.checkedList.length == 1) {
+          this.$router.push({
+            path: `/material/basicFile/detail/${this.checkedList[0].id}`,
+            query: {
+              isEdit: true
+            }
+          });
+        } else {
+          this.$message({
+            message: `${this.checkedList.length > 1 ? '修改只能选择单个数据!' : '请选择需要修改的信息!'}`,
+            type: 'warning'
+          });
+        }
+      },
+      // 删除
+      handleDel() {
+        console.log('删除', this.checkedList);
+        // delMaterial
+        if (this.checkedList.length) {
+          let ids = this.checkedList.map(i => i.id);
+          materialApi.delMaterial(ids).then(res => {
+            if (res.code == 200) {
+              this.handleRefresh();
+              // 清空选中数据
+              this.checkedList = [];
+              this.$refs.materialTable.clearSelection();
+            }
+          })
+        } else {
+          this.$message({
+            message: '请选择需要删除的数据!',
+            type: 'warning'
+          });
+        }
+
+      },
+      // 复制
+      handleCopy() {
+        console.log('复制');
+      },
+      //查询
+      handleQuery() {
+        this.getMaterialList('material');
+      },
+      // 重置查询条件
+      handleResetQuery() {
+        for (const key in this.queryForm) {
+
+          this.queryForm[key] = '';
+        }
+      },
+      // 刷新
+      handleRefresh() {
+        this.getMaterialList('material');
+        for (const key in this.queryForm) {
+          this.queryForm[key] = '';
+        }
+      },
+      // 过滤
+      handleFilter(e) {
+        console.log(e, '过滤');
+      },
+      filterCondition(type) {
+        return {
+          type
+        }
+      },
+      // 启用/停用
+      handleIsInvoke() {
+        // true   当前状态为启用,需要改为停用
+        // 0:启用  2:停用
+        let param = {
+          isEnable: this.handleJudgeIsUsing() ? '2' : '0',
+          id: this.checkedList[0].id
+        };
+        materialApi.updateEnableMaterial(param).then(res => {
           if (res.code == 200) {
             this.handleRefresh();
             // 清空选中数据
@@ -243,334 +300,300 @@ export default {
             this.$refs.materialTable.clearSelection();
           }
         })
-      } else {
-        this.$message({
-          message: '请选择需要删除的数据!',
-          type: 'warning'
-        });
-      }
 
-    },
-    // 复制
-    handleCopy() {
-      console.log('复制');
-    },
-    //查询 
-    handleQuery() {
-      this.getMaterialList('material');
-    },
-    // 重置查询条件
-    handleResetQuery() {
-      for (const key in this.queryForm) {
-
-        this.queryForm[key] = '';
-      }
-    },
-    // 刷新
-    handleRefresh() {
-      this.getMaterialList('material');
-      for (const key in this.queryForm) {
-        this.queryForm[key] = '';
-      }
-    },
-    // 过滤
-    handleFilter(e) {
-      console.log(e, '过滤');
-    },
-    filterCondition(type) {
-      return {
-        type
-      }
-    },
-    // 启用/停用
-    handleIsInvoke() {
-      // true   当前状态为启用,需要改为停用
-      // 0:启用  2:停用
-      let param = {
-        isEnable: this.handleJudgeIsUsing() ? '2' : '0',
-        id: this.checkedList[0].id
-      };
-      materialApi.updateEnableMaterial(param).then(res => {
-        if (res.code == 200) {
-          this.handleRefresh();
-          // 清空选中数据
-          this.checkedList = [];
-          this.$refs.materialTable.clearSelection();
-        }
-      })
-
-    },
-    isInvoke(val) {
-      return val;
-    },
-    // 申请单查询
-    handleQueryForm() {
-      console.log('申请单查询');
-    },
-    // 批量导入
-    handleImport() {
-      this.importData.show = true
-    },
-    // 导入弹窗关闭前
-    handlefileDialogColse(done) {
-      this.importData.list = [];
-      done();
-    },
-    // 导入弹窗操作
-    handleImportData(type) {
-      switch (type) {
-        // 取消
-        case 'cancal':
-          this.importData.list = [];
-          this.importData.show = false;
-          break;
-        // 确认
-        case 'confirm':
-          if (this.importData.list.length) {
-
-            let formData = new FormData();
-
-            formData.append('file', this.importData.list[0].raw);
-            materialApi.fileImport(formData).then(res => {
-              if (res.code == 200) {
-                this.importData.show = false;
-                this.importData.list = [];
-              }
+      },
+      isInvoke(val) {
+        return val;
+      },
+      // 申请单查询
+      handleQueryForm() {
+        console.log('申请单查询');
+      },
+      // 批量导入
+      handleImport() {
+        this.importData.show = true
+      },
+      // 导入弹窗关闭前
+      handlefileDialogColse(done) {
+        this.importData.list = [];
+        done();
+      },
+      // 导入弹窗操作
+      handleImportData(type) {
+        switch (type) {
+          // 取消
+          case 'cancal':
+            this.importData.list = [];
+            this.importData.show = false;
+            break;
+          // 确认
+          case 'confirm':
+            if (this.importData.list.length) {
+
+              let formData = new FormData();
+
+              formData.append('file', this.importData.list[0].raw);
+              materialApi.fileImport(formData).then(res => {
+                if (res.code == 200) {
+                  this.importData.show = false;
+                  this.importData.list = [];
+                  if (res.data.flag) {
+                    this.failLoad = true;
+                    console.log(res.data.datas)
+                    let param = {failDatas: res.data.datas}
+                    if (null != param) {
+                      materialApi.exportMartial(param).then(res => {
+                        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 = '导入失败的物料基础档案数据.xlsx'; // 下载后文件名
+                        document.body.appendChild(downloadElement);
+                        downloadElement.click(); // 点击下载
+                        document.body.removeChild(downloadElement); // 下载完成移除元素
+                        window.URL.revokeObjectURL(href); // 释放blob对象
+                        this.failLoad = false;
+                      })
+                    }
+                  }
+                  this.$message({
+                    message: res.data.msg,
+                    type: res.data.flag ? 'warning' : 'success'
+                  });
+                } else {
+                  this.$message({
+                    message: res.msg,
+                    type: res.code == 200 ? 'success' : 'warning'
+                  });
+                }
+              })
+            } else {
               this.$message({
-                message: res.msg,
-                type: res.code == 200 ? 'success' : 'warning'
+                message: '请上传文件之后在确认!',
+                type: 'warning'
               });
-            })
-          } else {
-            this.$message({
-              message: '请上传文件之后在确认!',
-              type: 'warning'
-            });
-          }
-          break;
-      }
-    },
-
-    // 删除文件
-    handleFileRemove(file, fileList) {
-      console.log('删除文件', file, 'file', fileList, 'fileList');
-      this.importData.list = fileList;
-    },
-    // 文件发生改变
-    handleChangeFile(file, fileList) {
-      this.importData.list = fileList;
-    },
-    // 批量导出
-    handleExport() {
-
-      let ids = this.checkedList.length ? this.checkedList.map(i => i.id) : [];
-
-      if (ids.length) {
-
-        let params = {
-          // orgId: '1',
-          ids,
+            }
+            break;
         }
-        this.download('/system/material/export', params, `物料基本信息${new Date().getTime()}.xlsx`);
-      } else {
-        this.$message({
-          message: '请选择需要导出的数据!',
-          type: 'warning'
-        });
-      }
-
-    },
-    // 下载模板
-    handleDownTemplate() {
-      this.download('/system/material/download', {}, `物料基本信息模板.xlsx`)
-    },
-
+      },
 
-    // 操作弹窗显隐
-    handleOptionShow(type, val) {
-      switch (type) {
-        case 'option':
-          this.optionDialog.show = val;
-          break;
-      }
-    },
-    // 操作弹窗确认按钮
-    handleComfirmOption(op) {
-      switch (op) {
-        case 'cancal':
-          this.handleOptionShow('option', false);
-          break;
-      }
-    },
+      // 删除文件
+      handleFileRemove(file, fileList) {
+        console.log('删除文件', file, 'file', fileList, 'fileList');
+        this.importData.list = fileList;
+      },
+      // 文件发生改变
+      handleChangeFile(file, fileList) {
+        this.importData.list = fileList;
+      },
+      // 批量导出
+      handleExport() {
 
+        let ids = this.checkedList.length ? this.checkedList.map(i => i.id) : [];
 
+        if (ids.length) {
 
-    // 双击行
-    handledbClick(e) {
-      this.$router.push({
-        path: `/material/basicFile/detail/${e.id}`,
-      });
-    },
-    // 绑定row-key
-    getRowKey(row) {
-      return row.id;
-    },
-    // 对象数组去重
-    handleUnique(arr, key) {
-      // arr  需要去重的数组   type:作为去重依据的key
-      const res = new Map();
-      return arr.filter((arr) => !res.has(arr[key]) && res.set(arr[key], 1))
-    },
-    // 选中数据改变
-    handleSelectionChange(list) {
-      // this.checkedList = this.handleUnique([...this.checkedList, ...list], 'id');
-      // this.$emit('headerOption', JSON.stringify({ checkedList: [... this.checkedList] }))
-    },
-    // 行数据勾选操作 
-    handleSelect(selection, row) {
-      this.checkedList = selection;
-      // // true就是选中,0或者false是取消选中
-      // let selected = selection.length && selection.indexOf(row) !== -1
+          let params = {
+            // orgId: '1',
+            ids,
+          }
+          this.download('/system/material/export', params, `物料基本信息${new Date().getTime()}.xlsx`);
+        } else {
+          this.$message({
+            message: '请选择需要导出的数据!',
+            type: 'warning'
+          });
+        }
 
-    },
-    //手动勾选全选 
-    handleSelectAll(selection) {
-      this.checkedList = selection;
-    },
-    // 获取物料列表信息
-    getMaterialList(templateCode, query) {
-      let _this = this;
-      this.loading = true;
-      let page = {
-        pageNum: this.queryParams.pageNum,
-        pageSize: this.queryParams.pageSize,
-      }
+      },
+      // 下载模板
+      handleDownTemplate() {
+        this.download('/system/material/download', {}, `物料基本信息模板.xlsx`)
+      },
 
-      let param = {
-        templateCode,
-        ...this.queryForm
-      }
-      // console.log(param, 'param');
-      materialApi.materialList(param, page).then((res) => {
-        _this.loading = false;
-        console.log(res, '获取物料列表信息以及表头字段');
-        let { code, data } = res;
-        if (code == 200) {
-          _this.taskList = data.tableBody.rows;
-          _this.total = data.tableBody.total;
 
+      // 操作弹窗显隐
+      handleOptionShow(type, val) {
+        switch (type) {
+          case 'option':
+            this.optionDialog.show = val;
+            break;
         }
-      })
-    },
-    // 获取物料列表表头
-    getTagList(templateCode) {
-      materialApi.tagList({ templateCode }).then(res => {
-        console.log(res, '获取物料列表表头');
-        if (res.code == 200) {
-          this.tableHeader = res.data;
+      },
+      // 操作弹窗确认按钮
+      handleComfirmOption(op) {
+        switch (op) {
+          case 'cancal':
+            this.handleOptionShow('option', false);
+            break;
         }
-      })
-    },
+      },
 
 
+      // 双击行
+      handledbClick(e) {
+        this.$router.push({
+          path: `/material/basicFile/detail/${e.id}`,
+        });
+      },
+      // 绑定row-key
+      getRowKey(row) {
+        return row.id;
+      },
+      // 对象数组去重
+      handleUnique(arr, key) {
+        // arr  需要去重的数组   type:作为去重依据的key
+        const res = new Map();
+        return arr.filter((arr) => !res.has(arr[key]) && res.set(arr[key], 1))
+      },
+      // 选中数据改变
+      handleSelectionChange(list) {
+        // this.checkedList = this.handleUnique([...this.checkedList, ...list], 'id');
+        // this.$emit('headerOption', JSON.stringify({ checkedList: [... this.checkedList] }))
+      },
+      // 行数据勾选操作
+      handleSelect(selection, row) {
+        this.checkedList = selection;
+        // // true就是选中,0或者false是取消选中
+        // let selected = selection.length && selection.indexOf(row) !== -1
 
+      },
+      //手动勾选全选
+      handleSelectAll(selection) {
+        this.checkedList = selection;
+      },
+      // 获取物料列表信息
+      getMaterialList(templateCode, query) {
+        let _this = this;
+        this.loading = true;
+        let page = {
+          pageNum: this.queryParams.pageNum,
+          pageSize: this.queryParams.pageSize,
+        }
 
+        let param = {
+          templateCode,
+          ...this.queryForm
+        }
+        // console.log(param, 'param');
+        materialApi.materialList(param, page).then((res) => {
+          _this.loading = false;
+          console.log(res, '获取物料列表信息以及表头字段');
+          let {code, data} = res;
+          if (code == 200) {
+            _this.taskList = data.tableBody.rows;
+            _this.total = data.tableBody.total;
 
+          }
+        })
+      },
+      // 获取物料列表表头
+      getTagList(templateCode) {
+        materialApi.tagList({templateCode}).then(res => {
+          console.log(res, '获取物料列表表头');
+          if (res.code == 200) {
+            this.tableHeader = res.data;
+          }
+        })
+      },
 
-  },
-  created() {
-    // this.getMaterialList('material');
-    // this.getTagList('material');
-  },
-  beforeRouteEnter(to, from, next) {
 
-    next((vm) => {
-      if (from.name == 'materialDetail') {
-        // this.$store.getQuery(this.queryForm);
-        console.log(vm, 'queryValue', vm.$store);
-        vm.queryForm = vm.$store.state.query.queryVlue;
-        // 清空选中数据
-        vm.checkedList = [];
-        vm.$refs.materialTable.clearSelection();
+    },
+    created() {
+      // this.getMaterialList('material');
+      // this.getTagList('material');
+    },
+    beforeRouteEnter(to, from, next) {
+
+      next((vm) => {
+        if (from.name == 'materialDetail') {
+          // this.$store.getQuery(this.queryForm);
+          console.log(vm, 'queryValue', vm.$store);
+          vm.queryForm = vm.$store.state.query.queryVlue;
+          // 清空选中数据
+          vm.checkedList = [];
+          vm.$refs.materialTable.clearSelection();
+        }
+        vm.getTagList('material');
+        vm.getMaterialList('material');
+      });
+    },
+    // 进入详情,保留查询条件
+    beforeRouteLeave(to, from, next) {
+      if (to.name == 'materialDetail') {
+        this.$store.commit('SET_QUERY', this.queryForm);
+      } else {
+        this.$store.commit('SET_QUERY', {name: '', code: ''});
       }
-      vm.getTagList('material');
-      vm.getMaterialList('material');
-    });
-  },
-  // 进入详情,保留查询条件
-  beforeRouteLeave(to, from, next) {
-    if (to.name == 'materialDetail') {
-      this.$store.commit('SET_QUERY', this.queryForm);
-    } else {
-      this.$store.commit('SET_QUERY', { name: '', code: '' });
+      next();
     }
-    next();
-  }
 
-};
+  };
 </script>
 
 
 <style lang="scss">
-.material-list {
-  // height: calc(100% - 100px);
-  height: calc(100% - 70px);
-
-
-  .el-card__body {
-    height: 100%;
-    box-sizing: border-box;
-
-    .el-table {
-      height: calc(100% - 35px);
-      overflow: auto;
-
-      .el-table__body-wrapper {
-        // height: calc(100% - 150px);
-        height: calc(100% - 70px);
-        overflow-y: auto !important;
-        overflow-x: auto !important;
-        // .el-table__body {
-        //   height: 100%;
-        // }
+  .material-list {
+    // height: calc(100% - 100px);
+    height: calc(100% - 70px);
+
+
+    .el-card__body {
+      height: 100%;
+      box-sizing: border-box;
+
+      .el-table {
+        height: calc(100% - 35px);
+        overflow: auto;
+
+        .el-table__body-wrapper {
+          // height: calc(100% - 150px);
+          height: calc(100% - 70px);
+          overflow-y: auto !important;
+          overflow-x: auto !important;
+          // .el-table__body {
+          //   height: 100%;
+          // }
+        }
       }
     }
+
+    .el-pagination {
+      margin-top: 8px;
+      text-align: right;
+    }
   }
 
-  .el-pagination {
-    margin-top: 8px;
-    text-align: right;
+  .mb-import {
+    padding: 0 20%;
+    text-align: center;
+    display: flex;
+    align-items: flex-start;
+    justify-content: space-around;
   }
-}
-
-.mb-import {
-  padding: 0 20%;
-  text-align: center;
-  display: flex;
-  align-items: flex-start;
-  justify-content: space-around;
-}
 </style>
 <style scoped>
-.el-dialog__header {
-  background-color: rgb(244, 244, 244);
-}
+  .el-dialog__header {
+    background-color: rgb(244, 244, 244);
+  }
 
-.mb-query>>>.el-form-item__label {
-  font-weight: normal;
-  font-size: 12px;
-}
+  .mb-query >>> .el-form-item__label {
+    font-weight: normal;
+    font-size: 12px;
+  }
 
-.mb-query>>>.el-form-item {
-  margin-bottom: 8px;
-}
+  .mb-query >>> .el-form-item {
+    margin-bottom: 8px;
+  }
 
-.mb-query>>>.el-select {
-  width: 90px;
-}
+  .mb-query >>> .el-select {
+    width: 90px;
+  }
 
-.mb-query>>>.el-scrollbar__wrap {
-  margin-bottom: -18px;
+  .mb-query >>> .el-scrollbar__wrap {
+    margin-bottom: -18px;
 
-}
+  }
 </style>

+ 16 - 49
src/views/purchase/DemandSummary/index.vue

@@ -33,6 +33,16 @@
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
+              <el-form-item label="生产厂家">
+                <el-input
+                v-model.trim="queryParams.manufacturer"
+                size="mini"
+                clearable
+                style="width: 200px"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
               <el-form-item label="" label-width="20px">
                 <el-button type="primary" size="mini" icon="el-icon-search" plain @click="search">搜索</el-button>
                 <el-button size="mini" icon="el-icon-refresh" plain @click="reset">重置</el-button>
@@ -44,16 +54,6 @@
           <div v-show="expanded">
             <el-row :gutter="10">
               <el-col :span="1.5">
-                <el-form-item label="生产厂家">
-                  <el-input
-                  v-model.trim="queryParams.manufacturer"
-                  size="mini"
-                  clearable
-                  style="width: 200px"
-                  />
-                </el-form-item>
-              </el-col>
-              <el-col :span="1.5">
                 <el-form-item label="预测分类">
                   <el-select v-model="queryParams.forecastClassification" size="mini" style="width: 200px" clearable>
                     <el-option
@@ -69,39 +69,6 @@
                   </el-select>
                 </el-form-item>
               </el-col>
-              <!-- <el-col :span="1.5">
-                <el-form-item label="周期单位">
-                  <el-select v-model="queryParams.periodUnit" size="mini" style="width: 200px" clearable>
-                    <el-option
-                      v-for="dict in dict.type.sys_period_unit" :key="dict.value" :label="dict.label" :value="dict.value">
-                    </el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col> -->
-            </el-row>
-
-            <el-row :gutter="10">
-              <!-- <el-col :span="1.5">
-                <el-form-item label="转请购单号">
-                  <el-input
-                  v-model="queryParams.zqgdh"
-                  size="mini"
-                  placeholder=""
-                  clearable
-                  style="width: 200px"
-                  />
-                </el-form-item>
-              </el-col> -->
-              <!-- <el-col :span="1.5">
-                <el-form-item label="业务部门">
-                  <el-select clearable size="mini" v-model="queryParams.departmentName" @focus="chooseRefer('DEPT_PARAM', true, '业务部门')" style="width: 200px">
-                    <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id" />
-                  </el-select>
-                </el-form-item>
-              </el-col> -->
-            </el-row>
-
-            <el-row :gutter="10">
               <el-col :span="1.5">
                 <el-form-item label="注册人">
                   <el-input
@@ -121,6 +88,9 @@
                   </el-select>
                 </el-form-item>
               </el-col>
+            </el-row>
+
+            <el-row :gutter="10">
               <el-col :span="1.5">
                 <el-form-item label="单据来源">
                   <el-select v-model="queryParams.billSource" size="mini" style="width: 200px" clearable>
@@ -130,9 +100,6 @@
                   </el-select>
                 </el-form-item>
               </el-col>
-            </el-row>
-
-            <el-row :gutter="10">
               <el-col :span="1.5">
                 <el-form-item label="需求客户">
                   <el-select clearable size="mini" v-model="queryParams.customer" @focus="chooseRefer('CUSTOMER_PARAM', true, '需求客户')" style="width: 200px">
@@ -196,9 +163,6 @@
                   </el-date-picker>
                 </el-form-item>
               </el-col>
-            </el-row>
-
-            <el-row :gutter="10">
               <el-col :span="1.5">
                 <el-form-item label="采购需求单号">
                   <el-input
@@ -209,6 +173,9 @@
                   />
                 </el-form-item>
               </el-col>
+            </el-row>
+
+            <el-row :gutter="10">
               <el-col :span="1.5">
                 <el-form-item label="审批结束日期">
                   <el-date-picker

+ 144 - 144
src/views/purchase/PurchaseDemandList/add.vue

@@ -1197,152 +1197,152 @@ export default {
       console.log('复制的数组',rows);
       console.log('列表的数组',this.basicForm.puDemandItemList)
       let linArr = []
-      for (let i = 0; i<rows.length; i++) {
-        console.log('items',rows[i])
-        await getRefer({ type: 'MATERIAL_PARAM', code: rows[i] }).then(res => {
-          if (res.code === 200) {
-            let line = {
-              contacts: null,
-              id: null,
-              demandId: null,
-              status: null,
-              businessDept: null,
-              businessDeptName: null,
-              materialCategory: null,
-              buyer: null,
-              buyerName: null,
-              mateiralClassifyOne: null,
-              materialClassifyOneName: null,
-              materialClassifyTwo: null,
-              materialClassifyTwoName: null,
-              materialClassifyThree: null,
-              materialClassifyThreeName: null,
-              materialClassifyFour: null,
-              materialClassifyFourName: null,
-              materialCode: null,
-              material: null,
-              materialName: null,
-              classifyId: null,
-              specification: null,
-              unit: null,
-              unitName: null,
-              manufacturerName: null,
-              registrant: null,
-              puPeriod: null,
-              expiryUnit: null,
-              expiry: null,
-              minPackage: null,
-              minOrderQty: null,
-              minBatch: null,
-              safeStock: null,
-              averageQtyMonth: null,
-              qty: null,
-              adjustmentPersonal: null,
-              adjustmentTime: null,
-              manualRegulation: null,
-              updateCause: null,
-              reservedProportion: null,
-              reservedPeriod: null,
-              reservedQty: null,
-              demandPeriod: null,
-              forecastClassify: null,
-              onemonthAvgVolume: null,
-              threemonthAvgVolume: null,
-              deliveryDate: null,
-              isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
-              isReplenishment: this.basicForm.billType == 'BDXQ' ? 'Y' : 'N',
-              isBatchLock: 'N',
-              remark: null,
-              puRemark: null,
-              lastWarehouseQty: null,
-              resDemandQty: null,
-              lastWarehouse: null,
-              lastWarehouseName: null,
-              deliveryWarehouse: null,
-              deliveryWarehouseName: null,
-              lastAllocation: null,
-              lastAllocationName: null,
-              deliveryAllocation: null,
-              deliveryAllocationName: null,
-              passageOn: null,
-              puOrg: null,
-              purOrgName: null,
-              lastStockQty: null,
-              superiorCenterQty: null,
-              superiorAllotQty: null,
-              availableQty: null,
-              statusAllot: 'N',
-              additionalSupplier: null,
-              additionalSupplierName: null,
-              periodUnit: null,
-              demandCustomer: this.basicForm.customer,
-              demandCustomerName: this.basicForm.customerName,
-              businessDept: this.basicForm.demandDept,
-              businessDeptName: null,
-              lastStockOrg: null,
-              lastStockOrgName: null,
-              superiorStockOrg: null,
-              superiorStockOrgName: null,
-              allotCode: null,
-              deliveryAddress: null,
-              deliveryAddressName: null,
-              contacts: null,
-              contactsPhone: null,
-              address: null,
-              source: null,
-              priceType: 'order',
-              puManagerApprover: null,
-              puManagerApproverName: null,
-              processTime: null,
-              affirmer: null,
-              tenantId: null,
-              revision: null,
-              createBy: null,
-              createByName: null,
-              createTime: null,
-              updateBy: null,
-              updateByName: null,
-              updateTime: null,
-              delFlag: 0,
-              // 新增字段
-              model: null,
-              storageCondition: null,
-              transportationCondition: null,
-            }
-            line.businessDept = res.rows[0].businessDepartment
-            line.businessDeptName = res.rows[0].businessDepartmentName
-            line.materialCode = res.rows[0].code
-            line.material = res.rows[0].id
-            line.materialName = res.rows[0].name
-            line.classifyId = res.rows[0].classifyId
-            line.materialClassifyOneName = res.rows[0].oneClass
-            line.materialClassifyTwoName = res.rows[0].twoClass
-            line.materialClassifyThreeName = res.rows[0].threeClass
-            line.materialClassifyFourName = res.rows[0].fourClass
-            line.specification = res.rows[0].specification
-            line.model = res.rows[0].model
-            line.unit = res.rows[0].unitId
-            line.unitName = res.rows[0].unitIdName
-            line.registrant = res.rows[0].registrant
-            line.manufacturerName = res.rows[0].manufacturerIdName
-            line.puPeriod = res.rows[0].deliveryPeriod
-            line.expiry = res.rows[0].usefulLife
-            line.expiryUnit = res.rows[0].expiryUnitIdName
-            // line.minPackage = res.rows[0].usefulLife
-            line.minPackage = res.rows[0].minPackQty
-            line.minOrderQty = res.rows[0].minOrderQty
-            line.minBatch = res.rows[0].minBatchQty
-            line.safeStock = res.rows[0].safeStock
-            line.purOrgName = res.rows[0].purchasingOrganizationName
-            line.puOrg = res.rows[0].purchasingOrganization
-            // 物料存储条件和运输条件
-            line.transportationCondition = res.rows[0].transportationCondition
-            line.storageCondition = res.rows[0].storageCondition
-            linArr[i] = line
-          }
+      // for (let i = 0; i<rows.length; i++) {
+        // console.log('items',rows[i])
+        await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
+          // if (res.code === 200) {
+          //   let line = {
+          //     contacts: null,
+          //     id: null,
+          //     demandId: null,
+          //     status: null,
+          //     businessDept: null,
+          //     businessDeptName: null,
+          //     materialCategory: null,
+          //     buyer: null,
+          //     buyerName: null,
+          //     mateiralClassifyOne: null,
+          //     materialClassifyOneName: null,
+          //     materialClassifyTwo: null,
+          //     materialClassifyTwoName: null,
+          //     materialClassifyThree: null,
+          //     materialClassifyThreeName: null,
+          //     materialClassifyFour: null,
+          //     materialClassifyFourName: null,
+          //     materialCode: null,
+          //     material: null,
+          //     materialName: null,
+          //     classifyId: null,
+          //     specification: null,
+          //     unit: null,
+          //     unitName: null,
+          //     manufacturerName: null,
+          //     registrant: null,
+          //     puPeriod: null,
+          //     expiryUnit: null,
+          //     expiry: null,
+          //     minPackage: null,
+          //     minOrderQty: null,
+          //     minBatch: null,
+          //     safeStock: null,
+          //     averageQtyMonth: null,
+          //     qty: null,
+          //     adjustmentPersonal: null,
+          //     adjustmentTime: null,
+          //     manualRegulation: null,
+          //     updateCause: null,
+          //     reservedProportion: null,
+          //     reservedPeriod: null,
+          //     reservedQty: null,
+          //     demandPeriod: null,
+          //     forecastClassify: null,
+          //     onemonthAvgVolume: null,
+          //     threemonthAvgVolume: null,
+          //     deliveryDate: null,
+          //     isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
+          //     isReplenishment: this.basicForm.billType == 'BDXQ' ? 'Y' : 'N',
+          //     isBatchLock: 'N',
+          //     remark: null,
+          //     puRemark: null,
+          //     lastWarehouseQty: null,
+          //     resDemandQty: null,
+          //     lastWarehouse: null,
+          //     lastWarehouseName: null,
+          //     deliveryWarehouse: null,
+          //     deliveryWarehouseName: null,
+          //     lastAllocation: null,
+          //     lastAllocationName: null,
+          //     deliveryAllocation: null,
+          //     deliveryAllocationName: null,
+          //     passageOn: null,
+          //     puOrg: null,
+          //     purOrgName: null,
+          //     lastStockQty: null,
+          //     superiorCenterQty: null,
+          //     superiorAllotQty: null,
+          //     availableQty: null,
+          //     statusAllot: 'N',
+          //     additionalSupplier: null,
+          //     additionalSupplierName: null,
+          //     periodUnit: null,
+          //     demandCustomer: this.basicForm.customer,
+          //     demandCustomerName: this.basicForm.customerName,
+          //     businessDept: this.basicForm.demandDept,
+          //     businessDeptName: null,
+          //     lastStockOrg: null,
+          //     lastStockOrgName: null,
+          //     superiorStockOrg: null,
+          //     superiorStockOrgName: null,
+          //     allotCode: null,
+          //     deliveryAddress: null,
+          //     deliveryAddressName: null,
+          //     contacts: null,
+          //     contactsPhone: null,
+          //     address: null,
+          //     source: null,
+          //     priceType: 'order',
+          //     puManagerApprover: null,
+          //     puManagerApproverName: null,
+          //     processTime: null,
+          //     affirmer: null,
+          //     tenantId: null,
+          //     revision: null,
+          //     createBy: null,
+          //     createByName: null,
+          //     createTime: null,
+          //     updateBy: null,
+          //     updateByName: null,
+          //     updateTime: null,
+          //     delFlag: 0,
+          //     // 新增字段
+          //     model: null,
+          //     storageCondition: null,
+          //     transportationCondition: null,
+          //   }
+          //   line.businessDept = res.rows[0].businessDepartment
+          //   line.businessDeptName = res.rows[0].businessDepartmentName
+          //   line.materialCode = res.rows[0].code
+          //   line.material = res.rows[0].id
+          //   line.materialName = res.rows[0].name
+          //   line.classifyId = res.rows[0].classifyId
+          //   line.materialClassifyOneName = res.rows[0].oneClass
+          //   line.materialClassifyTwoName = res.rows[0].twoClass
+          //   line.materialClassifyThreeName = res.rows[0].threeClass
+          //   line.materialClassifyFourName = res.rows[0].fourClass
+          //   line.specification = res.rows[0].specification
+          //   line.model = res.rows[0].model
+          //   line.unit = res.rows[0].unitId
+          //   line.unitName = res.rows[0].unitIdName
+          //   line.registrant = res.rows[0].registrant
+          //   line.manufacturerName = res.rows[0].manufacturerIdName
+          //   line.puPeriod = res.rows[0].deliveryPeriod
+          //   line.expiry = res.rows[0].usefulLife
+          //   line.expiryUnit = res.rows[0].expiryUnitIdName
+          //   // line.minPackage = res.rows[0].usefulLife
+          //   line.minPackage = res.rows[0].minPackQty
+          //   line.minOrderQty = res.rows[0].minOrderQty
+          //   line.minBatch = res.rows[0].minBatchQty
+          //   line.safeStock = res.rows[0].safeStock
+          //   line.purOrgName = res.rows[0].purchasingOrganizationName
+          //   line.puOrg = res.rows[0].purchasingOrganization
+          //   // 物料存储条件和运输条件
+          //   line.transportationCondition = res.rows[0].transportationCondition
+          //   line.storageCondition = res.rows[0].storageCondition
+          //   linArr[i] = line
+          // }
         })
         console.log('临时数组', linArr)
-      }
+      // }
       this.basicForm.puDemandItemList.push(...linArr)
       console.log('列表', this.basicForm.puDemandItemList)
       // this.basicForm.puDemandItemList.forEach(e => {

+ 18 - 21
src/views/purchase/PurchaseDemandList/index.vue

@@ -34,6 +34,13 @@
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
+              <el-form-item label="需求人员">
+                <el-select clearable size="mini" v-model="queryParams.demandPersonal" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
+                  <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
               <el-form-item label="" label-width="20px">
                 <el-button type="primary" size="mini" icon="el-icon-search" plain @click="searchList">搜索</el-button>
                 <el-button size="mini" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
@@ -44,13 +51,6 @@
           <div v-show="expanded">
           <el-row :gutter="10">
             <el-col :span="1.5">
-              <el-form-item label="需求人员">
-                <el-select clearable size="mini" v-model="queryParams.demandPersonal" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
-                  <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
               <el-form-item label="单据来源">
                 <el-select clearable v-model="queryParams.source" size="mini" style="width: 200px">
                   <el-option v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
@@ -66,9 +66,6 @@
                 </el-select>
               </el-form-item>
             </el-col>
-          </el-row>
-
-          <el-row :gutter="10">
             <el-col :span="1.5">
               <el-form-item label="需求部门">
                 <el-select clearable v-model="queryParams.demandDept" size="mini" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
@@ -94,18 +91,8 @@
                 </el-date-picker>
               </el-form-item>
             </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="备注">
-                <el-input
-                  v-model.trim="queryParams.remark"
-                  size="mini"
-                  clearable
-                  style="width: 200px"
-                />
-                </el-form-item>
-              </el-col>
           </el-row>
-
+          
           <el-row :gutter="10">
             <el-col :span="1.5">
               <el-form-item label="物料编码">
@@ -125,6 +112,16 @@
                 </el-select>
               </el-form-item>
             </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="备注">
+                <el-input
+                  v-model.trim="queryParams.remark"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+                </el-form-item>
+              </el-col>
           </el-row>
 
           </div>

+ 26 - 16
src/views/purchase/purchase-order/add/column.js

@@ -238,6 +238,7 @@ export const Columns = [
     controlsPosition: "right",
     precision:2,
     isShow:true, 
+    require: true,
   },
   { 
     key: "deductionMoney", 
@@ -246,6 +247,7 @@ export const Columns = [
     controlsPosition: "right",
     precision:2,
     isShow:true, 
+    require: true,
   },
   { 
     key: "goodsWarehouseName",
@@ -523,6 +525,14 @@ export const TabColumns = [
         disabled:true,
         require:false,
       },
+      { 
+        key: "contractNo",
+        title:"合同编号",
+        inputType: "Input", 
+        width: 180,
+        disabled:true,
+        require:false,
+      },
       // { key: "orderId", title: "采购订单ID", inputType: "Input", width: 180 },
       // {key: "material",title: "物料",inputType: "Input",   },
       {
@@ -848,8 +858,8 @@ export const TabColumns = [
        },
       { key: "exchangeRate", title: "折本汇率", inputType: "Input", },
       { key: "source", title: "上游单据号", inputType: "Input", width: 180 },
-      { key: "sourceId", title: "上游单据ID", inputType: "Input", width: 180 },
-      { key: "demandCode", title: "采购需求单号", inputType: "Input", width: 180 },
+      // { key: "sourceId", title: "上游单据ID", inputType: "Input", width: 180 },
+      // { key: "demandCode", title: "采购需求单号", inputType: "Input", width: 180 },
       { key: "arrivalDatePlan", title: "计划到货日期", inputType: "Input", width: 180 },
      
       { key: "isDistributionPrice", title: "配送价", inputType: "Checkbox", },
@@ -886,8 +896,8 @@ export const TabColumns = [
         disabled:true,
         readonly:true,
       },
-      { key: "createByName", title: "创建人", inputType: "Input", },
-      { key: "updateByName", title: "更新人", inputType: "Input", },
+      // { key: "createByName", title: "创建人", inputType: "Input", },
+      // { key: "updateByName", title: "更新人", inputType: "Input", },
       
     ]
   },
@@ -994,18 +1004,18 @@ export const TabColumns = [
         controlsPosition: "right",
         width: 180, 
       },
-      { 
-        key: "createByName", 
-        title: "创建人名称", 
-        inputType: "Input", 
-        width: 120 
-      },
-      { 
-        key: "updateByName", 
-        title: "更新人名称", 
-        inputType: "Input", 
-        width: 120 
-      },
+      // { 
+      //   key: "createByName", 
+      //   title: "创建人", 
+      //   inputType: "Input", 
+      //   width: 120 
+      // },
+      // { 
+      //   key: "updateByName", 
+      //   title: "更新人", 
+      //   inputType: "Input", 
+      //   width: 120 
+      // },
     ]
   },
 ];

+ 17 - 20
src/views/purchase/purchase-order/index.vue

@@ -143,26 +143,42 @@ export default {
     },
     // 编辑、修订
     async handleOpenEditDrawer(row) {
+
       const { id } = row;
+
       const { setVisible, fetchItem } = this.$refs.editDrawerRef;
+      
       await setVisible(true);
+
       await fetchItem(id);
+      
     },
     // 获取子表信息
      handleDetailsData(row) {
-      window.clearTimeout(this.timeOut)
+
+      window.clearTimeout(this.timeOut);
+
       this.timeOut = setTimeout(async () =>{
 
         try {
+
           this.tabLoading = true;
+
           this.primaryResource = row;
+
           this.checkedTabList = [];
+
           const { code, msg, data } = await orderApi.details(row.id);
+
           if (code === 200) {
+
             // 物料信息:puOrderItemList   执行结果:puOrderExecuteList
             for (const key in this.tabTableDatas) {
+
               this.tabTableDatas[key] = data[key];
+
             }
+
           }
         } catch (err) {}
         finally{
@@ -221,8 +237,6 @@ export default {
 
       let inconformity = this.checkedList.filter(row => !(row.status == '0' || row.status == '3'));
 
-      console.log(inconformity,'inconformity--------');
-
       if(!inconformity.length && this.checkedList.length){
 
         let puOrderIds = this.checkedList.map( item => Number(item.id));
@@ -245,22 +259,6 @@ export default {
 
       this.fetchSubmit(puOrderIds);
 
-      // try {
-
-      //  this.handleConfirmTips(async()=>{
-
-      //    let { code } = await orderApi.submit({ puOrderId: row.id });
- 
-      //    if (code == 200) {
- 
-      //     this.handleRefreshList();
- 
-      //    }
-
-      //  })
-      // } catch (error) {
-      // } finally {
-      // }
     },
     fetchSubmit(puOrderIds){
 
@@ -636,7 +634,6 @@ export default {
       </el-table-column>
       <el-table-column fixed="right" label="操作" width="120">
         <template slot-scope="scope">
-          <!-- <el-button @click.stop="handleOpenSeeDrawer(scope.row)" type="text" size="small">查看</el-button> -->
           <el-button 
             v-if="scope.row.status == '2'"
             type="text"