Эх сурвалжийг харах

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

001295 1 жил өмнө
parent
commit
4470fd43b5

+ 13 - 185
src/views/business/spd/target/AnnualSaleGoal.vue

@@ -251,7 +251,7 @@
               <el-table max-height="560" show-summary :summary-method="getSummaries" v-loading="loading" size="mini"
                 :data="annualSaleGoalDetailsList" @selection-change="handleSelectionChange" v-horizontal-scroll>
                 <el-table-column label="序号" type="index" width="70" align="center" fixed />
-                <el-table-column label="销售组织" align="center" width="180"
+                <!-- <el-table-column label="销售组织" align="center" width="180"
                   :render-header="(h, obj) => addRedStar(h, obj, '0')">
                   <template slot-scope="scope">
                     <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].saleOrg" title="销售组织"
@@ -287,7 +287,7 @@
                       :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入负责人">
                     </el-popover-select-v2>
                   </template>
-                </el-table-column>
+                </el-table-column> -->
                 <el-table-column label="一级分类" align="center" width="180">
                   <template slot-scope="scope">
                     <el-input v-model="annualSaleGoalDetailsList[scope.$index].oneLevelClassify" placeholder="请输入一级分类"
@@ -426,185 +426,6 @@
                 </el-table-column>
               </el-table>
 
