Browse Source

销售预测和项目目标

qymljy 3 years ago
parent
commit
3dc025a18a

+ 4 - 5
src/HManagement/clueManage/clue_public/modules/detail.vue

@@ -265,15 +265,14 @@ export default {
         ],
         systemInfo: [
           {label:'创建人',value:this.mainData.createBy},
-          {label:'分配人',value:this.mainData.assignedBy},
-          {label:'最近跟进人',value:this.mainData.followBy},
-          {label:'转移人',value:this.mainData.changeBy},
-          {label:'最近编辑人',value:this.mainData.editBy},
           {label:'创建时间',value:this.mainData.createDate},
+          {label:'分配人',value:this.mainData.assignedBy},
           {label:'分配时间',value:this.mainData.assignedDate},
+          {label:'最近跟进人',value:this.mainData.followBy},
           {label:'最近跟进时间',value:this.mainData.followDate},
-          {label:'最近转移时间',value:this.mainData.changeDate},
+          {label:'最近编辑人',value:this.mainData.editBy},
           {label:'最近编辑时间',value:this.mainData.editDate},
+          {label:'转化次数',value:this.mainData.isproject === 0 && this.mainData.iscustomer === 0?'0':this.mainData.isproject + this.mainData.iscustomer },
         ]
       }
     },

+ 35 - 15
src/HManagement/personalTarget/target/modules/edit/components/editTarget.vue

@@ -1,8 +1,16 @@
 <template>
   <div>
     <el-button  size="small" type="text" :disabled="disabled" @click="onShow(dialogTableVisible = true)">编 辑</el-button>
-    <el-dialog title="编辑人员目标" append-to-body :visible.sync="dialogTableVisible" width="90%" top="20px">
-      <el-row :gutter="40">
+    <el-drawer
+        title="编辑人员目标"
+        :visible.sync="dialogTableVisible"
+        size="90%"
+        direction="rtl"
+        append-to-body
+        :show-close="false"
+        @close="dialogTableVisible = false">
+      <div class="drawer__panel">
+        <el-row :gutter="40">
         <el-form :model="form" :disabled="date.year > year" label-position="right" label-width="80px" size="small">
           <el-col :span="6">
             <el-form-item label="年度">
@@ -45,12 +53,12 @@
               <el-row :gutter="20">
                 <el-col :span="12">
                   <el-form-item label="基本目标">
-                    <el-input type="number" v-model="form[`m${1+index * 3}l`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off"></el-input>
+                    <el-input type="number" v-model="form[`m${1+index * 3}l`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off" @change="changeData()"></el-input>
                   </el-form-item>
                 </el-col>
                 <el-col :span="12">
                   <el-form-item label="挑战目标">
-                    <el-input type="number" v-model="form[`m${1+index * 3}h`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off"></el-input>
+                    <el-input type="number" v-model="form[`m${1+index * 3}h`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off" @change="changeData()"></el-input>
                   </el-form-item>
                 </el-col>
               </el-row>
@@ -59,12 +67,12 @@
               <el-row :gutter="20">
                 <el-col :span="12">
                   <el-form-item label="基本目标">
-                    <el-input type="number" v-model="form[`m${2+index * 3}l`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off"></el-input>
+                    <el-input type="number" v-model="form[`m${2+index * 3}l`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off" @change="changeData()"></el-input>
                   </el-form-item>
                 </el-col>
                 <el-col :span="12">
                   <el-form-item label="挑战目标">
-                    <el-input type="number" v-model="form[`m${2+index * 3}h`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off"></el-input>
+                    <el-input type="number" v-model="form[`m${2+index * 3}h`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off" @change="changeData()"></el-input>
                   </el-form-item>
                 </el-col>
               </el-row>
@@ -73,12 +81,12 @@
               <el-row :gutter="20">
                 <el-col :span="12">
                   <el-form-item label="基本目标">
