Ver código fonte

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

WuXiaohan 1 ano atrás
pai
commit
e0fd32e7d9

+ 1 - 0
package.json

@@ -45,6 +45,7 @@
     "clipboard": "2.0.8",
     "core-js": "^3.25.3",
     "echarts": "^5.4.0",
+    "el-table-infinite-scroll": "^2.0.0",
     "element-ui": "2.15.12",
     "file-saver": "2.0.5",
     "fuse.js": "6.4.3",

+ 25 - 25
src/main.js

@@ -96,31 +96,31 @@ Vue.use(Print); //注册
 DictData.install();
 
 // el-table无限滚动解决页面渲染卡死
-Vue.directive("myscroll", {
-  bind(el, bind, vnode) {
-    const self = vnode.context;
-    let target = el.querySelector('.el-table__body-wrapper');
-    target.addEventListener("scroll", () => {
-      // 检测触底
-      if (target.scrollTop + target.clientHeight >= target.scrollHeight) {
-        if (self.over >= self.basicForm.puDemandItemList) {
-          return;
-        }
-        self.over +=15
-      }
-    })
-  }
-})
-Vue.mixin({
-  data() {
-    return {
-      // scrollTop: 0,
-      // tableHeight: 300
-      start: 0,
-      over: 15
-    }
-  }
-})
+// Vue.directive("myscroll", {
+//   bind(el, bind, vnode) {
+//     const self = vnode.context;
+//     let target = el.querySelector('.el-table__body-wrapper');
+//     target.addEventListener("scroll", () => {
+//       // 检测触底
+//       if (target.scrollTop + target.clientHeight >= target.scrollHeight) {
+//         if (self.over >= self.basicForm.puDemandItemList) {
+//           return;
+//         }
+//         self.over +=15
+//       }
+//     })
+//   }
+// })
+// Vue.mixin({
+//   data() {
+//     return {
+//       // scrollTop: 0,
+//       // tableHeight: 300
+//       start: 0,
+//       over: 15
+//     }
+//   }
+// })
 /**
  * If you don't want to use mock-server
  * you want to use MockJs for mock api

+ 122 - 56
src/views/business/spd/goal_management/AnnualSaleGoal.vue

@@ -41,6 +41,9 @@
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            <el-tooltip class="item" effect="dark" :content="showSearch?'隐藏搜索':'显示搜索'" placement="top">
+              <el-button type="warning" :icon="showSearch?'el-icon-caret-top':'el-icon-caret-bottom'" circle @click="showSearch = !showSearch"></el-button>
+            </el-tooltip>
           </el-form-item>
         </el-col>
       </el-row>
@@ -98,6 +101,18 @@
             </el-popover-select-v2>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="单据状态" prop="documentStatus">
+            <el-select v-model="queryParams.documentStatus" placeholder="请选择">
+              <el-option
+                v-for="item in [{value: '未提交', label: '未提交'}, {value: '审核中', label: '审核中'}, {value: '已审核', label: '已审核'}]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
 
@@ -153,7 +168,6 @@
           </el-dropdown-menu>
         </el-dropdown>
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="annualSaleGoalList" @selection-change="handleSelectionChange">
@@ -290,17 +304,20 @@
         </el-row>
       </el-form>
       <div id="addDetails">
-        <el-row :gutter="10" class="mb8" style="margin-left: 87%">
+        <el-row :gutter="10" class="mb8" style="margin-left: 80%">
           <el-col :span="1.5">
             <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport">导入明细</el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddDetails">增行</el-button>
           </el-col>
+          <el-col :span="1.5">
+            <el-button type="primary" plain icon="el-icon-edit-outline" size="mini" @click="dialogUpdateMore.dialogFormVisible = true">批量修改</el-button>
+          </el-col>
         </el-row>
         <el-tabs v-model="activeName">
           <el-tab-pane label="年销售目标填报明细" name="annualSaleGoalDetails">
-            <el-table show-summary sum-text="小计" v-loading="loading" :data="annualSaleGoalDetailsList" @selection-change="handleSelectionChange">
+            <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="annualSaleGoalDetailsList" @selection-change="handleSelectionChange">
               <el-table-column label="序号" type="index" width="70" align="center" fixed />
               <el-table-column label="销售组织" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
@@ -338,29 +355,22 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="一级分类" align="center" width="220" :render-header="addRedStar">
+              <el-table-column label="一级分类" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
-                  <el-select v-model="annualSaleGoalDetailsList[scope.$index].oneLevelClassify" size="mini" clearable
-                             @focus="chooseTreeReferForDetails('MATERIALCLASSIFY_PARAM', false, '一级物料分类', scope.$index)"
-                             style="width: 200px">
-                    <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
-                  </el-select>
+                  <el-input v-model="annualSaleGoalDetailsList[scope.$index].oneLevelClassify" placeholder="请输入一级分类" disabled></el-input>
                 </template>
               </el-table-column>
-              <el-table-column label="二级分类" align="center" width="220">
+              <el-table-column label="二级分类" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
-                  <el-select v-model="annualSaleGoalDetailsList[scope.$index].twoLevelClassify" size="mini" clearable
-                             @focus="chooseTreeReferForDetails('MATERIALCLASSIFY_PARAM', false, '二级物料分类', scope.$index)"
-                             style="width: 200px">
-                    <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
-                  </el-select>
+                  <el-input v-model="annualSaleGoalDetailsList[scope.$index].twoLevelClassify" placeholder="请输入二级分类" disabled></el-input>
                 </template>
               </el-table-column>
-              <el-table-column label="物料" align="center" width="180">
+              <el-table-column label="物料" align="center" width="220" :render-header="addRedStar">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].material" title="物料" valueKey="name"
                                         referName="MATERIAL_PARAM"
-                                        :dataMapping="{ materialCode: 'code', material: 'name'}"
+                                        @change="setClassify(scope.row.oneLevelClassify, scope.row.twoLevelClassify, annualSaleGoalDetailsList[scope.$index])"
+                                        :dataMapping="{ materialCode: 'code', material: 'name', oneLevelClassify: 'oneClass', twoLevelClassify: 'twoClass'}"
                                         :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入物料">
                   </el-popover-select-v2>
                 </template>
@@ -485,8 +495,46 @@
         <el-button @click="upload.open = false">取 消</el-button>
       </div>
     </el-dialog>
-
-    <TreeRefers ref="treeDetails" @doSubmit="selectionsToInputForDetails" :single="true"/>
+    <!-- 批量修改对话框-->
+    <el-dialog title="批量修改" width="30%" :visible.sync="dialogUpdateMore.dialogFormVisible" append-to-body @closed="resetDialogUpdateMore">
+      <el-form>
+        <el-form-item label="修改项" label-width="100px">
+          <el-select @change="changeDialogData" v-model="dialogUpdateMore.updateName" placeholder="请选择需要批量修改的字段">
+            <el-option v-for="item in dialogUpdateMore.optionList" :key="item.value" :label="item.label" :value="item.value"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="修改值" label-width="100px">
+          <el-popover-select-v2 v-if="dialogUpdateMore.updateName === 1"
+                                v-model="dialogUpdateMore.updateData" title="销售组织" valueKey="name"
+                                referName="ORG_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入销售组织">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 2"
+                                v-model="dialogUpdateMore.updateData" title="销售区域" valueKey="name"
+                                referName="MK_SALESAREA_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入销售区域">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 3"
+                                v-model="dialogUpdateMore.updateData" title="客户" valueKey="name"
+                                referName="CUSTOMER_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入客户">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 4"
+                                v-model="dialogUpdateMore.updateData" title="制单人" valueKey="name"
+                                referName="CONTACTS_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入制单人">
+          </el-popover-select-v2>
+          <el-input v-else placeholder="请输入修改项" disabled></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="dialogUpdateMoreSave">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -640,9 +688,6 @@ export default {
         creator: [{required: true, message: '制单人不能为空', trigger: 'blur'}],
         dept: [{required: true, message: '部门不能为空', trigger: 'blur'}]
       },
-      // 参照条件
-      referCondition: {type: '', isPage: true, title: '', index: null},
-      classOptions: [],
       // 子表数组
       annualSaleGoalDetailsList: [],
       // 用户导入参数
@@ -660,7 +705,13 @@ export default {
         // 上传的地址
         url: process.env.VUE_APP_BASE_API + "/goal_management/annualSaleGoal/importData"
       },
-      activeName: 'annualSaleGoalDetails'
+      activeName: 'annualSaleGoalDetails',
+      dialogUpdateMore: {
+        updateName: null,
+        dialogFormVisible: false,
+        updateData: null,
+        optionList:[{value: 1, label: '销售组织'}, {value: 2, label: '销售区域'}, {value: 3, label: '客户'}, {value: 4, label: '制单人'},]
+      }
     };
   },
   created() {
@@ -951,36 +1002,6 @@ export default {
       }
       this.form.goalTotal = sum
     },
-    // 树形物料分类
-    chooseTreeReferForDetails(type, isPage, title, index) {
-      this.referCondition.type = type
-      this.referCondition.isPage = isPage
-      this.referCondition.title = title
-      this.referCondition.index = index
-      this.$refs.treeDetails.init(this.referCondition)
-    },
-    selectionsToInputForDetails(selection) {
-      this.classOptions.push(selection)
-      if (this.referCondition.title === '一级物料分类') {
-        if (selection.code.length !== 1) {
-          return this.$message.info('请在一级分类中选择')
-        }
-        if (selection.code !== this.annualSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode) {
-          this.annualSaleGoalDetailsList[this.referCondition.index].twoLevelClassifyCode = null
-          this.annualSaleGoalDetailsList[this.referCondition.index].twoLevelClassify = null
-        }
-        this.annualSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode = selection.code
-        this.annualSaleGoalDetailsList[this.referCondition.index].oneLevelClassify = selection.name
-      } else if (this.referCondition.title === '二级物料分类') {
-        if (selection.code.length !== 4) {
-          return this.$message.info('请在二级分类中选择')
-        } else if (selection.code[0] !== this.annualSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode) {
-          return this.$message.error('所选择的二级物料分类不属于一级分类')
-        }
-        this.annualSaleGoalDetailsList[this.referCondition.index].twoLevelClassifyCode = selection.code
-        this.annualSaleGoalDetailsList[this.referCondition.index].twoLevelClassify = selection.name
-      }
-    },
     // 给table添加必填项
     addRedStar(h, { column }) {
       return [
@@ -992,11 +1013,13 @@ export default {
     justiceDetailsList() {
       const arr = JSON.parse(JSON.stringify(this.annualSaleGoalDetailsList))
       for (const element of arr) {
-        if (element.saleOrg === null || element.saleZone === null || element.custom === null || element.creator === null || element.oneLevelClassify === null) {
-          return false
+        const flag1 = (element.saleZone !== null) && (element.saleOrg !== null) && (element.custom !== null) && (element.creator !== null) && (element.materialCode !== null) && (element.material !== null)
+        const flag2 = (element.saleOrg !== undefined) && (element.saleZone !== undefined) && (element.custom !== undefined) && (element.creator !== undefined) && (element.materialCode != undefined) && (element.material !== undefined)
+        if (flag1 && flag2) {
+          return true
         }
       }
-      return true
+      return false
     },
     handleCommand(command) {
       // 执行对应的功能
@@ -1054,6 +1077,49 @@ export default {
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    // 选择物料后,给一级分类和二级分类复赋值
+    setClassify(one, two, obj) {
+      const oneArray = one.split("&")
+      const twoArray = two.split("&")
+      obj.oneLevelClassifyCode = oneArray[1]
+      obj.oneLevelClassify = oneArray[0]
+      obj.twoLevelClassifyCode = twoArray[1]
+      obj.twoLevelClassify = twoArray[0]
+      console.log(obj);
+    },
+    // 批量修改对话框的方法
+    dialogUpdateMoreSave() {
+      console.log(this.dialogUpdateMore);
+      if (this.dialogUpdateMore.updateData === null) {
+        return this.$message.error('请输入修改值')
+      }
+      const array = JSON.parse(JSON.stringify(this.annualSaleGoalDetailsList))
+      if (array.length !== 0) {
+        let condition = this.dialogUpdateMore.updateName
+        for (const element of array) {
+          if (condition === 1) {
+            element.saleOrg = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 2) {
+            element.saleZone = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 3) {
+            element.custom = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 4) {
+            element.creator = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          }
+        }
+      }
+      this.annualSaleGoalDetailsList = array
+      this.dialogUpdateMore.dialogFormVisible = !this.dialogUpdateMore.dialogFormVisible
+      this.dialogUpdateMore.updateData = null
+      this.dialogUpdateMore.updateName = null
+    },
+    changeDialogData() {
+      this.dialogUpdateMore.updateData = null
+    },
+    resetDialogUpdateMore() {
+      this.dialogUpdateMore.updateName = null
+      this.dialogUpdateMore.updateData = null
     }
   }
 };

+ 35 - 9
src/views/business/spd/goal_management/AnnualSaleGoalMerge.vue

@@ -32,6 +32,9 @@
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            <el-tooltip class="item" effect="dark" :content="showSearch?'隐藏搜索':'显示搜索'" placement="top">
+              <el-button type="warning" :icon="showSearch?'el-icon-caret-top':'el-icon-caret-bottom'" circle @click="showSearch = !showSearch"></el-button>
+            </el-tooltip>
           </el-form-item>
         </el-col>
       </el-row>
@@ -109,6 +112,18 @@
             </el-select>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="单据状态" prop="documentStatus">
+            <el-select v-model="queryParams.documentStatus" placeholder="请选择">
+              <el-option
+                v-for="item in [{value: '未提交', label: '未提交'}, {value: '审核中', label: '审核中'}, {value: '已审核', label: '已审核'}]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
 
@@ -166,7 +181,6 @@
           </el-dropdown-menu>
         </el-dropdown>
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="annualSaleGoalMergeList" @selection-change="handleSelectionChange">
@@ -330,7 +344,7 @@
         </el-row>
         <el-tabs v-model="activeName" @tab-click="getNewTwoArray">
           <el-tab-pane label="年销售目标合并明细" name="annualSaleGoalMergeDetails">
-            <el-table show-summary sum-text="小计" v-loading="loading" :data="annualSaleGoalMergeDetailsList">
+            <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="annualSaleGoalMergeDetailsList">
               <el-table-column label="序号" type="index" width="70" align="center" fixed />
               <el-table-column label="销售组织" align="center" width="180">
                 <template slot-scope="scope">
@@ -386,7 +400,7 @@
                   </el-select>
                 </template>
               </el-table-column>
-              <el-table-column label="合计" align="center" prop="goalSum" width="180">
+              <el-table-column label="合计" align="center" prop="totalGoal" width="180">
                 <template slot-scope="scope">
                   <el-input v-model="annualSaleGoalMergeDetailsList[scope.$index].totalGoal" disabled></el-input>
                 </template>
@@ -454,7 +468,7 @@
             </el-table>
           </el-tab-pane>
           <el-tab-pane label="区域目标汇总(年)" name="zoneGoalSum(year)">
-            <el-table show-summary sum-text="小计" v-loading="loading" :data="areaDetailList">
+            <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="areaDetailList">
               <el-table-column label="序号" type="index" width="70" align="center" fixed />
               <el-table-column label="销售组织" align="center" width="180">
                 <template slot-scope="scope">
@@ -483,7 +497,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="合计" align="center" prop="goalSum" width="180">
+              <el-table-column label="合计" align="center" prop="totalGoal" width="180">
                 <template slot-scope="scope">
                   <el-input v-model="areaDetailList[scope.$index].totalGoal" disabled></el-input>
                 </template>
@@ -551,7 +565,7 @@
             </el-table>
           </el-tab-pane>
           <el-tab-pane label="客户目标汇总(年)" name="customerGoalSum(year)">
-            <el-table show-summary sum-text="小计" v-loading="loading" :data="customerDetailList">
+            <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="customerDetailList">
               <el-table-column label="序号" type="index" width="70" align="center" fixed />
               <el-table-column label="销售组织" align="center" width="180">
                 <template slot-scope="scope">
@@ -580,7 +594,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="合计" align="center" prop="goalSum" width="180">
+              <el-table-column label="合计" align="center" prop="totalGoal" width="180">
                 <template slot-scope="scope">
                   <el-input v-model="customerDetailList[scope.$index].totalGoal" disabled></el-input>
                 </template>
@@ -1374,6 +1388,18 @@ export default {
           if (map.has(key)) {
             const existingObj = map.get(key)
             existingObj.totalGoal += obj.totalGoal
+            existingObj.januaryGoal += obj.januaryGoal
+            existingObj.februaryGoal += obj.februaryGoal
+            existingObj.marchGoal += obj.marchGoal
+            existingObj.aprilGoal += obj.aprilGoal
+            existingObj.mayGoal += obj.mayGoal
+            existingObj.juneGoal += obj.juneGoal
+            existingObj.julyGoal += obj.julyGoal
+            existingObj.augustGoal += obj.augustGoal
+            existingObj.septemberGoal += obj.septemberGoal
+            existingObj.octoberGoal += obj.octoberGoal
+            existingObj.novemberGoal += obj.novemberGoal
+            existingObj.decemberGoal += obj.decemberGoal
           } else {
             map.set(key, { ...obj })
           }
@@ -1394,8 +1420,8 @@ export default {
         this.queryParams.params.beginTime = array[0]
         this.queryParams.params.endTime = array[1]
       } else {
-        this.queryParams.beginTime = null
-        this.queryParams.endTime = null
+        this.queryParams.params.beginTime = null
+        this.queryParams.params.endTime = null
       }
     },
     handleCommand(command) {

+ 20 - 7
src/views/business/spd/goal_management/MonthGoalMerge.vue

@@ -32,6 +32,9 @@
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            <el-tooltip class="item" effect="dark" :content="showSearch?'隐藏搜索':'显示搜索'" placement="top">
+              <el-button type="warning" :icon="showSearch?'el-icon-caret-top':'el-icon-caret-bottom'" circle @click="showSearch = !showSearch"></el-button>
+            </el-tooltip>
           </el-form-item>
         </el-col>
       </el-row>
@@ -124,6 +127,18 @@
             </el-select>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="单据状态" prop="documentStatus">
+            <el-select v-model="queryParams.documentStatus" placeholder="请选择">
+              <el-option
+                v-for="item in [{value: '未提交', label: '未提交'}, {value: '审核中', label: '审核中'}, {value: '已审核', label: '已审核'}]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
 
@@ -179,7 +194,6 @@
           </el-dropdown-menu>
         </el-dropdown>
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="monthGoalMergeList" @selection-change="handleSelectionChange">
@@ -363,7 +377,7 @@
         </el-row>
         <el-tabs v-model="activeName" @tab-click="getNewTwoArray">
           <el-tab-pane label="月销售目标合并明细" name="monthGoalMergeDetails">
-            <el-table show-summary sum-text="小计" v-loading="loading" :data="monthGoalMergeDetailsList" @selection-change="handleSelectionChange">
+            <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="monthGoalMergeDetailsList" @selection-change="handleSelectionChange">
               <el-table-column label="序号" type="index" width="70" align="center" fixed />
               <el-table-column label="销售组织" align="center" prop="saleOrg" width="180">
                 <template slot-scope="scope">
@@ -456,7 +470,7 @@
             </el-table>
           </el-tab-pane>
           <el-tab-pane label="区域目标汇总(月)" name="zoneGoalSum">
-            <el-table :data="zoneGoalSumList">
+            <el-table max-height="300" :data="zoneGoalSumList">
               <el-table-column label="序号" type="index" width="55" align="center" fixed />
               <el-table-column label="销售组织" align="center" prop="saleOrg" width="180">
                 <template slot-scope="scope">
@@ -490,7 +504,7 @@
             </el-table>
           </el-tab-pane>
           <el-tab-pane label="客户目标汇总(月)" name="customGoalSum">
-            <el-table :data="customGoalSumList">
+            <el-table max-height="300" :data="customGoalSumList">
               <el-table-column label="序号" type="index" width="55" align="center" fixed />
               <el-table-column label="销售组织" align="center" prop="saleOrg" width="180">
                 <template slot-scope="scope">
@@ -1181,7 +1195,6 @@ export default {
       this.$confirm('确认关闭?')
         .then(_ => {
           done();
-          this.resetQuery()
         })
         .catch(_ => {});
     },
@@ -1263,8 +1276,8 @@ export default {
         this.queryParams.params.beginTime = array[0]
         this.queryParams.params.endTime = array[1]
       } else {
-        this.queryParams.beginTime = null
-        this.queryParams.endTime = null
+        this.queryParams.params.beginTime = null
+        this.queryParams.params.endTime = null
       }
     },
     handleCommand(command) {

+ 123 - 9
src/views/business/spd/goal_management/MonthReturnGoal.vue

@@ -41,6 +41,9 @@
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            <el-tooltip class="item" effect="dark" :content="showSearch?'隐藏搜索':'显示搜索'" placement="top">
+              <el-button type="warning" :icon="showSearch?'el-icon-caret-top':'el-icon-caret-bottom'" circle @click="showSearch = !showSearch"></el-button>
+            </el-tooltip>
           </el-form-item>
         </el-col>
       </el-row>
@@ -97,6 +100,18 @@
             </el-popover-select-v2>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="单据状态" prop="documentStatus">
+            <el-select v-model="queryParams.documentStatus" placeholder="请选择">
+              <el-option
+                v-for="item in [{value: '未提交', label: '未提交'}, {value: '审核中', label: '审核中'}, {value: '已审核', label: '已审核'}]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
     <el-row :gutter="10" class="mb8" style="float: right">
@@ -151,7 +166,6 @@
           </el-dropdown-menu>
         </el-dropdown>
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     <el-table v-loading="loading" :data="monthReturnGoalList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center"/>
@@ -295,17 +309,20 @@
         </el-row>
       </el-form>
       <div>
-        <el-row :gutter="10" class="mb8" style="margin-left: 87%">
+        <el-row :gutter="10" class="mb8" style="margin-left: 80%">
           <el-col :span="1.5">
             <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport">导入明细</el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddDetails">增行</el-button>
           </el-col>
+          <el-col :span="1.5">
+            <el-button type="primary" plain icon="el-icon-edit-outline" size="mini" @click="dialogUpdateMore.dialogFormVisible = true">批量修改</el-button>
+          </el-col>
         </el-row>
         <el-tabs v-model="activeName">
           <el-tab-pane label="月回款目标明细" name="monthReturnGoalDetails">
-            <el-table show-summary sum-text="小计" v-loading="loading" :data="monthReturnGoalDetailsList" @selection-change="handleSelectionChange">
+            <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="monthReturnGoalDetailsList" @selection-change="handleSelectionChange">
               <el-table-column label="序号" type="index" width="70" align="center" fixed />
               <el-table-column label="销售组织" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
@@ -419,6 +436,58 @@
       </div>
     </el-dialog>
 
+    <!-- 批量修改对话框-->
+    <el-dialog title="批量修改" width="30%" :visible.sync="dialogUpdateMore.dialogFormVisible" append-to-body @closed="resetDialogUpdateMore">
+      <el-form>
+        <el-form-item label="修改项" label-width="100px">
+          <el-select @change="changeDialogData" v-model="dialogUpdateMore.updateName" placeholder="请选择需要批量修改的字段">
+            <el-option v-for="item in dialogUpdateMore.optionList" :key="item.value" :label="item.label" :value="item.value"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="修改值" label-width="100px">
+          <el-popover-select-v2 v-if="dialogUpdateMore.updateName === 1"
+                                v-model="dialogUpdateMore.updateData" title="销售组织" valueKey="name"
+                                referName="ORG_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入销售组织">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 2"
+                                v-model="dialogUpdateMore.updateData" title="销售区域" valueKey="name"
+                                referName="MK_SALESAREA_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入销售区域">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 3"
+                                v-model="dialogUpdateMore.updateData" title="客户" valueKey="name"
+                                referName="CUSTOMER_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入客户">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 4"
+                                v-model="dialogUpdateMore.updateData" title="部门" valueKey="name"
+                                referName="DEPT_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入部门">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 5"
+                                v-model="dialogUpdateMore.updateData" title="制单人" valueKey="name"
+                                referName="CONTACTS_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入制单人">
+          </el-popover-select-v2>
+          <el-date-picker v-else-if="dialogUpdateMore.updateName === 6"
+                          v-model="dialogUpdateMore.updateData" value-format="yyyy-MM"
+                          type="month"
+                          placeholder="选择月">
+          </el-date-picker>
+          <el-input v-else placeholder="请输入修改项" disabled></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="dialogUpdateMoreSave">确 定</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -572,6 +641,12 @@ export default {
         headers: { Authorization: "Bearer " + getToken() },
         // 上传的地址
         url: process.env.VUE_APP_BASE_API + "/mk/monthReturnGoal/importData"
+      },
+      dialogUpdateMore: {
+        updateName: null,
+        dialogFormVisible: false,
+        updateData: null,
+        optionList:[{value: 1, label: '销售组织'}, {value: 2, label: '销售区域'}, {value: 3, label: '客户'}, {value: 4, label: '部门'}, {value: 5, label: '制单人'}, {value: 6, label: '月份'}]
       }
     }
   },
@@ -723,7 +798,7 @@ export default {
     /** 提交按钮 */
     submitForm() {
       if (!this.justiceDetailsList()) {
-        return this.$message.error('子表中有必填字段未填')
+        return this.$message.error('子表中有必填字段未填,或者目标值为0')
       }
       this.$refs["form"].validate(valid => {
         if (valid) {
@@ -828,8 +903,8 @@ export default {
         this.queryParams.params.beginTime = array[0]
         this.queryParams.params.endTime = array[1]
       } else {
-        this.queryParams.beginTime = null
-        this.queryParams.endTime = null
+        this.queryParams.params.beginTime = null
+        this.queryParams.params.endTime = null
       }
     },
     // 给table添加必填项
@@ -843,11 +918,13 @@ export default {
     justiceDetailsList() {
       const arr = JSON.parse(JSON.stringify(this.monthReturnGoalDetailsList))
       for (const element of arr) {
-        if (element.saleOrg === null || element.saleZone === 'null' || element.custom === null || element.dept === null || element.creator === null || element.monthly === null || element.goalSum === null) {
-          return false
+        const flag1 = (element.saleOrg !== null) && (element.saleZone !== null) && (element.custom !== null) && (element.dept !== null) && (element.creator !== null) && (element.monthly !== null) && (element.goalSum !== 0)
+        const flag2 = (element.saleOrg !== undefined) && (element.saleZone !== undefined) && (element.custom !== undefined) && (element.dept !== undefined) && (element.creator !== undefined) && (element.monthly !== undefined)
+        if (flag1 && flag2) {
+          return true
         }
       }
-      return true
+      return false
     },
     handleCommand(command) {
       // 执行对应的功能
@@ -910,6 +987,43 @@ export default {
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    // 批量修改对话框的方法
+    dialogUpdateMoreSave() {
+      console.log(this.dialogUpdateMore);
+      if (this.dialogUpdateMore.updateData === null) {
+        return this.$message.error('请输入修改值')
+      }
+      const array = JSON.parse(JSON.stringify(this.monthReturnGoalDetailsList))
+      if (array.length !== 0) {
+        let condition = this.dialogUpdateMore.updateName
+        for (const element of array) {
+          if (condition === 1) {
+            element.saleOrg = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 2) {
+            element.saleZone = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 3) {
+            element.custom = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 4) {
+            element.dept = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 5) {
+            element.creator = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 6) {
+            element.monthly = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          }
+        }
+      }
+      this.monthReturnGoalDetailsList = array
+      this.dialogUpdateMore.dialogFormVisible = !this.dialogUpdateMore.dialogFormVisible
+      this.dialogUpdateMore.updateData = null
+      this.dialogUpdateMore.updateName = null
+    },
+    changeDialogData() {
+      this.dialogUpdateMore.updateData = null
+    },
+    resetDialogUpdateMore() {
+      this.dialogUpdateMore.updateName = null
+      this.dialogUpdateMore.updateData = null
     }
   }
 }

+ 19 - 5
src/views/business/spd/goal_management/MonthReturnMerge.vue

@@ -32,6 +32,9 @@
         <el-form-item>
           <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
           <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+          <el-tooltip class="item" effect="dark" :content="showSearch?'隐藏搜索':'显示搜索'" placement="top">
+            <el-button type="warning" :icon="showSearch?'el-icon-caret-top':'el-icon-caret-bottom'" circle @click="showSearch = !showSearch"></el-button>
+          </el-tooltip>
         </el-form-item>
       </el-col>
     </el-row>
@@ -100,6 +103,18 @@
           </el-popover-select-v2>
         </el-form-item>
       </el-col>
+      <el-col :span="6">
+        <el-form-item label="单据状态" prop="documentStatus">
+          <el-select v-model="queryParams.documentStatus" placeholder="请选择">
+            <el-option
+              v-for="item in [{value: '未提交', label: '未提交'}, {value: '审核中', label: '审核中'}, {value: '已审核', label: '已审核'}]"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
     </el-row>
   </el-form>
   <el-row :gutter="10" class="mb8" style="float: right">
@@ -155,7 +170,6 @@
         </el-dropdown-menu>
       </el-dropdown>
     </el-col>
-    <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
   </el-row>
   <el-table v-loading="loading" :data="monthReturnMergeList" @selection-change="handleSelectionChange">
     <el-table-column type="selection" width="55" align="center"/>
@@ -320,7 +334,7 @@
       </el-row>
       <el-tabs v-model="activeName" @tab-click="getNewTwoArray">
         <el-tab-pane label="月回款目标合并明细" name="monthReturnMergeDetails">
-          <el-table show-summary sum-text="小计" v-loading="loading" :data="monthReturnMergeDetailsList">
+          <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="monthReturnMergeDetailsList">
             <el-table-column label="序号" type="index" width="55" align="center" fixed />
             <el-table-column label="销售组织" align="center" width="180">
               <template slot-scope="scope">
@@ -381,7 +395,7 @@
           </el-table>
         </el-tab-pane>
         <el-tab-pane label="区域目标汇总(月回款)" name="zoneGoalSum(monthReturn)">
-          <el-table show-summary sum-text="小计" :data="zoneGoalSumList">
+          <el-table max-height="300" show-summary sum-text="小计" :data="zoneGoalSumList">
             <el-table-column label="序号" type="index" width="55" align="center" fixed />
             <el-table-column label="销售组织" align="center" width="180">
               <template slot-scope="scope">
@@ -914,8 +928,8 @@ export default {
         this.queryParams.params.beginTime = array[0]
         this.queryParams.params.endTime = array[1]
       } else {
-        this.queryParams.beginTime = null
-        this.queryParams.endTime = null
+        this.queryParams.params.beginTime = null
+        this.queryParams.params.endTime = null
       }
     },
     getNewTwoArray() {

+ 145 - 60
src/views/business/spd/goal_management/MonthSaleGoal.vue

@@ -41,6 +41,9 @@
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            <el-tooltip class="item" effect="dark" :content="showSearch?'隐藏搜索':'显示搜索'" placement="top">
+              <el-button type="warning" :icon="showSearch?'el-icon-caret-top':'el-icon-caret-bottom'" circle @click="showSearch = !showSearch"></el-button>
+            </el-tooltip>
           </el-form-item>
         </el-col>
       </el-row>
@@ -97,6 +100,18 @@
             </el-popover-select-v2>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="单据状态" prop="documentStatus">
+            <el-select v-model="queryParams.documentStatus" placeholder="请选择">
+              <el-option
+                v-for="item in [{value: '未提交', label: '未提交'}, {value: '审核中', label: '审核中'}, {value: '已审核', label: '已审核'}]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
 
@@ -152,7 +167,6 @@
           </el-dropdown-menu>
         </el-dropdown>
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="monthSaleGoalList" @selection-change="handleSelectionChange">
@@ -297,17 +311,20 @@
         </el-row>
       </el-form>
       <div>
-        <el-row :gutter="10" class="mb8" style="margin-left: 87%">
+        <el-row :gutter="10" class="mb8" style="margin-left: 80%">
           <el-col :span="1.5">
             <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport">导入明细</el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddDetails">增行</el-button>
           </el-col>
+          <el-col :span="1.5">
+            <el-button type="primary" plain icon="el-icon-edit-outline" size="mini" @click="dialogUpdateMore.dialogFormVisible = true">批量修改</el-button>
+          </el-col>
         </el-row>
         <el-tabs v-model="activeName">
           <el-tab-pane label="月销售目标明细" name="monthSaleGoalDetails">
-            <el-table show-summary sum-text="小计" v-loading="loading" :data="monthSaleGoalDetailsList" @selection-change="handleSelectionChange">
+            <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="monthSaleGoalDetailsList" @selection-change="handleSelectionChange">
               <el-table-column label="序号" type="index" width="70" align="center" fixed />
               <el-table-column label="销售组织" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
@@ -354,29 +371,22 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="一级分类" align="center" width="220" :render-header="addRedStar">
+              <el-table-column label="一级分类" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
-                  <el-select v-model="monthSaleGoalDetailsList[scope.$index].oneLevelClassify" size="mini" clearable
-                             @focus="chooseTreeReferForDetails('MATERIALCLASSIFY_PARAM', false, '一级物料分类', scope.$index)"
-                             style="width: 200px">
-                    <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
-                  </el-select>
+                  <el-input v-model="monthSaleGoalDetailsList[scope.$index].oneLevelClassify" placeholder="请输入一级分类" disabled></el-input>
                 </template>
               </el-table-column>
-              <el-table-column label="二级分类" align="center" width="220" :render-header="addRedStar">
+              <el-table-column label="二级分类" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
-                  <el-select v-model="monthSaleGoalDetailsList[scope.$index].twoLevelClassify" size="mini" clearable
-                             @focus="chooseTreeReferForDetails('MATERIALCLASSIFY_PARAM', false, '二级物料分类', scope.$index)"
-                             style="width: 200px">
-                    <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
-                  </el-select>
+                  <el-input v-model="monthSaleGoalDetailsList[scope.$index].twoLevelClassify" placeholder="请输入二级分类" disabled></el-input>
                 </template>
               </el-table-column>
-              <el-table-column label="物料" align="center" width="180">
+              <el-table-column label="物料" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="monthSaleGoalDetailsList[scope.$index].material" title="物料" valueKey="name"
                                         referName="MATERIAL_PARAM"
-                                        :dataMapping="{ materialCode: 'code', material: 'name'}"
+                                        @change="setClassify(scope.row.oneLevelClassify, scope.row.twoLevelClassify, monthSaleGoalDetailsList[scope.$index])"
+                                        :dataMapping="{ materialCode: 'code', material: 'name', oneLevelClassify: 'oneClass', twoLevelClassify: 'twoClass'}"
                                         :source.sync="monthSaleGoalDetailsList[scope.$index]" placeholder="请输入物料">
                   </el-popover-select-v2>
                 </template>
@@ -457,8 +467,60 @@
         <el-button @click="upload.open = false">取 消</el-button>
       </div>
     </el-dialog>
-
-    <TreeRefers ref="treeDetails" @doSubmit="selectionsToInputForDetails" :single="true"/>
+    <!-- 批量修改对话框-->
+    <el-dialog title="批量修改" width="30%" :visible.sync="dialogUpdateMore.dialogFormVisible" append-to-body @closed="resetDialogUpdateMore">
+      <el-form>
+        <el-form-item label="修改项" label-width="100px">
+          <el-select @change="changeDialogData" v-model="dialogUpdateMore.updateName" placeholder="请选择需要批量修改的字段">
+            <el-option v-for="item in dialogUpdateMore.optionList" :key="item.value" :label="item.label" :value="item.value"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="修改值" label-width="100px">
+          <el-popover-select-v2 v-if="dialogUpdateMore.updateName === 1"
+                                v-model="dialogUpdateMore.updateData" title="销售组织" valueKey="name"
+                                referName="ORG_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入销售组织">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 2"
+                                v-model="dialogUpdateMore.updateData" title="销售区域" valueKey="name"
+                                referName="MK_SALESAREA_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入销售区域">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 3"
+                                v-model="dialogUpdateMore.updateData" title="客户" valueKey="name"
+                                referName="CUSTOMER_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入客户">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 4"
+                                v-model="dialogUpdateMore.updateData" title="部门" valueKey="name"
+                                referName="DEPT_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入部门">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 5"
+                                v-model="dialogUpdateMore.updateData" title="制单人" valueKey="name"
+                                referName="CONTACTS_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入制单人">
+          </el-popover-select-v2>
+          <el-input v-else-if="dialogUpdateMore.updateName === 6"
+                    v-model="dialogUpdateMore.updateData" placeholder="请输入科室"
+          ></el-input>
+          <el-date-picker v-else-if="dialogUpdateMore.updateName === 7"
+            v-model="dialogUpdateMore.updateData" value-format="yyyy-MM"
+            type="month"
+            placeholder="选择月">
+          </el-date-picker>
+          <el-input v-else placeholder="请输入修改项" disabled></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="dialogUpdateMoreSave">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -603,9 +665,6 @@ export default {
         creator: [{ required: true, message: '制单人不能为空', trigger: 'blur' }],
         dept: [{ required: true, message: '部门不能为空', trigger: 'blur' }]
       },
-      // 参照条件
-      referCondition: { type: '', isPage: true, title: '', index: null },
-      classOptions: [],
       // 子表导航名
       activeName: 'monthSaleGoalDetails',
       // 用户导入参数
@@ -623,6 +682,12 @@ export default {
         // 上传的地址
         url: process.env.VUE_APP_BASE_API + "/goal_management/monthSaleGoal/importData"
       },
+      dialogUpdateMore: {
+        updateName: null,
+        dialogFormVisible: false,
+        updateData: null,
+        optionList:[{value: 1, label: '销售组织'}, {value: 2, label: '销售区域'}, {value: 3, label: '客户'}, {value: 4, label: '部门'}, {value: 5, label: '制单人'}, {value: 6, label: '科室'}, {value: 7, label: '月份'}]
+      }
     };
   },
   created() {
@@ -742,7 +807,7 @@ export default {
         material: null,
         department: null,
         num: null,
-        monthly: null,
+        monthly: new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2, '0'),
         goalValue: 0
       }
       this.monthSaleGoalDetailsList.push(list)
@@ -780,7 +845,7 @@ export default {
     /** 提交按钮 */
     submitForm() {
       if (!this.justiceDetailsList()) {
-        return this.$message.error('子表有必填字段未填')
+        return this.$message.error('子表有必填字段未填,或者目标值为0')
       }
       this.$refs["form"].validate(valid => {
         if (valid) {
@@ -887,36 +952,6 @@ export default {
       }
       this.form.goalSum = sum
     },
-    // 树形物料分类
-    chooseTreeReferForDetails(type, isPage, title, index) {
-      this.referCondition.type = type
-      this.referCondition.isPage = isPage
-      this.referCondition.title = title
-      this.referCondition.index = index
-      this.$refs.treeDetails.init(this.referCondition)
-    },
-    selectionsToInputForDetails(selection) {
-      this.classOptions.push(selection)
-      if (this.referCondition.title === '一级物料分类') {
-        if (selection.code.length !== 1) {
-          return this.$message.info('请在一级分类中选择')
-        }
-        if (selection.code !== this.monthSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode) {
-          this.monthSaleGoalDetailsList[this.referCondition.index].twoLevelClassifyCode = null
-          this.monthSaleGoalDetailsList[this.referCondition.index].twoLevelClassify = null
-        }
-        this.monthSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode = selection.code
-        this.monthSaleGoalDetailsList[this.referCondition.index].oneLevelClassify = selection.name
-      } else if (this.referCondition.title === '二级物料分类') {
-        if (selection.code.length !== 4) {
-          return this.$message.info('请在二级分类中选择')
-        } else if (selection.code[0] !== this.monthSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode) {
-          return this.$message.error('所选择的二级物料分类不属于一级分类')
-        }
-        this.monthSaleGoalDetailsList[this.referCondition.index].twoLevelClassifyCode = selection.code
-        this.monthSaleGoalDetailsList[this.referCondition.index].twoLevelClassify = selection.name
-      }
-    },
     // 子表table加必填标志
     addRedStar(h, { column }) {
       return [
@@ -927,20 +962,22 @@ export default {
     justiceDetailsList() {
       const arr = JSON.parse(JSON.stringify(this.monthSaleGoalDetailsList))
       for (const element of arr) {
-        if (element.saleOrg === null || element.saleZone === null || element.custom === null || element.dept === null || element.creator === null || element.oneLevelClassify === null || element.twoLevelClassify === null || element.monthly === null || element.goalValue === 0) {
-          return false
+        const flag1 = (element.saleOrg !== null) && (element.saleZone !== null) && (element.custom !== null) && (element.dept !== null) && (element.creator !== null) && (element.materialCode !== null) && (element.material !== null) && (element.monthly !== null) && (element.goalValue !== 0)
+        const flag2 = (element.saleOrg !== undefined) && (element.saleZone !== undefined) && (element.custom !== undefined) && (element.dept !== undefined) && (element.creator !== undefined) && (element.materialCode !== undefined) && (element.material !== undefined) && (element.monthly !== undefined)
+        if (flag1 && flag2) {
+          return true
         }
       }
-      return true
+      return false
     },
     setBeginAndEnd() {
       let array = this.documentDateRange
-      if (array !== null) {
+      if (this.documentDateRange !== null) {
         this.queryParams.params.beginTime = array[0]
         this.queryParams.params.endTime = array[1]
       } else {
-        this.queryParams.beginTime = null
-        this.queryParams.endTime = null
+        this.queryParams.params.beginTime = null
+        this.queryParams.params.endTime = null
       }
     },
     handleCommand(command) {
@@ -997,6 +1034,54 @@ export default {
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    // 选择物料后,给一级分类和二级分类复赋值
+    setClassify(one, two, obj) {
+      const oneArray = one.split("&")
+      const twoArray = two.split("&")
+      obj.oneLevelClassifyCode = oneArray[1]
+      obj.oneLevelClassify = oneArray[0]
+      obj.twoLevelClassifyCode = twoArray[1]
+      obj.twoLevelClassify = twoArray[0]
+    },
+    // 批量修改对话框的方法
+    dialogUpdateMoreSave() {
+      console.log(this.dialogUpdateMore);
+      if (this.dialogUpdateMore.updateData === null) {
+        return this.$message.error('请输入修改值')
+      }
+      const array = JSON.parse(JSON.stringify(this.monthSaleGoalDetailsList))
+      if (array.length !== 0) {
+        let condition = this.dialogUpdateMore.updateName
+        for (const element of array) {
+          if (condition === 1) {
+            element.saleOrg = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 2) {
+            element.saleZone = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 3) {
+            element.custom = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 4) {
+            element.dept = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 5) {
+            element.creator = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 6) {
+            element.department = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 7) {
+            element.monthly = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          }
+        }
+      }
+      this.monthSaleGoalDetailsList = array
+      this.dialogUpdateMore.dialogFormVisible = !this.dialogUpdateMore.dialogFormVisible
+      this.dialogUpdateMore.updateData = null
+      this.dialogUpdateMore.updateName = null
+    },
+    changeDialogData() {
+      this.dialogUpdateMore.updateData = null
+    },
+    resetDialogUpdateMore() {
+      this.dialogUpdateMore.updateName = null
+      this.dialogUpdateMore.updateData = null
     }
   }
 }

+ 129 - 0
src/views/material/basicFile/columns.js

@@ -0,0 +1,129 @@
+export const SearchColumns = [
+
+  {
+    item:{
+      key: "code",
+      title: "物料编码",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-popover-select-v2",
+      valueKey: "code",
+      referName: "MATERIAL_PARAM",
+    },
+  },
+  {
+    item:{
+      key: "name",
+      title: "物料名称",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-popover-select-v2",
+      valueKey: "name",
+      referName: "MATERIAL_PARAM",
+    },
+  },
+  {
+    item:{
+      key: "isEnable",
+      title: "启用状态",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "material_enable",
+    },
+  },
+  {
+    item:{
+      key: "isSync",
+      title: "是否同步NC",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "sys_number_yes_no",
+    },
+  },
+  {
+    item:{
+      key: "registrant",
+      title: "生产厂家/代理人",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-popover-select-v2",
+      valueKey: "name",
+      referName: "MANUFACTURER_PARAM",
+    },
+  },
+  {
+    item:{
+      key: "storageCondition",
+      title: "存储条件",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "sys_storage_condition",
+    },
+  },
+  {
+    item:{
+      key: "transportationCondition",
+      title: "运输条件",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "sys_conditions_carriage",
+    },
+  },
+  {
+    item:{
+      key: "isMedicine",
+      title: "是否医药物料",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "sys_number_yes_no",
+    },
+  },
+  {
+    item:{
+      key:'classifyAbc',
+      title:'ABC分类',
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "abc_type",
+    }
+  },
+];
+
+export const OtherDictColumns = [
+  {
+    item:{
+      key:"expiryUnitId",
+      title:'效期管理',
+    },
+    attr:{
+      is: "el-select",
+      dictName: "period_unit",
+    }
+  },
+  {
+    item:{
+      key:'usefulLifeUnitId',
+      title:'有效期至单位',
+    },
+    attr:{
+      is: "el-select",
+      dictName: "expiry_date",
+    }
+  },
+  
+]

+ 1 - 1
src/views/material/basicFile/details.vue

@@ -114,7 +114,7 @@
 
     </div>
     
-      <div class="md-content">
+      <div class="md-content" :key="basicData.value.id">
         <el-form :inline="true" label-position="right" :model="basicData.value">
           <!-- <el-form-item label="所属组织"></el-form-item> -->
           <el-form-item label="物料编码">

+ 80 - 17
src/views/material/basicFile/index.vue

@@ -6,10 +6,18 @@
     <!-- 主体列表 -->
     <el-card class="material-list" v-loading="loading">
 
-      <!-- 操作栏 -->
+      
     <div style="margin: 0 0 10px 0;">
       <!-- 查询条件 -->
-      <el-row :gutter="10">
+      <el-super-search
+        v-model="params"
+        :size="size"
+        :dict="dict"
+        :columns="SearchColumns"
+        @reset="handleResetQuery"
+        @submit="handleQuery"
+      ></el-super-search>
+      <!-- <el-row :gutter="10">
         <el-col :span="1.5">
           <el-form :inline="true" :model="queryForm" class="mb-query" @submit.native.prevent>
             <el-form-item label="物料编码">
@@ -19,14 +27,12 @@
               <el-input size="small" v-model="queryForm.name" placeholder="物料名称" clearable></el-input>
             </el-form-item>
             <el-form-item label="启用状态">
-              <!-- 0=已启用,2=已停用 -->
               <el-select size="small" v-model="queryForm.isEnable" placeholder="请选择" clearable>
                 <el-option key="0" label="已启用" value="0"></el-option>
                 <el-option key="2" label="已停用" value="2"></el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="是否同步NC">
-              <!-- 是否同步;2=否,0=是 -->
               <el-select size="small" v-model="queryForm.isSync" placeholder="请选择" clearable>
                 <el-option key="0" label="是" value="0"></el-option>
                 <el-option key="2" label="否" value="2"></el-option>
@@ -40,8 +46,9 @@
           </el-form>
         </el-col>
 
-      </el-row>
+      </el-row> -->
     </div>
+    <!-- 操作栏 -->
       <el-row 
         :gutter="10" 
         class="mb10"
@@ -101,9 +108,11 @@
       </el-row>
 
       <el-table 
+        v-if="tableHeader.length"
         border 
         :data="taskList" 
         ref="materialTable" 
+        max-height="550"
         @cell-dblclick="handledbClick" 
         :row-key="getRowKey"
         @selection-change="handleSelectionChange" 
@@ -111,7 +120,7 @@
         @select-all="handleSelectAll"
       >
         <!--  -->
-        <el-table-column type="selection" width="45" :reserve-selection="true"/>
+        <el-table-column type="selection" width="45" :reserve-selection="true" fixed/>
         <el-table-column type="index" label="序号" width="55" align="center"/>
         <el-table-column 
           width="150" 
@@ -120,13 +129,27 @@
           align="center"
           show-overflow-tooltip
         >
-          <!-- :prop="h.attribute == 'select' ? `${h.prop}Name` : h.prop" -->
           <template slot-scope="scope">
-            {{ h.attribute == 'select' ? scope.row[`${h.prop}Name`] :
+            <span v-if="h.apiUrl">{{scope.row[`${h.prop}Name`]}}</span>
+            <el-checkbox 
+              v-else-if="h.attribute == 'checkbox'"
+              v-model="scope.row[h.prop]"
+              disabled
+              true-label="0" 
+              false-label="2"
+            ></el-checkbox>
+            <el-dict-tag
+              v-else-if="h.dictId"
+              :value="scope.row[h.prop]"
+              :options="dict.type[h.dictId]"
+            ></el-dict-tag>
+
+            <span v-else>{{ scope.row[h.prop] || '--' }}</span>
+            <!-- {{ h.attribute == 'select' ? scope.row[`${h.prop}Name`] :
             (h.attribute == 'checkbox' ?
             (scope.row[h.prop] == '0' ? '√' : '')
             : scope.row[h.prop])
-            }}
+            }} -->
           </template>
         </el-table-column>
       </el-table>
@@ -174,12 +197,24 @@
 <script>
   import './style/index.scss';
   import materialApi from '@/api/material/basic';
+  import { SearchColumns,OtherDictColumns } from './columns';
+  import { initDicts } from "@/utils/init.js";
 
   export default {
     name: "material-basic",
+    dicts:[...initDicts([...SearchColumns,...OtherDictColumns])],
+    // dicts:[],
+    components: {
+      ElSuperSearch: () => import("@/components/super-search/index.vue"),
+      ElDictTag: () => import("@/components/DictTag/index.vue"),
+    },
     data() {
+      const params = this.$init.params(SearchColumns);
       return {
         failLoad: false,
+        params:params,
+        SearchColumns:SearchColumns,
+        size:'mini',
         // 物料基本信息数据
         taskList: [],
         // 查询表单字段
@@ -289,17 +324,25 @@
       },
       // 重置查询条件
       handleResetQuery() {
-        for (const key in this.queryForm) {
+        // for (const key in this.queryForm) {
 
-          this.queryForm[key] = '';
-        }
+        //   this.queryForm[key] = '';
+        // }
+
+        this.queryParams.pageNum = 1;
+      
+        this.queryParams.pageSize = 10;
+
+        this.params = this.$init.params(SearchColumns);
+
+        this.handleQuery();
       },
       // 刷新
       handleRefresh() {
         this.getMaterialList('material');
-        for (const key in this.queryForm) {
-          this.queryForm[key] = '';
-        }
+        // for (const key in this.queryForm) {
+        //   this.queryForm[key] = '';
+        // }
       },
       // 过滤
       handleFilter(e) {
@@ -495,6 +538,7 @@
       },
       // 获取物料列表信息
       getMaterialList(templateCode, query) {
+        // (params, page)
         let _this = this;
         this.loading = true;
         let page = {
@@ -504,7 +548,8 @@
 
         let param = {
           templateCode,
-          ...this.queryForm
+          ...this.params
+          // ...this.queryForm
         }
         // console.log(param, 'param');
         materialApi.materialList(param, page).then((res) => {
@@ -523,6 +568,24 @@
         materialApi.tagList({templateCode}).then(res => {
           console.log(res, '获取物料列表表头');
           if (res.code == 200) {
+
+            // let dictList = []
+            // res.data.forEach(item =>{
+            //   if(item.dictId){
+            //     // 字典
+            //     dictList.push({
+            //       item:{...item},
+            //       attr:{
+            //         dictName:item.dictId
+            //       }
+            //     });
+                
+            //   }
+            // })
+            // console.log(dictList,'dictList');
+            // console.log(this,'this');
+            // this.dict =[...initDicts([...SearchColumns,...dictList])]
+
             this.tableHeader = res.data;
           }
         })
@@ -565,7 +628,7 @@
 
 <style lang="scss">
   .material-list {
-    height: calc(100vh - 70px);
+    // height: calc(100vh - 70px);
 
 
     .el-card__body {

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

@@ -595,7 +595,7 @@ export default {
         // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
         // var name = fileName.split(";")[0]; //切割成文件名
         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); // 下载完成移除元素

+ 20 - 16
src/views/purchase/MaterialClassDivision/add.vue

@@ -6,7 +6,7 @@
       <el-row :gutter="10">
         <el-col :span="1.5">
             <el-form-item label="物料分类编码">
-              <el-input :disabled="disable"  size="mini" style="width: 200px" readonly v-model="basicForm.materialClassify">
+              <el-input :disabled="sonDisable"  size="mini" style="width: 200px" readonly v-model="basicForm.materialClassify">
                 <el-button slot="append" icon="el-icon-more" @click="chooseFourClass"></el-button>
               </el-input>
             </el-form-item>
@@ -86,7 +86,7 @@
 
           <el-col :span="1.5">
             <el-form-item label="物料编码">
-              <el-input :disabled="disable" style="width: 200px" size="mini" readonly v-model="basicForm.materialCode">
+              <el-input :disabled="sonDisable" style="width: 200px" size="mini" readonly v-model="basicForm.materialCode">
                   <el-button slot="append" icon="el-icon-more" @click="test01"></el-button>
               </el-input>
               <el-input v-show="false" style="width: 200px" size="mini" v-model="basicForm.material"></el-input>
@@ -110,7 +110,7 @@
               <el-input
                 v-model="basicForm.manufacturer"
                 size="mini"
-                :disabled="disable"
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -124,7 +124,7 @@
                     v-model="basicForm.org"
                     size="mini"
                     style="width: 200px"
-                    :disabled="disable"
+                    :disabled="sonDisable"
                     clearable
                     @focus="chooseRefer('ORG_PARAM', true, '选择所属组织')"
                   >
@@ -144,7 +144,7 @@
                   ref="staffs"
                   size="mini"
                   style="width: 200px"
-                  :disabled="disable"
+                  :disabled="sonDisable"
                   v-model="basicForm.orderPersonal"
                   clearable
                   @clear="clean('订单员')"
@@ -177,7 +177,7 @@
                   ref="staffs2"
                   size="mini"
                   style="width: 200px"
-                  :disabled="disable"
+                  :disabled="sonDisable"
                   v-model="basicForm.buyer"
                   clearable
                   @clear="clean('采购员')"
@@ -222,7 +222,7 @@
               <el-input
                 v-model="basicForm.remark"
                 size="mini"
-                :disabled="disable"
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -232,15 +232,12 @@
     </el-form>
 
     <div class="btn_group">
-      <el-col :span="1.5" style="margin: 0 10px;">
-        <el-button type="primary" size="mini" plain @click="save" v-if="pageStu == 'add' || pageStu == 'edit'">保存</el-button>
-      </el-col>
+      <el-button type="primary" size="mini"  @click="editPage" v-if="sonPageStu == 'check'">编辑</el-button>
+        <el-button type="primary" size="mini" plain @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
       <!-- <el-col :span="1.5" style="margin: 0 10px;">
-        <el-button type="primary" size="mini" plain @click="submit" v-if="pageStu == 'edit'">提交</el-button>
+        <el-button type="primary" size="mini" plain @click="submit" v-if="sonPageStu == 'edit'">提交</el-button>
       </el-col> -->
-      <el-col :span="1.5">
         <el-button size="mini" plain @click="back">返回</el-button>
-      </el-col>
     </div>
     </el-card>
     <fourClass
@@ -287,6 +284,9 @@ export default {
   },
   data() {
     return {
+      // 不能直接改变props传来的值
+      sonPageStu: this.pageStu,
+      sonDisable: this.disable,
       basicForm: {
         materialClassify: '',
         materialClassifyName: '',
@@ -338,7 +338,7 @@ export default {
   },
   methods: {
     save() {
-      if(this.pageStu == 'add') {
+      if(this.sonPageStu == 'add') {
         this.$modal.loading("保存中...");
         addDivision(this.basicForm).then(res => {
           if (res.code === 200) {
@@ -349,7 +349,7 @@ export default {
         }).catch(err => {
           this.$modal.closeLoading();
         })
-      } else if(this.pageStu == 'edit') {
+      } else if(this.sonPageStu == 'edit') {
         this.$modal.loading("保存中...");
         editDivision(this.basicForm).then(res => {
           this.$modal.notifySuccess("编辑成功");
@@ -360,6 +360,10 @@ export default {
         })
       }
     },
+    editPage() {
+      this.sonPageStu = 'edit'
+      this.sonDisable = false
+    },
     submit() {},
     back() {
       this.$emit('jugislist', true)
@@ -475,7 +479,7 @@ export default {
   // width: 100%;
   // margin: 20px 0;
   display: flex;
-  // justify-content: center;
+  justify-content: space-between;
   position: absolute;
   top: 10px;right: 20px;
 } 

+ 231 - 386
src/views/purchase/PurchaseDemandList/add.vue

@@ -168,8 +168,7 @@
 
       <el-table
           v-loading="loading"
-          v-myscroll
-          :data="basicForm.puDemandItemList.slice(0, over)"
+          :data="basicForm.puDemandItemList"
           fit
           border
           highlight-current-row
@@ -182,12 +181,15 @@
           @selection-change="handleSelectionChange"
           :cell-class-name="cellClassName"
           :row-key="getRowKeys"
+          ref="table"
+          v-el-table-infinite-scroll="load"
+          :infinite-scroll-disabled="loadDisabled"
         >
           <el-table-column show-overflow-tooltip type="selection" :reserve-selection="true"/>
           <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px"/>
           <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo">
             <template slot-scope="scope">
-              {{ scope.$index + 1 + '0' }}
+              {{ scope.row.rowNo = scope.$index + 1 + "0" }}
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip label="默认采购组织" align="center"  prop="purOrgName" width="200px"/>
@@ -211,7 +213,7 @@
           <el-table-column show-overflow-tooltip label="实际(业务)需求量" align="center"  prop="qty" width="150px" :render-header="addRedStar">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'qty'" :show-message="false" :rules="{ required: true, message: '请填写实际(业务)需求量', trigger: 'blur' }">
-                <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.qty" @input="getYLSL(scope)"/>
+                <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.qty" @input="getYLSL(scope)" @paste.native="pasteMe($event, scope, scope.$index)"/>
               </el-form-item>
             </template>
           </el-table-column>
@@ -421,8 +423,9 @@
       </el-table>
     </el-form>
       <div class="btn_group">
-        <el-button type="primary" size="mini"  @click="jumpOA" v-if="sonPageStu == 'check' && (row.status == '1' || row.status == '2')">审批</el-button>
+        <el-button type="primary" size="mini"  @click="jumpOA" v-if="sonPageStu == 'check' && (row.status == '1' || row.status == '2') && basicForm.flowId">审批</el-button>
         <el-button type="primary" size="mini"  @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
+        <el-button type="primary" size="mini"  @click="editPage" v-if="sonPageStu == 'check'">编辑</el-button>
         <el-button type="primary" size="mini"  @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
         <el-button type="primary" size="mini"  @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
         <el-button size="mini" plain @click="back">返回</el-button>
@@ -525,7 +528,11 @@ import {addDemand,getDemandDetail, getDemandSonDetail, editDemand, submitDemand,
 import {getRefer} from '@/api/purchase/basic.js'
 // 明细行选择物料参照
 import popDialog from '@/components/PopDialog/index.vue'
+import ElTableInfiniteScroll from "el-table-infinite-scroll";
 export default {
+  directives: {
+    "el-table-infinite-scroll": ElTableInfiniteScroll,
+  },
   name: 'addDemandList',
   props: ['pageStu','row', 'disable'],
   dicts: ['sys_processing_mode', 'sys_plan_type', 'sys_status', 'sys_bill_source', 'sys_business','sys_reserve_ratio', 'sys_period_unit', 'sys_price_type'],
@@ -624,7 +631,118 @@ export default {
         contactsPhone: '',
         address: ''
       },
-      purchaseManOptions: []
+      purchaseManOptions: [],
+      sonModel: {
+        rowNo: null,
+        contacts: null,
+        id: null,
+        demandId: null,
+        status: 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,
+        puFreight: null,
+        deliveryDate: null,
+        isUrgency: 'N',
+        isReplenishment: 'N',
+        isBatchLock: 'N',
+        isCustomerSpecified: '',
+        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: null,
+        demandCustomerName: 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,
+      },
+      // 无限滚动配置
+      loadDisabled: true,
+      page: 0,
+      total: 5,
     }
   },
   created() {
@@ -642,6 +760,17 @@ export default {
     }
   },
   methods: {
+    // 无限滚动加载配置
+    load() {
+      if (this.loadDisabled) return;
+      this.page++;
+      if (this.page <= this.total) {
+        this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.concat(this.basicForm.puDemandItemList);
+      }
+      if (this.page === this.total) {
+        this.loadDisabled = true;
+      }  
+    },
     // 改变单据日期时清空子表的调拨日期
     changeDemandDate() {
       this.basicForm.puDemandItemList.forEach(item => {
@@ -759,6 +888,10 @@ export default {
         item.statusAllot = 'N'
       })
     },
+    editPage() {
+      this.sonPageStu = 'edit'
+      this.sonDisable = false
+    },
     handleData() {
       console.log('222')
       // 复制新增把id,编码,创建人置为空,子表去掉id
@@ -843,116 +976,11 @@ export default {
     },
     // 增行
     addLine() {
-      const newLine = {
-        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,
-        puFreight: null,
-        deliveryDate: null,
-        isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
-        isReplenishment: this.basicForm.billType == 'BDXQ'? 'Y': 'N',
-        isBatchLock: 'N',
-        isCustomerSpecified: '',
-        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,
-      }
+      const newLine = {...this.sonModel}
+      newLine.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
+      newLine.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
+      newLine.demandCustomer = this.basicForm.customer
+      newLine.demandCustomerName = this.basicForm.customerName
       this.basicForm.puDemandItemList.push(newLine)
       // 补单需求状态改变
       if (this.basicForm.billType == 'BDXQ') {
@@ -1169,174 +1197,100 @@ export default {
       e.preventDefault() //阻止默认粘贴事件
       let source = e.clipboardData.getData("Text");
       console.log('scope', scope.column.property)
-      console.log('eee:', source)
       // 首先对源头进行解析
       let rows = source.split("\r\n"); // 拆成一个数组
       // 数组去除空字符串
       rows = rows.filter(item => {
         return item && item.trim()
       })
-      console.log('复制的数组',rows);
-      console.log('列表的数组',this.basicForm.puDemandItemList)
-      if (rows.length < 1000) {
-        await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
-          if (res.code === 200) {
-            let rowList = res.rows
-            let newLine = []
-            for (let i = 0; i<rowList.length; i++) {
-            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,
-              puFreight: null,
-              deliveryDate: null,
-              isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
-              isReplenishment: this.basicForm.billType == 'BDXQ' ? 'Y' : 'N',
-              isBatchLock: 'N',
-              isCustomerSpecified: '',
-              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,
+
+      if (rows.length < 100) {
+
+        if(scope.column.property == 'materialCode') {
+          await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
+            this.$modal.closeLoading();
+            if (res.code === 200) {
+              let rowList = res.rows
+              let newLine = []
+              for (let i = 0; i<rowList.length; i++) {
+                let line = {...this.sonModel}
+                line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
+                line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
+                line.demandCustomer = this.basicForm.customer
+                line.demandCustomerName = this.basicForm.customerName
+                line.materialCode = rowList[i].code
+                line.material = rowList[i].id
+                line.materialName = rowList[i].name
+                line.classifyId = rowList[i].classifyId
+                line.materialClassifyOneName = rowList[i].oneClass
+                line.materialClassifyTwoName = rowList[i].twoClass
+                line.materialClassifyThreeName = rowList[i].threeClass
+                line.materialClassifyFourName = rowList[i].fourClass
+                line.specification = rowList[i].specification
+                line.model = rowList[i].model
+                line.unit = rowList[i].unitId
+                line.unitName = rowList[i].unitIdName
+                line.registrant = rowList[i].registrant
+                line.manufacturerName = rowList[i].manufacturerIdName
+                line.puPeriod = rowList[i].deliveryPeriod
+                line.expiry = rowList[i].usefulLife
+                line.expiryUnit = rowList[i].expiryUnitIdName
+                // line.minPackage = rowList[i].usefulLife
+                line.minPackage = rowList[i].minPackQty
+                line.minOrderQty = rowList[i].minOrderQty
+                line.minBatch = rowList[i].minBatchQty
+                line.safeStock = rowList[i].safeStock
+                line.purOrgName = rowList[i].purchasingOrganizationName
+                line.puOrg = rowList[i].purchasingOrganization
+                // 物料存储条件和运输条件
+                line.transportationCondition = rowList[i].transportationCondition
+                line.storageCondition = rowList[i].storageCondition
+                newLine.push(line)
+                console.log('临时数组', newLine)
+              }
+              // 删除指定下标
+              this.basicForm.puDemandItemList.splice(index,this.basicForm.puDemandItemList.length - index,...newLine)
+              this.$modal.notifySuccess("共粘贴" + rowList.length + '条数据');
             }
-              line.businessDept = rowList[i].businessDepartment
-              line.businessDeptName = rowList[i].businessDepartmentName
-              line.materialCode = rowList[i].code
-              line.material = rowList[i].id
-              line.materialName = rowList[i].name
-              line.classifyId = rowList[i].classifyId
-              line.materialClassifyOneName = rowList[i].oneClass
-              line.materialClassifyTwoName = rowList[i].twoClass
-              line.materialClassifyThreeName = rowList[i].threeClass
-              line.materialClassifyFourName = rowList[i].fourClass
-              line.specification = rowList[i].specification
-              line.model = rowList[i].model
-              line.unit = rowList[i].unitId
-              line.unitName = rowList[i].unitIdName
-              line.registrant = rowList[i].registrant
-              line.manufacturerName = rowList[i].manufacturerIdName
-              line.puPeriod = rowList[i].deliveryPeriod
-              line.expiry = rowList[i].usefulLife
-              line.expiryUnit = rowList[i].expiryUnitIdName
-              // line.minPackage = rowList[i].usefulLife
-              line.minPackage = rowList[i].minPackQty
-              line.minOrderQty = rowList[i].minOrderQty
-              line.minBatch = rowList[i].minBatchQty
-              line.safeStock = rowList[i].safeStock
-              line.purOrgName = rowList[i].purchasingOrganizationName
-              line.puOrg = rowList[i].purchasingOrganization
-              // 物料存储条件和运输条件
-              line.transportationCondition = rowList[i].transportationCondition
-              line.storageCondition = rowList[i].storageCondition
+          }).then(() => {
+            this.$refs.table.doLayout()
+          }).catch(err => {
+            this.$modal.closeLoading();
+          })
+
+        }else if(scope.column.property == 'qty') {
+          console.log('复制内容:', rows)
+          let newLine = []
+          if(this.basicForm.puDemandItemList.length <= 1) {
+            for (let i = 0; i<rows.length; i++) {
+              let line = {...this.sonModel}
+              line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
+              line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
+              line.demandCustomer = this.basicForm.customer
+              line.demandCustomerName = this.basicForm.customerName
+              line.qty = rows[i]
               newLine.push(line)
-              console.log('临时数组', newLine)
             }
             // 删除指定下标
-            this.basicForm.puDemandItemList.splice(index,1,...newLine)
-            this.$modal.notifySuccess("共粘贴" + rowList.length + '条数据');
+            this.basicForm.puDemandItemList.splice(index,this.basicForm.puDemandItemList.length - index,...newLine)
+            this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
+            this.$refs.table.doLayout()
+            this.$modal.closeLoading();
+          } else {
+            this.basicForm.puDemandItemList.forEach(item => {
+              for (let i = 0; i<rows.length; i++) {
+                item.qty = rows[i]
+              }
+            })
+            this.$refs.table.doLayout()
+            this.$modal.closeLoading();
           }
-        }).catch(err => {
-          this.$modal.closeLoading();
-        })
-        this.$modal.closeLoading();
-      console.log('列表', this.basicForm.puDemandItemList)
+        }
+
+
       } else {
-        this.$modal.notifyWarning("复制长度不能超过1000!");
+        this.$modal.notifyWarning("复制长度不能超过100!");
+        this.$modal.closeLoading();
       }
     },
     // 明细行选择物料编码带出数据
@@ -1389,8 +1343,6 @@ export default {
           this.basicForm.puDemandItemList[this.tableIndex].buyerName = res.rows[0].buyerName
         }
       })
-      this.basicForm.puDemandItemList[this.tableIndex].businessDept = selection[0].businessDepartment
-      this.basicForm.puDemandItemList[this.tableIndex].businessDeptName = selection[0].businessDepartmentName
       this.basicForm.puDemandItemList[this.tableIndex].materialCode = selection[0].code
       this.basicForm.puDemandItemList[this.tableIndex].material = selection[0].id
       this.basicForm.puDemandItemList[this.tableIndex].materialName = selection[0].name
@@ -1423,116 +1375,11 @@ export default {
         console.log('xxxxx', selection)
         let newLine = []
         for (let i = 0;i<selection.length;i++) {
-          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,
-            puFreight: null,
-            deliveryDate: null,
-            isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
-            isReplenishment: this.basicForm.billType == 'BDXQ' ? 'Y' : 'N',
-            isBatchLock: 'N',
-            isCustomerSpecified: '',
-            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,
-          }
+          let line = {...this.sonModel}
+          line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
+          line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
+          line.demandCustomer = this.basicForm.customer
+          line.demandCustomerName = this.basicForm.customerName
                 // 通过选择物料查询采购员
           queryMan(selection[i].id).then(res => {
             if (res.code === 200 && res.rows.length !== 0) {
@@ -1540,8 +1387,6 @@ export default {
               line.buyerName = res.rows[0].buyerName
             }
           })
-          line.businessDept = selection[i].businessDepartment
-          line.businessDeptName = selection[i].businessDepartmentName
           line.materialCode = selection[i].code
           line.material = selection[i].id
           line.materialName = selection[i].name

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

@@ -186,7 +186,6 @@
           <!-- <el-table-column show-overflow-tooltip label="供应仓库" align="center" width="120" prop="warehouseName" /> -->
           <!-- <el-table-column show-overflow-tooltip label="供应货位" align="center" width="150" prop="goodsAllocationName" /> -->
           <el-table-column show-overflow-tooltip label="单据来源" align="center" prop="source" width="120" :formatter="formatterSource"/>
-          <el-table-column show-overflow-tooltip label="组织" align="center" width="200" prop="orgName"/>
           <el-table-column show-overflow-tooltip label="备注" align="center" width="150" prop="remark" />
           <el-table-column
           fixed="right"

+ 20 - 16
src/views/purchase/deliveryAddress/add.vue

@@ -30,7 +30,7 @@
 
         <el-col :span="1.5">
             <el-form-item label="仓库档案名称">
-              <el-select size="mini" v-model="basicForm.warehouse" :disabled="disable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '仓库档案名称')" style="width: 200px">
+              <el-select size="mini" v-model="basicForm.warehouse" :disabled="sonDisable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '仓库档案名称')" style="width: 200px">
                 <el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -38,7 +38,7 @@
 
          <el-col :span="1.5">
           <el-form-item label="仓库属性">
-              <el-select :disabled="disable" v-model="basicForm.warehouseProperty" size="mini" style="width: 200px">
+              <el-select :disabled="sonDisable" v-model="basicForm.warehouseProperty" size="mini" style="width: 200px">
                 <el-option v-for="dict in dict.type.sys_warehouse_attribute" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
@@ -50,7 +50,7 @@
               <el-input
                 v-model="basicForm.address"
                 size="mini"
-                :disabled="disable"
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -59,7 +59,7 @@
 
           <el-col :span="1.5">
             <el-form-item label="联系人">
-              <el-select size="mini" v-model="basicForm.contacts" :disabled="disable" @focus="chooseRefer('CONTACTS_PARAM', true, '联系人')" style="width: 200px">
+              <el-select size="mini" v-model="basicForm.contacts" :disabled="sonDisable" @focus="chooseRefer('CONTACTS_PARAM', true, '联系人')" style="width: 200px">
                 <el-option v-for="item in contactsOptions" :key="item.id" :label="item.name" :value="item.code" />
               </el-select>
             </el-form-item>
@@ -70,7 +70,7 @@
               <el-input
                 v-model="basicForm.contactsPhone"
                 size="mini"
-                :disabled="disable"
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -82,7 +82,7 @@
               <el-select
                 v-model="basicForm.materialClassify"
                 size="mini"
-                :disabled="disable"
+                :disabled="sonDisable"
                 clearable
                 @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '物料分类')"
                 style="width: 200px"
@@ -123,7 +123,7 @@
               <el-input
                 v-model="basicForm.remark"
                 size="mini"
-                :disabled="disable"
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -134,15 +134,12 @@
     </el-form>
 
     <div class="btn_group">
-      <el-col :span="1.5" style="margin: 0 10px;">
-        <el-button type="primary" size="mini" plain @click="save" v-if="pageStu == 'add' || pageStu == 'edit'">保存</el-button>
-      </el-col>
+      <el-button type="primary" size="mini"  @click="editPage" v-if="sonPageStu == 'check'">编辑</el-button>
+        <el-button type="primary" size="mini" plain @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
       <!-- <el-col :span="1.5" style="margin: 0 10px;">
-        <el-button type="primary" size="mini" plain @click="submit" v-if="pageStu == 'edit'">提交</el-button>
+        <el-button type="primary" size="mini" plain @click="submit" v-if="sonPageStu == 'edit'">提交</el-button>
       </el-col> -->
-      <el-col :span="1.5">
         <el-button size="mini" plain @click="back">返回</el-button>
-      </el-col>
     </div>
     </el-card>
 
@@ -172,6 +169,9 @@ export default {
   },
   data() {
     return {
+      // 不能直接改变props传来的值
+      sonPageStu: this.pageStu,
+      sonDisable: this.disable,
       basicForm: {
         code: '',
         name: '',
@@ -219,7 +219,7 @@ export default {
   },
   methods: {
     save() {
-      if(this.pageStu == 'add') {
+      if(this.sonPageStu == 'add') {
         this.$modal.loading("保存中...");
         addAddress(this.basicForm).then(res => {
           if (res.code === 200) {
@@ -230,7 +230,7 @@ export default {
         }).catch(err => {
           this.$modal.closeLoading();
         })
-      } else if (this.pageStu == 'edit') {
+      } else if (this.sonPageStu == 'edit') {
         this.$modal.loading("保存中...");
         editAddress(this.basicForm).then(res => {
           if (res.code === 200) {
@@ -243,6 +243,10 @@ export default {
         })
       }
     },
+    editPage() {
+      this.sonPageStu = 'edit'
+      this.sonDisable = false
+    },
     submit() {},
     back() {
       this.$emit('jugislist', true)
@@ -316,7 +320,7 @@ export default {
   // width: 100%;
   // margin: 20px 0;
   display: flex;
-  // justify-content: center;
+  justify-content: space-between;
   position: absolute;
   top: 10px;right: 20px;
 } 

+ 1 - 1
src/views/purchase/task/columns.js

@@ -203,7 +203,7 @@ export default function useColumns() {
     {
       item: {
         key: "documentsCodes",
-        title: "需求来源",
+        title: "采购需求单号",
         span: 12,
       },
       attr: {

+ 30 - 8
src/views/purchase/transferOrder/add.vue

@@ -161,7 +161,7 @@
 
           <el-col :span="1.5">
             <el-form-item label="总数量">
-              <el-input clearable :disabled="sonDisable" v-model="basicForm.qty" type="number" min="0" size="mini" style="width: 200px"/>
+              <el-input disabled v-model="basicForm.qty" type="number" min="0" size="mini" style="width: 200px"/>
             </el-form-item>
           </el-col>
 
@@ -1349,6 +1349,14 @@
           >复制</el-button
         >
         <el-button
+          type="primary"
+          size="mini"
+          plain
+          @click="editPage"
+          v-if="sonPageStu == 'check'"
+          >编辑</el-button
+        >
+        <el-button
           type="danger"
           size="mini"
           plain
@@ -1449,6 +1457,7 @@ export default {
         currencyName: "",
         rate: 1,
         onRouteAffilliation: "",
+        oaId: '',
         qty: "",
         accountPath: "",
         customer: "",
@@ -1574,12 +1583,22 @@ export default {
         item.storageAllocationName = null;
       });
     },
-    // 输入数量或者主数量同步改变
+    // 输入数量或者主数量同步改变,计算基本信息总数量
     getZSL(scope) {
       scope.row.qty = scope.row.mainQty;
+      let sum = 0
+      this.materialInfo.forEach(item => {
+        sum += Number(item.qty)
+        this.basicForm.qty = sum
+      })
     },
     getSL(scope) {
       scope.row.mainQty = scope.row.qty;
+      let sum = 0
+      this.materialInfo.forEach(item => {
+        sum += Number(item.qty)
+        this.basicForm.qty = sum
+      })
     },
     copy() {
       // await this.getDetails(this.row)
@@ -1632,6 +1651,10 @@ export default {
       this.isDRCk = false;
       this.isDCCk = false;
     },
+    editPage() {
+      this.sonPageStu = 'edit'
+      this.sonDisable = false
+    },
     toNC() {
       againToNC(this.row)
         .then((res) => {
@@ -1879,11 +1902,11 @@ export default {
       }
     },
 
-    chooseRefer(type, isPage, title, pkOrg, isDirectStore, gubFlag) {
+    chooseRefer(type, isPage, title, drpOrg, isDirectStore, gubFlag) {
       this.referCondition.type = type;
       this.referCondition.isPage = isPage;
       this.referCondition.title = title;
-      this.referCondition.pkOrg = pkOrg;
+      this.referCondition.drpOrg = drpOrg;
       this.referCondition.isDirectStore = isDirectStore;
       this.referCondition.gubFlag = gubFlag;
       this.$refs.refer.init(this.referCondition);
@@ -2082,18 +2105,17 @@ export default {
       this.referCondition.type = type;
       this.referCondition.isPage = isPage;
       this.referCondition.title = title;
-      this.referCondition.pkOrg = "";
+      this.referCondition.drpOrg = "";
       this.referCondition.stordocId = stordocId;
       this.$refs.refer.init(this.referCondition);
     },
     // 明细行选择调入部门
-    chooseMxBM(index, type, isPage, title, pkOrg) {
+    chooseMxBM(index, type, isPage, title, drpOrg) {
       this.tableIndex = index;
       this.referCondition.type = type;
       this.referCondition.isPage = isPage;
       this.referCondition.title = title;
-      this.referCondition.pkOrg = pkOrg;
-      this.referCondition.drpOrg = pkOrg;
+      this.referCondition.drpOrg = drpOrg;
       this.$refs.refer.init(this.referCondition);
     },
     // 选择框彻底清空

+ 2 - 2
vue.config.js

@@ -37,7 +37,7 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // target: `http://172.16.100.107:8080/drp-admin`, //测试
-      //  target: `http://test-sy.derom.com/drp-admin`, //测试
+       target: `http://test-sy.derom.com/drp-admin`, //测试
         // target: `http://release-sy.derom.com/drp-admin`, //预发
         // target: `http://sy.derom.com/drp-admin`, //生产
         // target: `http://172.16.63.202:8000/drp-admin`, // D本地
@@ -47,7 +47,7 @@ module.exports = {
         // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
         // target: `http://172.16.13.21:8000/drp-admin`, //CKF本地
         // target: `http://172.16.13.43:8000/drp-admin`, //lz's localhost
-         target: `http://127.0.0.1:8000/drp-admin`,
+        //  target: `http://127.0.0.1:8000/drp-admin`,
         changeOrigin: true,
         pathRewrite: {
           ["^" + process.env.VUE_APP_BASE_API]: "",