-              <!-- <ux-grid max-height="560" show-summary :summary-method="getSummaries" v-loading="loading"
-                :data="annualSaleGoalDetailsList" @selection-change="handleSelectionChange" v-horizontal-scroll>
-                <ux-table-column title="序号" type="index" width="70" align="center" fixed />
-                <ux-table-column title="销售组织" align="center" width="180"
-                  :render-header="(h, obj) => addRedStar(h, obj, '0')">
-                  <template slot-scope="scope">
-                    <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].saleOrg" title="销售组织"
-                      valueKey="name" referName="ORG_PARAM" :dataMapping="{ saleOrgCode: 'code', saleOrg: 'name'}"
-                      :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入销售组织">
-                    </el-popover-select-v2>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="销售区域" align="center" width="180"
-                  :render-header="(h, obj) => addRedStar(h, obj, '0')">
-                  <template slot-scope="scope">
-                    <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].saleZone" title="销售区域"
-                      valueKey="name" referName="MK_SALESAREA_PARAM"
-                      :dataMapping="{ saleZoneCode: 'code', saleZone: 'name'}"
-                      :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入销售区域">
-                    </el-popover-select-v2>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="客户" align="center" width="180"
-                  :render-header="(h, obj) => addRedStar(h, obj, '0')">
-                  <template slot-scope="scope">
-                    <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].custom" title="客户"
-                      valueKey="name" referName="CUSTOMER_PARAM" :dataMapping="{ customCode: 'code', custom: 'name'}"
-                      :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入客户">
-                    </el-popover-select-v2>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="负责人" align="center" width="180"
-                  :render-header="(h, obj) => addRedStar(h, obj, '0')">
-                  <template slot-scope="scope">
-                    <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].creator" title="负责人"
-                      valueKey="name" referName="CONTACTS_PARAM" :dataMapping="{ creatorCode: 'code', creator: 'name'}"
-                      :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入负责人">
-                    </el-popover-select-v2>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="一级分类" align="center" width="180">
-                  <template slot-scope="scope">
-                    <el-input v-model="annualSaleGoalDetailsList[scope.$index].oneLevelClassify" placeholder="请输入一级分类"
-                      disabled></el-input>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="二级分类" align="center" width="180">
-                  <template slot-scope="scope">
-                    <el-input v-model="annualSaleGoalDetailsList[scope.$index].twoLevelClassify" placeholder="请输入二级分类"
-                      disabled></el-input>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="物料" align="center" width="220">
-                  <template slot-scope="scope">
-                    <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].material" title="物料"
-                      valueKey="name" referName="MATERIAL_PARAM"
-                      @change="setClassify(scope.row.oneLevelClassify, scope.row.twoLevelClassify, annualSaleGoalDetailsList[scope.$index])"
-                      @clear=""
-                      :dataMapping="{ materialCode: 'code', material: 'name', oneLevelClassify: 'oneClass', twoLevelClassify: 'twoClass'}"
-                      :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入物料">
-                    </el-popover-select-v2>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="合计(元)" align="center" field="totalGoal" width="180">
-                  <template slot-scope="scope">
-                    <el-input v-model="annualSaleGoalDetailsList[scope.$index].totalGoal" disabled></el-input>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="一月(元)" align="center" field="januaryGoal" width="220">
-                  <template slot-scope="scope">
-                    <el-input-number
-                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
-                      v-model="annualSaleGoalDetailsList[scope.$index].januaryGoal" :precision="2" :step="0.1" :min="0">
-                    </el-input-number>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="二月(元)" align="center" field="februaryGoal" width="220">
-                  <template slot-scope="scope">
-                    <el-input-number
-                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
-                      v-model="annualSaleGoalDetailsList[scope.$index].februaryGoal" :precision="2" :step="0.1"
-                      :min="0">
-                    </el-input-number>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="三月(元)" align="center" field="marchGoal" width="220">
-                  <template slot-scope="scope">
-                    <el-input-number
-                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
-                      v-model="annualSaleGoalDetailsList[scope.$index].marchGoal" :precision="2" :step="0.1" :min="0">
-                    </el-input-number>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="四月(元)" align="center" field="aprilGoal" width="220">
-                  <template slot-scope="scope">
-                    <el-input-number
-                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
-                      v-model="annualSaleGoalDetailsList[scope.$index].aprilGoal" :precision="2" :step="0.1" :min="0">
-                    </el-input-number>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="五月(元)" align="center" field="mayGoal" width="220">
-                  <template slot-scope="scope">
-                    <el-input-number
-                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
-                      v-model="annualSaleGoalDetailsList[scope.$index].mayGoal" :precision="2" :step="0.1" :min="0">
-                    </el-input-number>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="六月(元)" align="center" field="juneGoal" width="220">
-                  <template slot-scope="scope">
-                    <el-input-number
-                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
-                      v-model="annualSaleGoalDetailsList[scope.$index].juneGoal" :precision="2" :step="0.1" :min="0">
-                    </el-input-number>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="七月(元)" align="center" field="julyGoal" width="220">
-                  <template slot-scope="scope">
-                    <el-input-number
-                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
-                      v-model="annualSaleGoalDetailsList[scope.$index].julyGoal" :precision="2" :step="0.1" :min="0">
-                    </el-input-number>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="八月(元)" align="center" field="augustGoal" width="220">
-                  <template slot-scope="scope">
-                    <el-input-number
-                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
-                      v-model="annualSaleGoalDetailsList[scope.$index].augustGoal" :precision="2" :step="0.1" :min="0">
-                    </el-input-number>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="九月(元)" align="center" field="septemberGoal" width="220">
-                  <template slot-scope="scope">
-                    <el-input-number
-                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
-                      v-model="annualSaleGoalDetailsList[scope.$index].septemberGoal" :precision="2" :step="0.1"
-                      :min="0">
-                    </el-input-number>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="十月(元)" align="center" field="octoberGoal" width="220">
-                  <template slot-scope="scope">
-                    <el-input-number
-                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
-                      v-model="annualSaleGoalDetailsList[scope.$index].octoberGoal" :precision="2" :step="0.1" :min="0">
-                    </el-input-number>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="十一月(元)" align="center" field="novemberGoal" width="220">
-                  <template slot-scope="scope">
-                    <el-input-number
-                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
-                      v-model="annualSaleGoalDetailsList[scope.$index].novemberGoal" :precision="2" :step="0.1"
-                      :min="0">
-                    </el-input-number>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="十二月(元)" align="center" field="decemberGoal" width="220">
-                  <template slot-scope="scope">
-                    <el-input-number
-                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
-                      v-model="annualSaleGoalDetailsList[scope.$index].decemberGoal" :precision="2" :step="0.1"
-                      :min="0">
-                    </el-input-number>
-                  </template>
-                </ux-table-column>
-                <ux-table-column title="操作" align="center" class-name="small-padding fixed-width" width="120px"
-                  fixed="right">
-                  <template slot-scope="scope">
-                    <el-button size="mini" type="text" icon="el-icon-delete"
-                      @click="handleDeleteDetails(scope.$index, scope.row)">删除</el-button>
-                    <el-button size="mini" type="text" icon="el-icon-delete" @click="handleCopyDetails(scope.row)">复制
-                    </el-button>
-                  </template>
-                </ux-table-column>
-              </ux-grid> -->
-
             </el-tab-pane>
           </el-tabs>
           <div slot="footer" class="dialog-footer" style="margin-left: 88%; margin-top: 1%">