-                    <el-input type="number" v-model="form[`m${3+index * 3}l`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off"></el-input>
+                    <el-input type="number" v-model="form[`m${3+index * 3}l`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off" @change="changeData()"></el-input>
                   </el-form-item>
                 </el-col>
                 <el-col :span="12">
                   <el-form-item label="挑战目标">
-                    <el-input type="number" v-model="form[`m${3+index * 3}h`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off"></el-input>
+                    <el-input type="number" v-model="form[`m${3+index * 3}h`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off" @change="changeData()"></el-input>
                   </el-form-item>
                 </el-col>
               </el-row>
@@ -86,11 +94,12 @@
           </div>
         </el-form>
       </el-row>
-      <div class="dialog-footer">
+      </div>
+      <div class="fixed__btn__panel">
         <el-button size="small" @click="dialogTableVisible = false" class="normal-btn-width">取 消</el-button>
-        <el-button size="small" type="warning" @click="onSubmit" class="normal-btn-width">确 定</el-button>
+        <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
       </div>
-    </el-dialog>
+    </el-drawer>
   </div>
 </template>
 
@@ -118,14 +127,25 @@ export default {
         year:date.getFullYear(),
         month:date.getMonth() + 1
       }
+      console.log(this.data,"数据")
+      console.log(this.year,"年")
+    },
+    changeData(){
+      console.log("执行数据")
+      for (var i = 0 ; i< 4 ; i++) {
+        this.form[`s${i + 1}l`] = parseFloat(this.form[`m${1 + i*3}l`])  + parseFloat(this.form[`m${2 + i*3}l`]) + parseFloat(this.form[`m${3 + i*3}l`])
+        this.form[`s${i + 1}h`] = parseFloat(this.form[`m${1 + i*3}h`]) + parseFloat(this.form[`m${2 + i*3}h`]) + parseFloat(this.form[`m${3 + i*3}h`])
+      }
+      this.form.y1l = parseFloat(this.form.s1l) + parseFloat(this.form.s2l) + parseFloat(this.form.s3l) + parseFloat(this.form.s4l)
+      this.form.y1h = parseFloat(this.form.s1h) + parseFloat(this.form.s2h) + parseFloat(this.form.s3h) + parseFloat(this.form.s4h)
     },
     async onSubmit () {
       for (var i = 0 ; i< 4 ; i++) {
-        this.form[`s${i + 1}l`] = this.form[`m${1 + i*3}l`] + this.form[`m${2 + i*3}l`] + this.form[`m${3 + i*3}l`]
-        this.form[`s${i + 1}h`] = this.form[`m${1 + i*3}h`] + this.form[`m${2 + i*3}h`] + this.form[`m${3 + i*3}h`]
+        this.form[`s${i + 1}l`] = parseFloat(this.form[`m${1 + i*3}l`])  + parseFloat(this.form[`m${2 + i*3}l`]) + parseFloat(this.form[`m${3 + i*3}l`])
+        this.form[`s${i + 1}h`] = parseFloat(this.form[`m${1 + i*3}h`]) + parseFloat(this.form[`m${2 + i*3}h`]) + parseFloat(this.form[`m${3 + i*3}h`])
       }
-      this.form.y1l = this.form.s1l + this.form.s2l + this.form.s3l + this.form.s4l
-      this.form.y1h = this.form.s1h + this.form.s2h + this.form.s3h + this.form.s4h
+      this.form.y1l = parseFloat(this.form.s1l) + parseFloat(this.form.s2l) + parseFloat(this.form.s3l) + parseFloat(this.form.s4l)
+      this.form.y1h = parseFloat(this.form.s1h) + parseFloat(this.form.s2h) + parseFloat(this.form.s3h) + parseFloat(this.form.s4h)
       const res = await this.$api.requested({
         "id": 20220902162902,
         "content": this.form

+ 154 - 0
src/HManagement/personalTarget/target/modules/edit/components/editTargetCopy.vue

@@ -0,0 +1,154 @@
+<template>
+  <div>
+    <el-button  size="small" type="text" :disabled="disabled" @click="onShow(dialogTableVisible = true)">编 辑</el-button>
+    <el-dialog title="编辑人员目标" append-to-body :visible.sync="dialogTableVisible" width="90%" top="20px">
+      <el-row :gutter="40">
+        <el-form :model="form" :disabled="date.year > year" label-position="right" label-width="80px" size="small">
+          <el-col :span="6">
+            <el-form-item label="年度">
+              <el-input v-model="year" disabled autocomplete="off"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="基本目标">
+              <el-input v-model="form['y1l']" disabled autocomplete="off"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="挑战目标">
+              <el-input v-model="form['y1h']" disabled autocomplete="off"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="单位">
+              <p>万元</p>
+            </el-form-item>
+          </el-col>
+
+          <div v-for="(i,index) in 4" :key="index">
+            <el-col :span="24"><p class="normal-margin normal-title">第{{index+1===1?'一':index+1===2?'二':index+1===3?'三':'四'}}季度</p></el-col>
+            <el-col :span="8">
+              <el-form-item label="基本目标">
+                <el-input v-model="form[`s${index+1}l`]" disabled autocomplete="off"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="挑战目标">
+                <el-input v-model="form[`s${index+1}l`]" disabled autocomplete="off"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24"></el-col>
+            <el-col :span="8" class="normal-margin">{{index+1===1?'一月':index+1===2?'四月':index+1===3?'七月':'十月'}}:</el-col>
+            <el-col :span="8" class="normal-margin">{{index+1===1?'二月':index+1===2?'五月':index+1===3?'八月':'十一月'}}:</el-col>
+            <el-col :span="8" class="normal-margin">{{index+1===1?'三月':index+1===2?'六月':index+1===3?'九月':'十二月'}}:</el-col>
+            <el-col :span="8">
+              <el-row :gutter="20">
+                <el-col :span="12">
+                  <el-form-item label="基本目标">
+                    <el-input type="number" v-model="form[`m${1+index * 3}l`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off" @change="changeData()"></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="挑战目标">
+                    <el-input type="number" v-model="form[`m${1+index * 3}h`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off" @change="changeData()"></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </el-col>
+            <el-col :span="8">
+              <el-row :gutter="20">
+                <el-col :span="12">
+                  <el-form-item label="基本目标">
+                    <el-input type="number" v-model="form[`m${2+index * 3}l`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off" @change="changeData()"></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="挑战目标">
+                    <el-input type="number" v-model="form[`m${2+index * 3}h`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off" @change="changeData()"></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </el-col>
+            <el-col :span="8">
+              <el-row :gutter="20">
+                <el-col :span="12">
+                  <el-form-item label="基本目标">
+                    <el-input type="number" v-model="form[`m${3+index * 3}l`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off" @change="changeData()"></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="挑战目标">
+                    <el-input type="number" v-model="form[`m${3+index * 3}h`]" :disabled="date.month  > (1+index * 3) && date.year > year" autocomplete="off" @change="changeData()"></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </el-col>
+          </div>
+        </el-form>
+      </el-row>
+      <div class="dialog-footer">
+        <el-button size="small" @click="dialogTableVisible = false" class="normal-btn-width">取 消</el-button>
+        <el-button size="small" type="warning" @click="onSubmit" class="normal-btn-width">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['data','year','disabled'],
+  data () {
+    return {
+      dialogTableVisible:false,
+      form:{
+        name:'123'
+      },
+      date:{
+        year:'',
+        month:''
+      }
+    }
+  },
+  methods:{
+    onShow () {
+      this.form = Object.assign({},this.form,this.data)
+      this.form.sa_salestargetbillid = this.$route.query.id
+      let date = new Date()
+      this.date = {
+        year:date.getFullYear(),
+        month:date.getMonth() + 1
+      }
+      console.log(this.data,"数据")
+      console.log(this.year,"年")
+    },
+    changeData(){
+      console.log("执行数据")
+      for (var i = 0 ; i< 4 ; i++) {
+        this.form[`s${i + 1}l`] = parseFloat(this.form[`m${1 + i*3}l`])  + parseFloat(this.form[`m${2 + i*3}l`]) + parseFloat(this.form[`m${3 + i*3}l`])
+        this.form[`s${i + 1}h`] = parseFloat(this.form[`m${1 + i*3}h`]) + parseFloat(this.form[`m${2 + i*3}h`]) + parseFloat(this.form[`m${3 + i*3}h`])
+      }
+      this.form.y1l = parseFloat(this.form.s1l) + parseFloat(this.form.s2l) + parseFloat(this.form.s3l) + parseFloat(this.form.s4l)
+      this.form.y1h = parseFloat(this.form.s1h) + parseFloat(this.form.s2h) + parseFloat(this.form.s3h) + parseFloat(this.form.s4h)
+    },
+    async onSubmit () {
+      for (var i = 0 ; i< 4 ; i++) {
+        this.form[`s${i + 1}l`] = parseFloat(this.form[`m${1 + i*3}l`])  + parseFloat(this.form[`m${2 + i*3}l`]) + parseFloat(this.form[`m${3 + i*3}l`])
+        this.form[`s${i + 1}h`] = parseFloat(this.form[`m${1 + i*3}h`]) + parseFloat(this.form[`m${2 + i*3}h`]) + parseFloat(this.form[`m${3 + i*3}h`])
+      }
+      this.form.y1l = parseFloat(this.form.s1l) + parseFloat(this.form.s2l) + parseFloat(this.form.s3l) + parseFloat(this.form.s4l)
+      this.form.y1h = parseFloat(this.form.s1h) + parseFloat(this.form.s2h) + parseFloat(this.form.s3h) + parseFloat(this.form.s4h)
+      const res = await this.$api.requested({
+        "id": 20220902162902,
+        "content": this.form
+      })
+      this.tool.showMessage(res,()=>{
+        this.$emit('onSuccess')
+        this.dialogTableVisible = false
+      })
+    }
+  }
+}
+
+</script>
+<style>
+</style>

+ 1 - 1
src/HManagement/personalTarget/target/modules/edit/index.vue

@@ -29,7 +29,7 @@
       <div slot="slot0">
         <targetTable ref="list" class="container normal-panel">
           <template  v-slot:editTarget="scope">
-            <editTarget v-if="tool.checkAuth($route.name,'personalTargetManage')" :disabled="mainData.status != '新建'" style="display:inline" :year="mainInfo.year" :data="scope.data" @onSuccess="onSuccess"></editTarget>
+            <editTarget v-if="tool.checkAuth($route.name,'personalTargetManage')" :disabled="mainData.status != '新建'" style="display:inline" :year="mainData.year" :data="scope.data" @onSuccess="onSuccess"></editTarget>
           </template>
 <!--          <template  v-slot:del="scope">
             <ondel v-if="tool.checkAuth($route.name,'delete')" :data="scope.data" @onSuccess="onSuccess"></ondel>

+ 2 - 1
src/HManagement/salesForecastTemplate/modules/add.vue

@@ -184,11 +184,12 @@ export default {
           "where":{
             "condition":"",
             "usertype":"",
-            "issystem":1
+            "issystem":""
           }
         }
       })
       this.rolelist = res.data
