Ver Fonte

lizhuo merges Goal Management into dev at 2023-8-7 17:00

002637 há 1 ano atrás
pai
commit
a1d2fd4916

+ 18 - 50
src/views/business/spd/goal_management/AnnualSaleGoal.vue

@@ -312,7 +312,7 @@
         </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">
@@ -350,29 +350,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>
@@ -497,8 +490,6 @@
         <el-button @click="upload.open = false">取 消</el-button>
       </div>
     </el-dialog>
-
-    <TreeRefers ref="treeDetails" @doSubmit="selectionsToInputForDetails" :single="true"/>
   </div>
 </template>
 
@@ -652,9 +643,6 @@ export default {
         creator: [{required: true, message: '制单人不能为空', trigger: 'blur'}],
         dept: [{required: true, message: '部门不能为空', trigger: 'blur'}]
       },
-      // 参照条件
-      referCondition: {type: '', isPage: true, title: '', index: null},
-      classOptions: [],
       // 子表数组
       annualSaleGoalDetailsList: [],
       // 用户导入参数
@@ -963,36 +951,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 [
@@ -1066,6 +1024,16 @@ 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);
     }
   }
 };

+ 5 - 5
src/views/business/spd/goal_management/AnnualSaleGoalMerge.vue

@@ -342,7 +342,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">
@@ -466,7 +466,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">
@@ -563,7 +563,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">
@@ -1418,8 +1418,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) {

+ 5 - 5
src/views/business/spd/goal_management/MonthGoalMerge.vue

@@ -375,7 +375,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">
@@ -468,7 +468,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">
@@ -502,7 +502,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">
@@ -1275,8 +1275,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) {

+ 3 - 3
src/views/business/spd/goal_management/MonthReturnGoal.vue

@@ -317,7 +317,7 @@
         </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">
@@ -840,8 +840,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添加必填项

+ 4 - 4
src/views/business/spd/goal_management/MonthReturnMerge.vue

@@ -332,7 +332,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">
@@ -393,7 +393,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">
@@ -926,8 +926,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() {

+ 20 - 53
src/views/business/spd/goal_management/MonthSaleGoal.vue

@@ -319,7 +319,7 @@
         </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">
@@ -366,29 +366,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>
@@ -469,8 +462,6 @@
         <el-button @click="upload.open = false">取 消</el-button>
       </div>
     </el-dialog>
-
-    <TreeRefers ref="treeDetails" @doSubmit="selectionsToInputForDetails" :single="true"/>
   </div>
 </template>
 
@@ -615,9 +606,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',
       // 用户导入参数
@@ -899,36 +887,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 [
@@ -947,12 +905,12 @@ export default {
     },
     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) {
@@ -1009,6 +967,15 @@ 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]
     }
   }
 }