浏览代码

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

qymljy 2 年之前
父节点
当前提交
e3c33b7bde

+ 1 - 1
src/Form/EnterpriseArchives/add.vue

@@ -113,7 +113,7 @@ export default {
           "content":this.form
         })
         this.tool.showMessage(res,()=>{
-          this.$emit('onSuccess')
+          this.$emit('onSuccess',res)
           this.$refs['form'].resetFields();
           this.form = {
             enterprisename:'',

+ 22 - 9
src/Form/marketing2/agent/add.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <el-button type="primary" size="small" @click="onShow">新 建</el-button>
-    <el-drawer title="创建经销商" direction="rtl" append-to-body :visible.sync="dialogVisible">
+    <el-drawer title="创建经销商" direction="rtl" append-to-body :visible.sync="dialogVisible" @close="onClose">
       <div class="drawer__panel">
       <el-row :gutter="20">
         <el-form :model="form" ref="form" :rules="rules" :status-icon="false"	 size="small" label-position="right" label-width="100px" class="demo-form-inline">
@@ -10,7 +10,7 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="企业名称:" prop="enterprisename">
-              <enterprise @rowClick="chooseEnterprise"></enterprise>
+              <enterprise ref="ent" @rowClick="chooseEnterprise"></enterprise>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -151,7 +151,8 @@ export default {
       agent_level:[],
       arealist:[],
       agent_type:[],
-      enterprise:{}
+      enterprise:{},
+      timer:0
     }
   },
   components:{
@@ -233,24 +234,36 @@ export default {
       this.form.sa_saleareaid = value.at(-1)
     },
     debounce (fn, wait) {
-      let timer = 0
       return function () {
-        if (timer !== null) clearTimeout(timer)
-        timer = setTimeout(fn, wait)
+        if (this.timer !== null) clearTimeout(this.timer)
+        this.timer = setTimeout(fn, wait)
       }
     },
     chooseEnterprise (item) {
       this.visible = false
       this.form.enterprisename = item.enterprisename
-      this.form.enterpriseid = item.enterpriseid
-
+      this.form.sys_enterpriseid = item.sys_enterpriseid
       item.province = `${item.province}-${item.city}-${item.county}`
       this.enterprise = item
     },
     selectAgent (data) {
       this.form.parentid = data.sa_agentsid
     },
-   
+    onClose () {
+      this.$refs['ent'].form = {}
+      this.form = {
+        "enterprisename":'',
+        "sa_agentsid": 0,
+        "parentid":"",
+        "agentnum":"",
+        "signdate":"",
+        "grade":'1',
+        "sa_saleareaid":null,
+        "sys_enterpriseid":null,
+        "sa_saleareaids":[]
+      },
+      this.enterprise = {}
+    }
   },
   
 }

+ 386 - 0
src/Form/projectTask/add copy.vue

@@ -0,0 +1,386 @@
+<template>
+  <div>
+    <el-button size="small" type="primary"  @click="onShow">新 建</el-button>
+    <el-drawer
+        title="新建工作任务"
+        :visible.sync="drawer"
+        size="45%"
+        direction="rtl"
+        append-to-body
+        :show-close="false"
+        @close="onClose">
+      <div class="drawer__panel" style="margin-bottom: 0px;padding-bottom: 0px">
+        <el-row>
+          <el-form :model="form" :rules="rules" ref="formData"  size="mini" label-position="right">
+            <el-col :span="20">
+              <el-form-item label="工作任务:" label-width="85px" prop="taskname">
+                <el-input v-model="form.taskname" autocomplete="off" placeholder="输入工作任务"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="4">
+              <el-form-item label="顺序:" label-width="80px">
+                <el-input  v-model="form.sequence" autocomplete="off" placeholder="输入顺序"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="关键任务:" label-width="85px">
+                <el-radio v-model="form.important" label="1">是</el-radio>
+                <el-radio v-model="form.important" label="0">否</el-radio>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item >
+                <el-checkbox v-model="form.onparties">关联客户对象</el-checkbox>
+                <AssociateCustomerObject ref="onparties" :data="form" class="inline-16" style="margin-left: 10px" @selectObject="selectObject"></AssociateCustomerObject>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item >
+                <el-checkbox v-model="form.onstage" style="font-size: 14px">关联项目阶段</el-checkbox>
+                <AssociatedProjectPhases ref="onstage" :data="form" class="inline-16" style="margin-left: 10px" @selectStage="selectStage"></AssociatedProjectPhases>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div class="drawer__panel">
+        <el-row>
+          <el-form ref="form"  size="mini" label-position="right">
+            <el-col :span="22">
+              <el-form-item label="评估项:" label-width="60px" >
+              </el-form-item>
+            </el-col>
+            <el-col :span="2">
+              <el-form-item  style="float: right;width: 100%;">
+                <el-button size="small" type="primary" plain style="width: 100%" @click="addOptions">添加</el-button>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24" >
+              <el-form-item  style="float: right;width: 100%;text-align: center">
+                <el-table
+                    :data="form.projtaskmag_options"
+                    style="width: 100%">
+                  <el-table-column
+                      prop="optionname"
+                      label="任务内容"
+                      width="360">
+                    <template slot-scope="scope">
+                      <el-input @change="inputChange(scope.$index)" v-model="scope.row.optionname" placeholder=""></el-input>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                      prop="remarks"
+                      label="描述"
+                      width="0">
+                    <template slot-scope="scope">
+                      <el-input v-model="scope.row.remarks" placeholder=""></el-input>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                      prop="score"
+                      width="160"
+                      label="独立项分值">
+                    <template slot-scope="scope">
+                      <el-input v-model="scope.row.score" placeholder=""></el-input>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                      prop="operation"
+                      width="100"
+                      label="操作">
+                    <template slot-scope="scope">
+                      <el-button type="text" size="mini" :disabled="form.projtaskmag_options.length === 1">删除</el-button>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div class="drawer__panel">
+        <el-row>
+          <el-form ref="form"  size="mini" label-position="right">
+            <el-col :span="22">
+              <el-form-item label="关联信息:" label-width="75px" >
+              </el-form-item>
+            </el-col>
+            <el-col :span="24" >
+              <el-form-item  style="float: right;width: 100%;text-align: center">
+                <el-table
+                    :data="associatedData"
+                    border
+                    style="width: 100%">
+                  <el-table-column
+                      v-if="form.onparties"
+                      prop="optionname"
+                      label="客户对象"
+                      >
+                    <template slot-scope="scope">
+                      <span>{{scope.row}}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                      v-if="form.onstage"
+                      prop="remarks"
+                      label="项目阶段"
+                     >
+                    <template slot-scope="scope">
+                      <div v-if="form.onparties">
+                        <div v-for="(item,index) in form.stage" :key="index">
+                          <span>{{item}}</span>
+                        </div>
+                      </div>
+                      <div v-else>
+                        <span>{{scope.row}}</span>
+                      </div>
+
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                      v-if="form.onparties || form.onstage"
+                      prop="score"
+                      label="分值">
+                    <template slot-scope="scope">
+                      <div v-if="form.onparties">
+                        <div v-for="(item,index) in form.parties" :key="index">
+                          <template slot-scope="scope">
+                            <el-input v-model="scope.row" placeholder=""></el-input>
+                          </template>
+                        </div>
+                      </div>
+                      <div v-else-if="form.onstage">
+                        <div v-for="(item,index) in form.stage" :key="index">
+                          <template slot-scope="scope">
+                            <el-input v-model="scope.row" placeholder=""></el-input>
+                          </template>
+                        </div>
+                      </div>
+
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="drawer = false" class="normal-btn-width">取 消</el-button>
+        <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import AssociateCustomerObject from '@/HDrpManagement/projectTask/modules/AssociateCustomerObject'
+import AssociatedProjectPhases from '@/HDrpManagement/projectTask/modules/AssociatedProjectStage'
+export default {
+  name: "add",
+  components:{AssociateCustomerObject,AssociatedProjectPhases},
+  data(){
+    return {
+      drawer:false,
+      input:'',
+      associatedData:[],
+      form:{
+        "sa_projtaskmagid": 0,
+        "taskname": "",
+        "sequence": 0,
+        "important": '0',
+        "onparties": false,
+        "onstage": false,
+        "parties": [],
+        "stage": [],
+        "projtaskmag_options": [
+          {
+            "sa_projtaskmag_optionsid": 0,
+            "optionname": "",
+            "remarks": "",
+            "score": 0,
+            "projtaskmag_optionscore": [
+              {
+                "sa_projtaskmag_optionscoreid":0,
+                "partiestype": "",
+                "sa_projstagemagid": "",
+                "score": 0
+              }
+            ]
+          },
+        ]
+      },
+      rules:{
+        taskname: [
+          { required: true, message: '请输入工作任务', trigger: 'blur' }
+        ],
+      }
+    }
+  },
+  methods:{
+    onShow(){
+      this.drawer = true
+    },
+    selectObject(val){
+      this.form.parties = val
+      if (this.form.onparties && this.form.onstage){
+        this.associatedData = this.form.parties
+      }else if(this.form.onparties){
+        this.associatedData = this.form.parties
+      }else if(this.form.onstage){
+        this.associatedData = this.form.stage
+      }
+    },
+    selectStage(val){
+      this.form.stage = val
+      if (this.form.onparties && this.form.onstage){
+        this.associatedData = this.form.parties
+      }else if(this.form.onparties){
+        this.associatedData = this.form.parties
+      }else if(this.form.onstage){
+        this.associatedData = this.form.stage
+      }
+    },
+    inputChange (index) {
+      this.associatedData[index].partiestype
+      
+    },
+    onSubmit(){
+      if (this.form.onstage){
+        this.form.onstage = 1
+      }else {
+        this.form.onstage = 0
+      }
+      if (this.form.onparties){
+        this.form.onparties = 1
+      }else {
+        this.form.onparties = 0
+      }
+      console.log(this.form.projtaskmag_options)
+      this.form.stage
+      /*this.$refs.formData.validate(async(valid)=>{
+        if (!valid) return false
+        const res = await this.$api.requested({
+          "id": "20221128144204",
+          "content": this.form
+        })
+        this.tool.showMessage(res,()=>{
+          this.drawer = false
+          this.$refs.formData.resetFields()
+          this.form = {
+            "sa_projtaskmagid": 0,
+            "taskname": "",
+            "sequence": 0,
+            "important": '0',
+            "onparties": false,
+            "onstage": false,
+            "parties": [],
+            "stage": [],
+            "projtaskmag_options": [
+              {
+                "sa_projtaskmag_optionsid": 0,
+                "optionname": "",
+                "remarks": "",
+                "score": "",
+                "projtaskmag_optionscore": [
+                  {
+                    "sa_projtaskmag_optionscoreid":0,
+                    "partiestype": "",
+                    "sa_projstagemagid": '',
+                    "score": ''
+                  }
+                ]
+              },
+            ]
+          }
+          this.$emit("onSuccess")
+        })
+      })*/
+    },
+    addOptions(){
+      console.log(this.form.projtaskmag_options)
+      this.form.projtaskmag_options.push({
+        "sa_projtaskmag_optionsid": 0,
+        "optionname": "",
+        "remarks": "",
+        "score": 0,
+        "projtaskmag_optionscore": [
+          {
+            "sa_projtaskmag_optionscoreid":0,
+            "partiestype": "",
+            "sa_projstagemagid": '',
+            "score": ''
+          }
+        ]
+      })
+    },
+    onClose(){
+      this.$refs.formData.resetFields()
+      this.form = {
+        "sa_projtaskmagid": 0,
+        "taskname": "",
+        "sequence": 0,
+        "important": '0',
+        "onparties": false,
+        "onstage": false,
+        "parties": [],
+        "stage": [],
+        "projtaskmag_options": [
+          {
+            "sa_projtaskmag_optionsid": 0,
+            "optionname": "",
+            "remarks": "",
+            "score": "",
+            "projtaskmag_optionscore": [
+              {
+                "sa_projtaskmag_optionscoreid":0,
+                "partiestype": "",
+                "sa_projstagemagid": '',
+                "score": ''
+              }
+            ]
+          },
+        ]
+      }
+    }
+  },
+  mounted() {
+    if (this.form.onparties && this.form.onstage){
+      this.associatedData = this.form.parties
+    }else if(this.form.onparties){
+      this.associatedData = this.form.parties
+    }else if(this.form.onstage){
+      this.associatedData = this.form.stage
+    }
+  },
+  watch:{
+    "form.onparties":function (val){
+      if (!val){
+        this.form.parties = []
+        this.associatedData = this.form.stage
+      }else if (val && this.form.onstage){
+        console.log(this.form)
+        this.associatedData = this.form.parties
+        this.$refs.onparties.drawer = true
+      }else if (val){
+        this.$refs.onparties.drawer = true
+      }
+    },
+    "form.onstage":function (val){
+      if (!val){
+        this.form.stage = []
+        this.associatedData = this.form.parties
+      }else if (val && this.form.onparties){
+        this.associatedData = this.form.parties
+        this.$refs.onstage.drawer = true
+      }else if (val){
+        this.$refs.onstage.drawer = true
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 192 - 101
src/Form/projectTask/add.vue

@@ -30,13 +30,13 @@
             </el-col>
             <el-col :span="8">
               <el-form-item >
-                <el-checkbox v-model="form.onparties">关联客户对象</el-checkbox>
+                <el-checkbox v-model="form.onparties" @change="onPartiesChange">关联客户对象</el-checkbox>
                 <AssociateCustomerObject ref="onparties" :data="form" class="inline-16" style="margin-left: 10px" @selectObject="selectObject"></AssociateCustomerObject>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item >
-                <el-checkbox v-model="form.onstage" style="font-size: 14px">关联项目阶段</el-checkbox>
+                <el-checkbox v-model="form.onstage" style="font-size: 14px" @change="onOnstageChange">关联项目阶段</el-checkbox>
                 <AssociatedProjectPhases ref="onstage" :data="form" class="inline-16" style="margin-left: 10px" @selectStage="selectStage"></AssociatedProjectPhases>
               </el-form-item>
             </el-col>
@@ -59,13 +59,45 @@
               <el-form-item  style="float: right;width: 100%;text-align: center">
                 <el-table
                     :data="form.projtaskmag_options"
-                    style="width: 100%">
+                    @expand-change="expandChange"
+                    ref="refTable"
+                    style="width: 100%"
+                    @cell-click="cellClick">
+                    <el-table-column v-if="(form.onparties || form.onstage) && showChildTable" type="expand">
+                      <template slot-scope="prop">
+                        <el-table
+                            :data="associatedData"
+                            border
+                            style="width: 100%"
+                            :span-method="oldData.length > 0? arraySpanMethod:noop">
+                          <el-table-column
+                              v-if="form.onparties"
+                              prop="partiestype"
+                              label="客户对象"
+                              >
+                          </el-table-column>
+                          <el-table-column
+                              v-if="form.onstage"
+                              prop="stagename"
+                              label="项目阶段"
+                            >
+                          </el-table-column>
+                          <el-table-column
+                              prop="score"
+                              label="分值">
+                              <template slot-scope="scope">
+                                <el-input v-model="scope.row.score" placeholder=""></el-input>
+                              </template>
+                          </el-table-column>
+                        </el-table>
+                      </template>
+                    </el-table-column>
                   <el-table-column
                       prop="optionname"
                       label="任务内容"
                       width="360">
                     <template slot-scope="scope">
-                      <el-input v-model="scope.row.optionname" placeholder=""></el-input>
+                      <el-input @change="inputChange(scope.$index)" v-model="scope.row.optionname" placeholder=""></el-input>
                     </template>
                   </el-table-column>
                   <el-table-column
@@ -81,7 +113,7 @@
                       width="160"
                       label="独立项分值">
                     <template slot-scope="scope">
-                      <el-input v-model="scope.row.score" placeholder=""></el-input>
+                      <el-input v-model="scope.row.score" placeholder="" ></el-input>
                     </template>
                   </el-table-column>
                   <el-table-column
@@ -98,7 +130,7 @@
           </el-form>
         </el-row>
       </div>
-      <div class="drawer__panel">
+      <!-- <div class="drawer__panel">
         <el-row>
           <el-form ref="form"  size="mini" label-position="right">
             <el-col :span="22">
@@ -110,61 +142,34 @@
                 <el-table
                     :data="associatedData"
                     border
-                    style="width: 100%">
+                    style="width: 100%"
+                    :span-method="oldData.length > 0? arraySpanMethod:noop"
+                    @row-click="rowClick">
                   <el-table-column
                       v-if="form.onparties"
-                      prop="optionname"
+                      prop="value"
                       label="客户对象"
                       >
-                    <template slot-scope="scope">
-                      <span>{{scope.row}}</span>
-                    </template>
                   </el-table-column>
                   <el-table-column
                       v-if="form.onstage"
-                      prop="remarks"
+                      prop="stagename"
                       label="项目阶段"
                      >
-                    <template slot-scope="scope">
-                      <div v-if="form.onparties">
-                        <div v-for="(item,index) in form.stage">
-                          <span>{{item}}</span>
-                        </div>
-                      </div>
-                      <div v-else>
-                        <span>{{scope.row}}</span>
-                      </div>
-
-                    </template>
                   </el-table-column>
                   <el-table-column
-                      v-if="form.onparties || form.onstage"
                       prop="score"
                       label="分值">
-                    <template slot-scope="scope">
-                      <div v-if="form.onparties">
-                        <div v-for="(item,index) in form.parties">
-                          <template slot-scope="scope">
-                            <el-input v-model="scope.row" placeholder=""></el-input>
-                          </template>
-                        </div>
-                      </div>
-                      <div v-else-if="form.onstage">
-                        <div v-for="(item,index) in form.stage">
-                          <template slot-scope="scope">
-                            <el-input v-model="scope.row" placeholder=""></el-input>
-                          </template>
-                        </div>
-                      </div>
-
-                    </template>
+                      <template slot-scope="scope">
+                        <el-input v-model="scope.row.score" placeholder=""></el-input>
+                      </template>
                   </el-table-column>
                 </el-table>
               </el-form-item>
             </el-col>
           </el-form>
         </el-row>
-      </div>
+      </div> -->
       <div class="fixed__btn__panel">
         <el-button size="small" @click="drawer = false" class="normal-btn-width">取 消</el-button>
         <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
@@ -174,8 +179,8 @@
 </template>
 
 <script>
-import AssociateCustomerObject from '@/HDrpManagement/projectTask/modules/AssociateCustomerObject'
-import AssociatedProjectPhases from '@/HDrpManagement/projectTask/modules/AssociatedProjectStage'
+import AssociateCustomerObject from '@/HDrpManagement/projectTask/modules/AssociateCustomerObject.vue'
+import AssociatedProjectPhases from '@/HDrpManagement/projectTask/modules/AssociatedProjectStage.vue'
 export default {
   name: "add",
   components:{AssociateCustomerObject,AssociatedProjectPhases},
@@ -191,14 +196,13 @@ export default {
         "important": '0',
         "onparties": false,
         "onstage": false,
-        "parties": [],
-        "stage": [],
         "projtaskmag_options": [
           {
             "sa_projtaskmag_optionsid": 0,
             "optionname": "",
             "remarks": "",
             "score": 0,
+            "index":0,
             "projtaskmag_optionscore": [
               {
                 "sa_projtaskmag_optionscoreid":0,
@@ -214,7 +218,12 @@ export default {
         taskname: [
           { required: true, message: '请输入工作任务', trigger: 'blur' }
         ],
-      }
+      },
+      oldData:[],
+      oldstage:[],
+      expands:[],
+      showChildTable:true,
+      nowIndex:0
     }
   },
   methods:{
@@ -222,24 +231,74 @@ export default {
       this.drawer = true
     },
     selectObject(val){
-      this.form.parties = val
-      if (this.form.onparties && this.form.onstage){
-        this.associatedData = this.form.parties
-      }else if(this.form.onparties){
-        this.associatedData = this.form.parties
-      }else if(this.form.onstage){
-        this.associatedData = this.form.stage
+      val.length === 0?this.form.onparties = 0:""
+      this.oldData = val
+      if (this.oldstage.length > 0) {
+        this.selectStage(this.oldstage)
+      } else {
+        this.associatedData = this.oldData.sort()
       }
+      this.refreChildTable()
     },
     selectStage(val){
-      this.form.stage = val
-      if (this.form.onparties && this.form.onstage){
-        this.associatedData = this.form.parties
-      }else if(this.form.onparties){
-        this.associatedData = this.form.parties
-      }else if(this.form.onstage){
-        this.associatedData = this.form.stage
+       val.length === 0?this.form.onstage = 0:""
+      let arr = []
+      this.oldstage = val
+
+      if (this.oldData.length === 0) {
+        this.associatedData = val.map(e=>{
+          return {
+            partiestype:'',
+            stagename:e.stagename,
+            sa_projstagemagid:e.sa_projstagemagid
+          }
+        })
+      } else {
+        if (this.oldstage.length > 0) {
+          this.oldData.forEach(e=>{
+            val.forEach(vl=>{
+              arr.push({
+                partiestype:e.partiestype,
+                stagename:vl.stagename,
+                sa_projstagemagid:vl.sa_projstagemagid
+              })
+            })
+          })
+          this.associatedData = arr.sort()
+        } else {
+          this.associatedData = this.oldData.sort()
+        }
       }
+      this.refreChildTable()
+    },
+    inputChange (index) {
+      this.form.projtaskmag_options[index].projtaskmag_optionscore = this.associatedData
+      this.$set(this.form.projtaskmag_options,index,this.form.projtaskmag_options[index])
+      console.log(this.form.projtaskmag_options[index].projtaskmag_optionscore)
+    },
+    onPartiesChange (val) {
+      this.$refs.onparties.drawer = val
+      val?'':this.oldData = []
+      val?'':this.associatedData = []
+      val?'':this.associatedData = this.oldstage.map(e=>{
+        return {
+          partiestype:'',
+          stagename:e.stagename,
+          sa_projstagemagid:e.sa_projstagemagid
+        }
+      })
+      this.refreChildTable()
+    },
+    onOnstageChange (val) {
+      this.$refs.onstage.drawer = val
+      val?'':this.associatedData = this.oldData.map(e=>{
+        return {
+          partiestype:e.partiestype,
+          stagename:'',
+          sa_projstagemagid:e.sa_projstagemagid
+        }
+      })
+      this.refreChildTable()
     },
     onSubmit(){
       if (this.form.onstage){
@@ -252,7 +311,8 @@ export default {
       }else {
         this.form.onparties = 0
       }
-      console.log(this.form)
+      console.log(this.form.projtaskmag_options)
+      this.form.stage
       /*this.$refs.formData.validate(async(valid)=>{
         if (!valid) return false
         const res = await this.$api.requested({
@@ -299,14 +359,8 @@ export default {
         "optionname": "",
         "remarks": "",
         "score": 0,
-        "projtaskmag_optionscore": [
-          {
-            "sa_projtaskmag_optionscoreid":0,
-            "partiestype": "",
-            "sa_projstagemagid": '',
-            "score": ''
-          }
-        ]
+        "index":this.form.projtaskmag_options.length,
+        "projtaskmag_optionscore": this.associatedData
       })
     },
     onClose(){
@@ -337,41 +391,78 @@ export default {
           },
         ]
       }
-    }
-  },
-  mounted() {
-    if (this.form.onparties && this.form.onstage){
-      this.associatedData = this.form.parties
-    }else if(this.form.onparties){
-      this.associatedData = this.form.parties
-    }else if(this.form.onstage){
-      this.associatedData = this.form.stage
-    }
-  },
-  watch:{
-    "form.onparties":function (val){
-      if (!val){
-        this.form.parties = []
-        this.associatedData = this.form.stage
-      }else if (val && this.form.onstage){
-        console.log(this.form)
-        this.associatedData = this.form.parties
-        this.$refs.onparties.drawer = true
-      }else if (val){
-        this.$refs.onparties.drawer = true
+    },
+    arraySpanMethod({ row, column, rowIndex, columnIndex }) {
+      // 合并行列产品名字相同合并(计算组长度以内的列,需要进行合并操作的列)
+      let mergeLength = 1;//需要进行横纵合并的列
+      if (columnIndex < mergeLength) {
+        let finArray = [1,1];
+        // 处理行数据
+        let cgname = Object.keys(row)[columnIndex]
+        console.log(cgname,'---')
+        // let cgname = 'value'
+        if(rowIndex === 0 || row[cgname] !== this.associatedData[rowIndex-1][cgname]){
+          let rowspan = 1;
+          //计算需要进行合并操作的行
+          for(let i=0; i<this.associatedData.length-1; i++){
+            // 只合并连续的
+            if(this.associatedData[i][cgname] === row[cgname] && this.associatedData[i+1][cgname] === row[cgname]){
+              rowspan ++;
+            }
+          }
+          finArray[0] = rowspan;
+        }else {
+          finArray[0] = 0;
+        }
+
+        // 处理列数据
+        let colkeys = Object.keys(row);
+        let cgvalue = Object.values(row)[columnIndex]
+        if(columnIndex ===0 || row[colkeys[columnIndex-1]] !== row[colkeys[columnIndex]]){
+          let colspan = 1;
+          //计算需要进行合并操作的列
+          for(let i=columnIndex; i<mergeLength; i++) {
+            // 只合并连续的
+            if (row[colkeys[i]]===cgvalue && row[colkeys[i+1]]===cgvalue && i+1<mergeLength) {
+              colspan ++;
+            }
+          }
+          finArray[1] = colspan;
+        } else {
+          finArray[1] = 0;
+        }
+        return finArray
       }
     },
-    "form.onstage":function (val){
-      if (!val){
-        this.form.stage = []
-        this.associatedData = this.form.parties
-      }else if (val && this.form.onparties){
-        this.associatedData = this.form.parties
-        this.$refs.onstage.drawer = true
-      }else if (val){
-        this.$refs.onstage.drawer = true
+    noop(){},
+    expandChange (row, expandedRows) {
+      var that = this
+
+      that.nowIndex = row.index
+
+      that.associatedData = that.form.projtaskmag_options[row.index].projtaskmag_optionscore
+      
+      if (expandedRows.length>1) {
+        that.expands = []
+        if (row) {
+          that.expands.push(row);
+        }
+        this.$refs.refTable.toggleRowExpansion(expandedRows[0]);
+      } else {
+        that.expands = [];
       }
+    },
+    refreChildTable () {
+      this.showChildTable = false
+      setTimeout(() => {
+        this.showChildTable = true
+      }, 100);
+    },
+    cellClick (row, column, cell, event) {
+      console.log(row, column, cell, event)
     }
+  },
+  mounted() {
   }
 }
 </script>

+ 17 - 4
src/HDrpManagement/logistics/modules/dispatchTable.vue

@@ -44,10 +44,23 @@
         this.needQuery?this.listData():''
       },
 			methods:{
-				deleteDisBill (row) {
-					this.tableData = this.tableData.filter(e=>{
-						return e.sa_dispatchid !== row.sa_dispatchid
-					})
+				async deleteDisBill (row) {
+          if (this.needQuery) {
+            const res = await this.$api.requested({
+              "id": "20221122133404",
+              "content": {
+                  "sa_logisticsid":this.$route.query.id,
+                  "sa_logistics_itemsids":[row.sa_logistics_itemsid]
+              }
+            })
+            this.tool.showMessage(res,()=>{
+              this.listData()
+            })
+          } else {
+            this.tableData = this.tableData.filter(e=>{
+              return e.sa_dispatchid !== row.sa_dispatchid
+            })
+          }
 				},
         async listData(){
           const res = await this.$api.requested({

+ 15 - 5
src/HDrpManagement/logistics/modules/edit.vue

@@ -1,6 +1,6 @@
 ed<template>
   <div>
-    <el-button :disabled="data.status !=='新建'" type="primary" size="mini" @click="drawer = true">编 辑</el-button>
+    <el-button :disabled="data.status !=='新建'" type="primary" size="mini" @click="onShow(drawer = true)">编 辑</el-button>
     <el-drawer
     title="创建物流单"
     :visible.sync="drawer"
@@ -10,7 +10,7 @@ ed<template>
     @close="onClose">
     <div class="drawer__panel">
       <p class="normal-title normal-margin">基础信息</p>
-      <el-form :inline="true" :model="form" class="demo-form-inline" size="small">
+      <el-form :inline="true" :model="form" class="demo-form-inline" size="small" v-if="drawer">
         <el-form-item label="企业名称">
           <enterprise ref="ent" @rowClick="entRowClick"></enterprise>
         </el-form-item>
@@ -35,13 +35,13 @@ ed<template>
         </el-form-item>
       </el-form>
       <div class="mt-10">
-        <div>
+        <div class="normal-margin">
           <p class="normal-title inline-16">添加发货单</p>
           <el-button type="text" size="mini" @click="addMoreBill">{{setcol === 12?'关闭选择':'添加发货单'}}</el-button>
         </div>
         <el-row :gutter="10">
           <el-col :span="setcol">
-            <dispatch-table ref="dislist"></dispatch-table>
+            <dispatch-table :needQuery="true" ref="dislist"></dispatch-table>
           </el-col>
           <el-col :span="24 - setcol">
             <add-disbill ref="addbill" :data="enterpriseInfo" @onConfirm="onConfirm"></add-disbill>
@@ -100,7 +100,17 @@ export default {
     }
   },
   methods:{
+    onShow () {
+      this.form = Object.assign({},this.form,this.data)
+      this.enterpriseInfo = this.data
+      this.$nextTick(()=>{
+        this.$refs['ent'].form.enterprisename = this.data.enterprisename
+        this.$refs['logis'].form.abbreviation = this.data.logiscomp_enterprisename
+      })
+     
+    },
     addMoreBill () {
+      console.log(this.data)
       if (this.enterpriseInfo === null) return this.$message({
         message:'请先选择企业信息',
         type:'error'
@@ -126,7 +136,7 @@ export default {
       const res = await this.$api.requested({
         "id": "202212004124804",
         "content": {
-          "sa_logisticsid": 0,
+          "sa_logisticsid": this.$route.query.id,
           "sys_enterpriseid": this.enterpriseInfo.sys_enterpriseid,
           "sa_logiscompid": this.form.sa_logiscompid,
           "remarks": "",

+ 1 - 1
src/HDrpManagement/projectChange/modules/detail.vue

@@ -44,7 +44,7 @@
       </div>
     </div>
     <template #customBefore>
-      <div class="container normal-panel sticky" style="margin-bottom: 10px;border-radius: 5px;height: 32px">
+      <div class="container normal-panel" style="margin-bottom: 10px;border-radius: 5px;height: 32px">
         <div v-for="item in stageList" :key="item.stagename" >
           <div class="stage__panel normal-panel"  v-if="item.rowindex === selectRowindex" :style="selectColor">
             <div style="transform: skewX(20deg);!important;color: #ffffff">{{item.stagename}}</div>

+ 5 - 4
src/HDrpManagement/projectTask/modules/AssociateCustomerObject.vue

@@ -75,15 +75,16 @@ export default {
       this.$emit("selectObject",this.selectObject)
     },
     checkboxCallBack(val){
-      console.log(val)
-      val.forEach((item,index)=>{
-        this.selectObject[index] = item.value
+      this.selectObject = val.map(e=>{
+        return {
+          partiestype:e.value
+        }
       })
-      console.log(this.selectObject)
 
     },
     onClose(){
       this.drawer = false
+      this.$emit("selectObject",this.selectObject)
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);

+ 5 - 2
src/HDrpManagement/projectTask/modules/AssociatedProjectStage.vue

@@ -72,8 +72,11 @@ export default {
       this.currentPage = res.pageNumber
     },
     checkboxCallBack(val){
-      val.forEach((item,index)=>{
-        this.selectStage[index] = item.stagename
+      this.selectStage = val.map((item,index)=>{
+        return {
+          stagename:item.stagename,
+          sa_projstagemagid:item.sa_projstagemagid
+        }
       })
     },
     onSubmit(){

+ 1 - 0
src/api/request.js

@@ -68,6 +68,7 @@ service.interceptors.response.use(response => {
         //在这里对返回的数据进行处理
         if (response.data.code === -1) {
             router.push({path:'/'})
+            // location.reload(true);
         }
         return response.data;
     }, error => {

+ 0 - 1
src/components/newLayout/modules/header.vue

@@ -97,7 +97,6 @@ export default {
       }).then(() => {
         sessionStorage.clear()
         this.$router.push('/')
-        location.reload(true);
       }).catch((err) => {
         console.log(err)
         this.$message({

+ 0 - 1
src/components/normal-basic-layout/index.vue

@@ -57,7 +57,6 @@
           <div v-if="!hidePagination" class="container normal-panel" style="text-align:right">
             <el-pagination
               background
-              small
               @size-change="handleSizeChange"
               @current-change="handleCurrentChange"
               :current-page="currentPage"

+ 17 - 4
src/template/enterprise/index.vue

@@ -7,7 +7,7 @@
       <div>
         <div class="flex-align-center flex-between" style="margin-bottom:10px">
           <el-input style="width:200px" suffix-icon="el-icon-search" size="small" v-model="params.content.where.condition" placeholder="输入企业信息" @keyup.enter.native="queryEnterpriseArchives(params.content.pageNumber = 1)" @clear="queryEnterpriseArchives(params.content.pageNumber = 1)" clearable></el-input>
-          <addTemp @onSuccess="queryEnterpriseArchives"></addTemp>
+          <addTemp @onSuccess="onSuccess"></addTemp>
         </div>
         <el-table
           :data="ENlist"
@@ -65,15 +65,23 @@ export default {
       ENlist:[],
       total:0,
       currentPage:0,
-      form:{},
+      form:{
+        enterprisename:''
+      },
       params:{
         "id": 20220920083901,
         "content": {
           "pageNumber": 1,
           "pageSize": 10,
           "where": {
-            "condition": ''
-          }
+            "condition": '',
+          },
+          "sort":[{
+            "sortname":"默认",
+            "sorted":1,
+            "sortid":56,
+            "reversed":1
+          }],
         }
       },
       visible:false
@@ -98,6 +106,11 @@ export default {
       this.visible = false
       this.form.enterprisename = row.enterprisename
       this.$emit('rowClick',row)
+    },
+    onSuccess () {
+      this.queryEnterpriseArchives()
+      this.form.enterprisename = this.ENlist[0].enterprisename
+      this.$emit('rowClick',this.ENlist[0])
     }
   },
   mounted () {

+ 3 - 1
src/template/selectLogisticcom/index.vue

@@ -60,7 +60,9 @@ export default {
       logisticcomlist:[],
       total:0,
       currentPage:0,
-      form:{},
+      form:{
+        abbreviation:''
+      },
       params:{
         "id": 20221121135804,
         "content": {

+ 0 - 4
src/views/login/login.vue

@@ -98,10 +98,6 @@ export default {
       this.loginForm.phonenumber = localStorage.getItem('phonenumber')
       this.checked = true
     }
-    // 通过microapp访问时用到,其他情况下无效
-    if (window.microApp) {
-      this.$router.push('/accounts')
-    }
   },
   methods:{
     //验证码请求