+      console.log(res,"权限数据")
     },
     addperiod () {
       this.sdList = [...this.sdList,...[this.addDate]]

+ 3 - 2
src/SManagement/orderclue/components/follow.vue

@@ -6,7 +6,7 @@
         <el-form :model="param" :rules="rules" ref="ruleForm" label-width="110px" class="demo-ruleForm"
           label-position="right">
           <el-form-item label="跟进时间">
-            <el-date-picker v-model="timer" type="date" format="yyyy-MM-dd" size="small">
+            <el-date-picker v-model="timer" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" size="small">
             </el-date-picker>
           </el-form-item>
           <el-form-item label="本次跟进方式" prop="followupmode">
@@ -130,7 +130,8 @@ export default {
       this.$refs.ruleForm.validate(async val => {
         if (!val) return
         this.param.sat_orderclueid = this.detailInfo.sat_orderclueid
-        this.param.createdate = `${this.timer.getFullYear()}-${this.timer.getMonth() + 1}-${this.timer.getDate()}`
+        this.param.createdate = this.timer
+        /*this.param.createdate = `${this.timer.getFullYear()}-${this.timer.getMonth() + 1}-${this.timer.getDate()}`*/
         let res = await this.$api.requested({
           "id":20221208100602,
           "content": this.param

+ 4 - 4
src/SManagement/orderclue_detail/index.vue

@@ -272,14 +272,14 @@ export default {
         ],
         systemInfo: [
           {label:'创建人',value:this.mainData.createBy},
-          {label:'分配人',value:this.mainData.assignedBy},
-          {label:'最近跟进人',value:this.mainData.followBy},
-          {label:'最近编辑人',value:this.mainData.editBy},
           {label:'创建时间',value:this.mainData.createDate},
+          {label:'分配人',value:this.mainData.assignedBy},
           {label:'分配时间',value:this.mainData.assignedDate},
+          {label:'最近跟进人',value:this.mainData.followBy},
           {label:'最近跟进时间',value:this.mainData.followDate},
+          {label:'最近编辑人',value:this.mainData.editBy},
           {label:'最近编辑时间',value:this.mainData.editDate},
-          {label:'转化次数',value:this.mainData.changecount},
+          {label:'转化次数',value:this.mainData.isproject === 0 && this.mainData.iscustomer === 0?'0':this.mainData.isproject + this.mainData.iscustomer },
         ]
       }
     },

+ 1 - 1
src/SManagement/project_target/modules/components/delProject.vue

@@ -16,7 +16,7 @@ export default {
   methods:{
     onShow(){
       console.log(this.data)
-      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
+      this.$confirm('确定删除该项目嘛?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'

+ 97 - 0
src/SManagement/project_target/modules/components/projectAdd/index copy.vue

@@ -0,0 +1,97 @@
+<template>
+  <div>
+    <el-button size="mini"  type="primary" @click="dialogTableVisible = true" :disabled="disabled">添加项目</el-button>
+    <el-dialog
+        title="添加项目"
+        :visible.sync="dialogTableVisible"
+        width="20%"
+        append-to-body
+        @close="onCancel"
+    >
+      <div class="panel_Target">
+        <el-row style="margin-top: 3%">
+          <el-col :span="4" :offset="1">
+            <div style="width: 100%;text-align: right">
+              <label class="normal-margin inline-16" style="margin-top: 8%">项目名称:</label>
+            </div>
+          </el-col>
+          <el-col :span="18">
+            <el-input v-model="form.projectname" size="small" placeholder="请选择项目" @focus="projectList"></el-input>
+          </el-col>
+        </el-row>
+      </div>
+      <div class="dialog-footer ">
+        <el-button size="small" @click="onCancel" class="normal-btn-width">取 消</el-button>
+        <el-button size="small" type="primary"  @click="onSubmit" class="normal-btn-width">确 定</el-button>
+      </div>
+    </el-dialog>
+    <project :visible="visible" v-if="visible" @onProject="onProject"></project>
+  </div>
+</template>
+
+<script>
+import project from '../../components/projectAdd/project'
+export default {
+  name: "index",
+  components:{project},
+  props:["id","year","disabled"],
+  data(){
+    return {
+      dialogTableVisible:false,
+      visible:false,
+      form:{
+        projectname:'',
+        sa_projectid:''
+      }
+    }
+  },
+  methods:{
+    onCancel(){
+
+    },
+    async onSubmit(){
+      const res = await this.$api.requested({
+        "id": 20220905154102,
+        "content": {
+          "year": this.year,
+          "hrid": this.id,
+          /*"sa_salestargetbillid":2,//可不传*/
+          "project": [
+            {
+              "sa_projectid": this.form.sa_projectid,
+            },
+          ]
+        },
+      })
+      this.tool.showMessage(res,()=>{
+        this.dialogTableVisible = false
+        this.$emit("onSuccess")
+      })
+    },
+    projectList(){
+      this.visible = true
+    },
+    onProject(data){
+      this.visible = false
+      console.log("获取")
+      console.log(data)
+      this.form.sa_projectid = data.sa_projectid
+      this.form.projectname = data.projectname
+     /* this.project = data*/
+      console.log("项目详细信息")
+      console.log(this.project)
+    },
+  }
+}
+</script>
+
+<style scoped>
+.el-pagination {
+  text-align: right;
+}
+.panel_Target {
+  border-top:1px solid #eeeeee;
+  padding:5px 5px;
+  margin-bottom:0px
+}
+</style>

+ 19 - 24
src/SManagement/project_target/modules/components/projectAdd/index.vue

@@ -1,31 +1,26 @@
 <template>
   <div>
-    <el-button size="mini"  type="primary" @click="dialogTableVisible = true" :disabled="disabled">添加项目</el-button>
-    <el-dialog
+    <el-button size="mini"  type="primary" @click="visible = true" :disabled="disabled">添加项目</el-button>
+    <el-drawer
         title="添加项目"
-        :visible.sync="dialogTableVisible"
-        width="20%"
+        :visible.sync="visible"
+        size="800px"
+        direction="rtl"
         append-to-body
-        @close="onCancel"
-    >
-      <div class="panel_Target">
-        <el-row style="margin-top: 3%">
-          <el-col :span="4" :offset="1">
-            <div style="width: 100%;text-align: right">
-              <label class="normal-margin inline-16" style="margin-top: 8%">项目名称:</label>
-            </div>
-          </el-col>
-          <el-col :span="18">
-            <el-input v-model="form.projectname" size="small" placeholder="请选择项目" @focus="projectList"></el-input>
-          </el-col>
+        :show-close="false"
+        @close="visible = false">
+      <div class="drawer__panel">
+        <el-row>
+            <el-col :span="24">
+              <project :visible="visible" v-if="visible" @onProject="onSubmit"></project>
+            </el-col>
         </el-row>
       </div>
-      <div class="dialog-footer ">
-        <el-button size="small" @click="onCancel" class="normal-btn-width">取 消</el-button>
-        <el-button size="small" type="primary"  @click="onSubmit" class="normal-btn-width">确 定</el-button>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="visible = false" class="normal-btn-width">取 消</el-button>
+<!--        <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>-->
       </div>
-    </el-dialog>
-    <project :visible="visible" v-if="visible" @onProject="onProject"></project>
+    </el-drawer>
   </div>
 </template>
 
@@ -49,7 +44,7 @@ export default {
     onCancel(){
 
     },
-    async onSubmit(){
+    async onSubmit(val){
       const res = await this.$api.requested({
         "id": 20220905154102,
         "content": {
@@ -58,13 +53,13 @@ export default {
           /*"sa_salestargetbillid":2,//可不传*/
           "project": [
             {
-              "sa_projectid": this.form.sa_projectid,
+              "sa_projectid": val.sa_projectid,
             },
           ]
         },
       })
       this.tool.showMessage(res,()=>{
-        this.dialogTableVisible = false
+        this.visible = false
         this.$emit("onSuccess")
       })
     },

+ 116 - 0
src/SManagement/project_target/modules/components/projectAdd/project copy.vue

@@ -0,0 +1,116 @@
+<template>
+  <div>
+    <el-dialog
+        title="新 建"
+        :visible.sync="dialogProjectVisible"
+        width="35%"
+        append-to-body
+    >
+      <div slot="title" style="font-size: 15px">
+        添加项目
+      </div>
+      <el-input placeholder="请输入编号/项目名称"  suffix-icon="el-icon-search" @input="listData(params.content.pageNumber = 1)" v-model="params.content.where.condition" @keyup.native.enter="listData(params.content.pageNumber = 1)" @clear="listData(params.content.pageNumber = 1)" style="width:300px;margin-bottom: 10px" size="small" class="input-with-select inline-16" clearable>
+      </el-input>
+      <layout_table
+          :layout="tablecols"
+          :data="list"
+          :opwidth="200"
+          :custom="false"
+          :height="320"
+          :checkbox="true"
+          @onRow="onRow">
+      </layout_table>
+
+      <div style="margin-top:16px;text-align:right">
+        <el-pagination
+            background
+            small
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-size="params.content.pageSize"
+            layout="total, prev, pager, next, jumper"
+            :total="total">
+        </el-pagination>
+      </div>
+      <div class="dialog-footer">
+        <el-button size="small" @click="onColes" class="normal-btn-width">取 消</el-button>
+        <el-button size="small" type="warning" class="normal-btn-width btn-warning"  @click="onSubmit">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import layout_table from '../projectAdd/table'
+export default {
+  name: "project",
+  props:["visible"],
+  data(){
+    return {
+      dialogProjectVisible:false,
+      bill_id:"",
+      tablecols:[],
+      list:[],
+      total:0,
+      currentPage:0,
+      row:"",
+      params:{
+        "id": 20220905151902,
+        "content": {
+          "where": {
+            "condition": ""
+          }
+        },
+      }
+    }
+  },
+  components:{layout_table},
+  mounted() {
+    console.log(this.visible)
+    this.dialogProjectVisible = true
+    this.listData()
+  },
+  methods:{
+    async listData(){
+      const res = await this.$api.requested(this.params)
+      this.list = res.data
+      this.total = res.total
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.params.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.params.content.pageNumber = val
+      this.listData()
+    },
+    onColes(){
+      this.dialogProjectVisible = false
+      this.$emit("onProject")
+    },
+    onRow(row){
+      console.log("**********************---------------------")
+      console.log(row)
+      this.row = row
+    },
+    onSubmit(){
+      console.log("**********************---------------------")
+      this.dialogProjectVisible = false
+      this.$emit("onProject",this.row)
+      console.log(this.row)
+    }
+
+  },
+
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).projectTable.tablecols
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 36 - 28
src/SManagement/project_target/modules/components/projectAdd/project.vue

@@ -1,26 +1,34 @@
 <template>
   <div>
-    <el-dialog
-        title="新 建"
-        :visible.sync="dialogProjectVisible"
-        width="35%"
-        append-to-body
-    >
-      <div slot="title" style="font-size: 15px">
-        添加项目
-      </div>
-      <el-input placeholder="请输入编号/项目名称"  suffix-icon="el-icon-search" @input="listData(params.content.pageNumber = 1)" v-model="params.content.where.condition" @keyup.native.enter="listData(params.content.pageNumber = 1)" @clear="listData(params.content.pageNumber = 1)" style="width:300px;margin-bottom: 10px" size="small" class="input-with-select inline-16" clearable>
+      <el-input placeholder="请输入编号/项目名称"  suffix-icon="el-icon-search" @input="listData(params.content.pageNumber = 1)" v-model="params.content.where.condition" @keyup.native.enter="listData(params.content.pageNumber = 1)" @clear="listData(params.content.pageNumber = 1)" style="width:300px;margin-bottom: 20px" size="small" class="input-with-select inline-16" clearable>
       </el-input>
-      <layout_table
-          :layout="tablecols"
-          :data="list"
-          :opwidth="200"
-          :custom="false"
-          :height="320"
-          :checkbox="true"
-          @onRow="onRow">
-      </layout_table>
-
+    <el-table
+        :data="list"
+        style="width: 100%"
+        size="mini"
+        border>
+      <el-table-column
+          prop="projectnum"
+          label="项目编号"
+          width="180">
+      </el-table-column>
+      <el-table-column
+          prop="projectname"
+          label="项目名称"
+          width="180">
+      </el-table-column>
+      <el-table-column
+          prop="address"
+          label="项目地址">
+      </el-table-column>
+      <el-table-column
+          label="操作"
+          width="90">
+        <template slot-scope="scope">
+          <el-button type="text" size="mini" @click="addProject(scope.row)">添 加</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
       <div style="margin-top:16px;text-align:right">
         <el-pagination
             background
@@ -29,15 +37,11 @@
             @current-change="handleCurrentChange"
             :current-page="currentPage"
             :page-size="params.content.pageSize"
-            layout="total, prev, pager, next, jumper"
+            :page-sizes="[20, 50, 100, 200]"
+            layout="total,sizes, prev, pager, next, jumper"
             :total="total">
         </el-pagination>
       </div>
-      <div class="dialog-footer">
-        <el-button size="small" @click="onColes" class="normal-btn-width">取 消</el-button>
-        <el-button size="small" type="warning" class="normal-btn-width btn-warning"  @click="onSubmit">确 定</el-button>
-      </div>
-    </el-dialog>
   </div>
 </template>
 
@@ -101,13 +105,17 @@ export default {
       this.dialogProjectVisible = false
       this.$emit("onProject",this.row)
       console.log(this.row)
+    },
+    addProject(val){
+      console.log(val,"选择的项目")
+      this.$emit("onProject",val)
     }
 
   },
 
-  created() {
+  /*created() {
     this.tablecols = this.tool.tabelCol(this.$route.name).projectTable.tablecols
-  }
+  }*/
 }
 </script>
 

+ 18 - 9
src/SManagement/project_target/modules/detailInfo.vue

@@ -243,15 +243,7 @@ export default {
       const month = dateNow.getMonth() +1
       const datenow = new Date()
         if (dateNow.getFullYear() !== datenow.getFullYear()){
-          this.$alert('只能选取今年的月份,请重新进行选择', '标题名称', {
-            confirmButtonText: '确定',
-            callback: action => {
-              this.$message({
-                type: 'info',
-                message: `重新选择月份`
-              });
-            }
-          });
+          this.open()
       }else {
         console.log(month)
         this.saveShow = false
@@ -271,6 +263,23 @@ export default {
         })
       }
 
+    },
+    open() {
+      this.$confirm('只能填写目标年度的月份!', '提示', {
+        confirmButtonText: '确定',
+        showCancelButton:false,
+        type: 'warning'
+      }).then(() => {
+        this.$message({
+          type: 'success',
+          message: '请重新填写!'
+        });
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
     }
   },
   created() {

+ 4 - 2
src/SManagement/sales_forecast/modules/product.vue

@@ -192,10 +192,12 @@ export default {
             })
           }
         })
-        this.tool.showMessage(res,()=>{
+        this.listData()
+        this.$emit('onSuccess')
+        /*this.tool.showMessage(res,()=>{
           this.listData()
           this.$emit('onSuccess')
-        })
+        })*/
       },1000)
      
       

+ 7 - 6
src/template/salesForecastUseProject/addProduct.vue

@@ -160,6 +160,7 @@ export default {
       this.listData()
     },
     async addProduct (row) {
+      console.log(row,"添加商品")
       row.sa_salesforecastid = 0
       const res = await this.$api.requested({
         "id": 20220906155003,
@@ -172,12 +173,12 @@ export default {
               "sa_salesforecastid":0,
               "itemid":row.itemid,
               "itemclassnum":'',
-              "orderqty": 0,
-              "orderamount": 0,
-              "invoiceqty": 0,
-              "invoiceamount": 0,
-              "outqty": 0,
-              "outamount": 0
+              "orderqty": 1,
+              "orderamount": row.marketprice,
+              "invoiceqty": 1,
+              "invoiceamount": row.marketprice,
+              "outqty": 1,
+              "outamount": row.marketprice
             }]
         }
       })