@@ -1063,15 +884,22 @@
       },
       /** 提交按钮 */
       submitForm() {
+        // 明细行赋值
+        for (let i = 0; i < this.annualSaleGoalDetailsList.length; i++) {
+          this.annualSaleGoalDetailsList[i].saleOrg = this.$store.state.user.orgName;
+          this.annualSaleGoalDetailsList[i].saleZone = this.form.saleZone;
+          this.annualSaleGoalDetailsList[i].custom = this.form.custom;
+          this.annualSaleGoalDetailsList[i].creator = this.form.creator;
+        }
         if (this.justiceDetailsList()) {
           return this.$message.error('子表有必填字段未填,或者目标值为0')
         }
         for (let i = 0; i < this.annualSaleGoalDetailsList.length; i++) {
           for (let j = i + 1; j < this.annualSaleGoalDetailsList.length; j++) {
             if (this.annualSaleGoalDetailsList[i].materialCode == this.annualSaleGoalDetailsList[j].materialCode &&
-              this.annualSaleGoalDetailsList[i].materialCode != null && 
-              this.annualSaleGoalDetailsList[j].materialCode != null && 
-              this.annualSaleGoalDetailsList[i].materialCode != "" && 
+              this.annualSaleGoalDetailsList[i].materialCode != null &&
+              this.annualSaleGoalDetailsList[j].materialCode != null &&
+              this.annualSaleGoalDetailsList[i].materialCode != "" &&
               this.annualSaleGoalDetailsList[j].materialCode != "") {
               return this.$message.error('子表存在重复物料');
             }
@@ -1337,7 +1165,7 @@
           console.error(err);
           this.$modal.closeLoading();
         }
-      },      
+      },
       //收回
       handleReback(row) {
         this.$modal.loading("收回中...");

+ 16 - 9
src/views/business/spd/target/MonthSaleGoal.vue

@@ -261,7 +261,7 @@
               <el-table max-height="560" show-summary :summary-method="getSummaries" v-loading="loading" size="mini"
                 :data="monthSaleGoalDetailsList" @selection-change="handleSelectionChange" v-horizontal-scroll>
                 <el-table-column label="序号" type="index" width="70" align="center" fixed />
-                <el-table-column label="销售组织" align="center" width="180" :render-header="addRedStar">
+                <!-- <el-table-column label="销售组织" align="center" width="180" :render-header="addRedStar">
                   <template slot-scope="scope">
                     <el-popover-select-v2 v-model="monthSaleGoalDetailsList[scope.$index].saleOrg" title="销售组织"
                       valueKey="name" referName="ORG_PARAM" :dataMapping="{ saleOrgCode: 'code', saleOrg: 'name'}"
@@ -301,7 +301,7 @@
                       :source.sync="monthSaleGoalDetailsList[scope.$index]" placeholder="请输入制单人">
                     </el-popover-select-v2>
                   </template>
-                </el-table-column>
+                </el-table-column> -->
                 <el-table-column label="一级分类" align="center" width="180" :render-header="addRedStar">
                   <template slot-scope="scope">
                     <el-input v-model="monthSaleGoalDetailsList[scope.$index].oneLevelClassify" placeholder="请输入一级分类"
@@ -862,6 +862,13 @@
       },
       /** 提交按钮 */
       submitForm() {
+        for (let i = 0; i < this.monthSaleGoalDetailsList.length; i++) {
+          this.monthSaleGoalDetailsList[i].saleOrg = this.$store.state.user.orgName;
+          this.monthSaleGoalDetailsList[i].saleZone = this.form.saleZone;
+          this.monthSaleGoalDetailsList[i].custom = this.form.custom;
+          this.monthSaleGoalDetailsList[i].dept = this.form.dept;
+          this.monthSaleGoalDetailsList[i].creator = this.form.creator;
+        }
         if (this.justiceDetailsList()) {
           return this.$message.error('子表有必填字段未填,或者目标值为0')
         }
@@ -1205,13 +1212,13 @@
           console.log(res, 'res')
           this.monthSaleGoalDetailsList = res;
           for (const item of this.monthSaleGoalDetailsList) {
-            item.saleOrg = this.$store.state.user.orgName,
-            item.saleZone = this.form.saleZone,
-            item.custom = this.form.custom,
-            item.dept = this.form.dept,
-            item.creator = this.form.creator
-            item.monthly = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2,
-            '0')
+            item.saleOrg = this.$store.state.user.orgName;
+            item.saleZone = this.form.saleZone;
+            item.custom = this.form.custom;
+            item.dept = this.form.dept;
+            item.creator = this.form.creator;
+            item.monthly = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString()
+              .padStart(2, '0');
           }
         }).catch((e) => {
           this.$message.error(e.message)