qymljy il y a 2 ans
Parent
commit
c93b249d81
23 fichiers modifiés avec 1269 ajouts et 79 suppressions
  1. 13 0
      src/HDrpManagement/invoicePredictionManage/details/index.vue
  2. 2 0
      src/HDrpManagement/invoicePredictionManage/index.vue
  3. 22 0
      src/HDrpManagement/invoicePredictionManage/modules/edit.vue
  4. 1 1
      src/HDrpManagement/predictionRule/index.vue
  5. 3 3
      src/HDrpManagement/predictionRule/modules/editMonth.vue
  6. 3 3
      src/HDrpManagement/predictionRule/modules/editWeek.vue
  7. 26 4
      src/HDrpManagement/projectPredictionManage/details/index.vue
  8. 263 26
      src/HDrpManagement/projectPredictionManage/details/modules/projectList.vue
  9. 85 2
      src/HDrpManagement/projectPredictionManage/details/modules/subordinate.vue
  10. 3 3
      src/HDrpManagement/projectPredictionManage/index.vue
  11. 51 0
      src/HDrpManagement/projectPredictionManage/modules/detailInfo.vue
  12. 0 15
      src/HDrpManagement/projectPredictionManage/modules/details.vue
  13. 0 14
      src/HDrpManagement/projectPredictionManage/modules/edit.vue
  14. 97 0
      src/SDrpManagement/projectPrediction/detail/index.vue
  15. 524 0
      src/SDrpManagement/projectPrediction/detail/projectList.vue
  16. 5 1
      src/SDrpManagement/projectPrediction/index.vue
  17. 69 0
      src/SDrpManagement/projectPrediction/modules/detailInfo.vue
  18. 72 0
      src/SDrpManagement/projectPrediction/modules/edit.vue
  19. 1 1
      src/components/newDetailTemp/index.vue
  20. 3 3
      src/components/table/index5.vue
  21. 12 1
      src/router/HDrpManagement.js
  22. 13 1
      src/router/SDrpManagement.js
  23. 1 1
      src/template/prediction/addProjectTemp.vue

+ 13 - 0
src/HDrpManagement/invoicePredictionManage/details/index.vue

@@ -0,0 +1,13 @@
+<template>
+5555
+</template>
+
+<script>
+export default {
+  name: "index"
+}
+</script>
+
+<style scoped>
+
+</style>

+ 2 - 0
src/HDrpManagement/invoicePredictionManage/index.vue

@@ -63,8 +63,10 @@
 </template>
 
 <script>
+import edit from './modules/edit'
 export default {
   name: "index",
+  components:{edit},
   data(){
     return {
       dateSelect:'',

+ 22 - 0
src/HDrpManagement/invoicePredictionManage/modules/edit.vue

@@ -0,0 +1,22 @@
+<template>
+  <div>
+    <el-button size="mini" type="text" @click="onShow">编 辑</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "edit",
+  methods:{
+    onShow(){
+      let query = {id:this.data.sa_salesforecastbillid,rowindex:this.data.rowindex}
+      this.$router.push({path:'/invoicePredictionManageDetail',query:query})
+      this.$store.dispatch('changeDetailDrawer',true)
+    },
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 1
src/HDrpManagement/predictionRule/index.vue

@@ -28,7 +28,7 @@
         </p>
       </template>
       <template v-slot:tbOpreation="scope">
-        <editWeek :data="scope.data.data" v-if="scope.data.data.periodtype == '周'" @onEdit="onEdit"></editWeek>
+        <editWeek :data="scope.data.data" v-if="scope.data.data.periodtype == '周'" @onEdit="onEdit" ></editWeek>
         <editMonth :data="scope.data.data" v-if="scope.data.data.periodtype == '月'" @onEdit="onEdit"></editMonth>
       </template>
     </basicLayout>

+ 3 - 3
src/HDrpManagement/predictionRule/modules/editMonth.vue

@@ -67,13 +67,13 @@
                         label="部门">
                     </el-table-column>
                     <el-table-column
-                        prop="parentname"
+                        prop="pardepname"
                         label="上级部门">
                     </el-table-column>
                     <el-table-column
                         label="操作">
                       <template slot-scope="scope">
-                        <el-button type="text" size="mini" @click="delDepartment(scope.row)">删 除</el-button>
+                        <el-button type="text" size="mini" @click="delDepartment(scope.row)" :disabled="data.status === '开启'">删 除</el-button>
                       </template>
                     </el-table-column>
                   </el-table>
@@ -109,7 +109,7 @@
                 <el-table-column
                     label="操作">
                   <template slot-scope="scope">
-                    <el-button type="text" size="mini" @click="delPerson(scope.row)">删 除</el-button>
+                    <el-button type="text" size="mini" @click="delPerson(scope.row)" :disabled="data.status === '开启'">删 除</el-button>
                   </template>
                 </el-table-column>
               </el-table>

+ 3 - 3
src/HDrpManagement/predictionRule/modules/editWeek.vue

@@ -67,13 +67,13 @@
                         label="部门">
                     </el-table-column>
                     <el-table-column
-                        prop="parentname"
+                        prop="pardepname"
                         label="上级部门">
                     </el-table-column>
                     <el-table-column
                         label="操作">
                       <template slot-scope="scope">
-                        <el-button type="text" size="mini" @click="delDepartment(scope.row)">删 除</el-button>
+                        <el-button type="text" size="mini" :disabled="data.status === '开启'" @click="delDepartment(scope.row)">删 除</el-button>
                       </template>
                     </el-table-column>
                   </el-table>
@@ -109,7 +109,7 @@
                 <el-table-column
                     label="操作">
                   <template slot-scope="scope">
-                    <el-button type="text" size="mini" @click="delPerson(scope.row)">删 除</el-button>
+                    <el-button type="text" size="mini" @click="delPerson(scope.row)" :disabled="data.status === '开启'">删 除</el-button>
                   </template>
                 </el-table-column>
               </el-table>

+ 26 - 4
src/HDrpManagement/projectPredictionManage/details/index.vue

@@ -2,7 +2,7 @@
  <div>
    <newDetails :titleText="mainData.title" :mainAreaData="mainAreaData" idname="sa_salesforecastbillid" :editData="mainData" :tabs="['项目产品清单']" >
      <template #bottomLeft>
-       <div style="height: calc(100vh - 180px)">
+       <div style="height: calc(96vh)">
          <p>预测单汇总</p>
          <el-divider></el-divider>
          <el-row>
@@ -54,7 +54,7 @@
                  <p v-else>{{scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname]:'--'}}</p>
                </template>
                <template v-slot:opreation="scope">
-                 <el-button size="mini" type="text" v-if="scope.data.sa_salesforecastbillid">详 情</el-button>
+                 <el-button size="mini" type="text" v-if="scope.data.sa_salesforecastbillid" @click="goDetail(scope.data)">详 情</el-button>
                </template>
              </tableList>
            </el-row>
@@ -75,9 +75,20 @@
        <div style="height: calc(100vh - 280px)"></div>
      </template>-->
      <div slot="slot0" class=" normal-panel">
-       <projectList></projectList>
+       <projectList @onSuccess="onSuccess" :id="$route.query.id" :isDisabled="$route.query.isDetail == 1 ?true:false" ></projectList>
      </div>
    </newDetails>
+   <el-drawer
+       :visible.sync="drawer"
+       :with-header="false"
+       direction="rtl"
+       size="90%"
+       append-to-body
+   >
+     <div class="detail__panel">
+       <subordinateDetail :id="id" ref="subordinate"></subordinateDetail>
+     </div>
+   </el-drawer>
  </div>
 </template>
 
@@ -85,11 +96,14 @@
 import newDetails from '@/components/newDetailTemp/index'
 import tableList from '@/components/table/index5'
 import projectList from './modules/projectList'
+import subordinateDetail from './modules/subordinate'
 export default {
   name: "index",
-  components:{newDetails,tableList,projectList},
+  components:{newDetails,tableList,projectList,subordinateDetail},
   data(){
     return {
+      id:'',
+      drawer:false,
       mainAreaData:'',
       loading:'',
       mainData:"",
@@ -289,6 +303,14 @@ export default {
         this.range = ''
         this.listData()
       }
+    },
+    onSuccess(){
+      this.queryMainData()
+    },
+    goDetail(val){
+      console.log(val)
+      this.id = val.sa_salesforecastbillid
+      this.drawer = true
     }
   },
   mounted() {

+ 263 - 26
src/HDrpManagement/projectPredictionManage/details/modules/projectList.vue

@@ -1,8 +1,11 @@
 <template>
   <div>
-    <addProject ref="addProject" :param="paramProject" class="inline-16" @add="addProject" @adds="addProjects"></addProject>
-    <el-button :type="items.length > 0?'primary':''" size="small" @click="delProjects" :disabled="items.length === 0">删 除</el-button>
-    <tableList style="margin-top: 10px" :checkbox="true" :loading="loading" :layout="projectCols" :data="list" :opwidth="200" :custom="true"  fixedName="operation" @selectionChange="selectionChange">
+    <addProject v-if="!isDisabled" ref="addProject" :param="paramProject" class="inline-16" @add="addProject" @adds="addProjects"></addProject>
+    <el-button v-if="!isDisabled" :type="items.length > 0?'primary':''" size="small" @click="delProjects" class="inline-16" :disabled="items.length === 0">删 除</el-button>
+    <el-input  style="width:200px;" placeholder="搜索" :suffix-icon="projectParam.content.where.condition?projectParam.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="projectParam.content.where.condition" @keyup.native.enter="listData(projectParam.content.pageNumber = 1)" @clear="listData(projectParam.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
+    </el-input>
+    <tableList :height="'calc(90vh - 1050px)'" ref="projectRef" style="margin-top: 10px" :checkbox="true"  :layout="projectCols" :data="list" :opwidth="200" :custom="true"  fixedName="operation"
+               highlight-current-row @selectionChange="selectionChange" @rowClick="rowClick" >
       <template v-slot:customcol="scope">
         <div v-if="scope.column.columnname === 'operation'">
           <span>{{scope.column.data[scope.column.columnname]}}</span>
@@ -10,21 +13,77 @@
         <p v-else>{{scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname]:'--'}}</p>
       </template>
       <template v-slot:opreation="scope">
-        <el-button type="text" size="mini" @click="onProduct(scope.data)">添加产品</el-button>
-        <el-button size="mini" type="text" @click="delProject(scope.data)">删 除</el-button>
+        <el-button type="text" size="mini" @click="onProduct(scope.data)" :disabled="isDisabled">添加产品</el-button>
+        <el-button size="mini" type="text" @click="delProject(scope.data)" :disabled="isDisabled">删 除</el-button>
       </template>
     </tableList>
-    <tableList style="margin-top: 10px" :checkbox="true" :loading="loading" :layout="productCols" :data="productList" :opwidth="200" :custom="true"  fixedName="operation">
+    <div class=" container "  style="text-align:left;float: left">
+      <span style="font-size: 14px">预测金额: ¥{{tool.formatAmount(projectPrice,2)}}</span>
+    </div>
+    <div  class="container " style="text-align:right;float: right">
+      <el-pagination
+          background
+          @size-change="handleSizeChangeProject"
+          @current-change="handleCurrentChangeProject"
+          :current-page="projectParam.content.pageNumber"
+          :page-sizes="[20, 50, 100, 200]"
+          :page-size="20"
+          layout="total,sizes, prev, pager, next, jumper"
+          :total="totalProject">
+      </el-pagination>
+    </div>
+    <el-row>
+      <el-col :span="19">
+        <el-button v-if="!isDisabled" :type="itemsPro.length > 0?'primary':''" size="small" @click="delProducts" class="inline-16" :disabled="itemsPro.length === 0">删 除</el-button>
+        <el-input  style="width:200px;" placeholder="搜索" :suffix-icon="productParam.content.where.condition?productParam.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="productParam.content.where.condition" @keyup.native.enter="listData(productParam.content.pageNumber = 1)" @clear="listData(productParam.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
+        </el-input>
+      </el-col>
+      <el-col :span="5">
+        <el-input :disabled="isDisabled" style="width:100px;float: right" v-model="discountrate" placeholder="默认100" @change="discountrateChange(discountrate)">
+        </el-input>
+        <span style="float: right;line-height: 40px;height:40px;font-size:13px;vertical-align: auto">折扣(%):</span>
+      </el-col>
+    </el-row>
+
+    <tableList :height="'calc(90vh - 1750px)'" style="margin-top: 10px" :checkbox="true"  :layout="productCols" :data="productList" :opwidth="200" :custom="true"  fixedName="operation"
+               @selectionChange="selectionChangePro">
       <template v-slot:customcol="scope">
         <div v-if="scope.column.columnname === 'operation'">
           <span>{{scope.column.data[scope.column.columnname]}}</span>
         </div>
+        <div v-else-if="scope.column.columnname === 'orderqty'">
+          <span v-if="isDisabled">{{scope.column.data[scope.column.columnname]}}</span>
+          <span v-else>
+            <el-input-number size="mini" v-model="scope.column.data.orderqty" @change="onChange(scope.column.data.orderqty,scope.$index,scope.column.data)" :min="scope.column.data.orderminqty" :step="scope.column.data.orderaddqty"></el-input-number>
+          </span>
+        </div>
+        <div v-else-if="scope.column.columnname === 'price'">
+          <span v-if="isDisabled">{{scope.column.data[scope.column.columnname]}}</span>
+          <span v-else>
+            <el-input size="mini" v-model="scope.column.data.price" @change="priceChange(scope.column.data.price,scope.$index,scope.column.data)"></el-input>
+          </span>
+        </div>
         <p v-else>{{scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname]:'--'}}</p>
       </template>
       <template v-slot:opreation="scope">
-        <el-button size="mini" type="text" @click="delProduct(scope.data)">删 除</el-button>
+        <el-button size="mini" type="text" @click="delProduct(scope.data)" :disabled="isDisabled">删 除</el-button>
       </template>
     </tableList>
+    <div class=" container "  style="text-align:left;float: left">
+      <span style="font-size: 14px">预测金额: ¥{{tool.formatAmount(productPrice,2)}}</span>
+    </div>
+    <div  class="container " style="text-align:right;float: right">
+      <el-pagination
+          background
+          @size-change="handleSizeChangeProduct"
+          @current-change="handleCurrentChangeProduct"
+          :current-page="productParam.content.pageNumber"
+          :page-sizes="[20, 50, 100, 200]"
+          :page-size="20"
+          layout="total,sizes, prev, pager, next, jumper"
+          :total="totalProduct">
+      </el-pagination>
+    </div>
     <el-drawer
         title="添加商品"
         :visible.sync="dialogVisible"
@@ -34,7 +93,7 @@
         append-to-body
         >
       <addProduct ref="productRef" :params="paramProduct" :tablecolsAdd="tablecolsAdd" :querySa_brandid="brandid"
-                  :tradefield="tradefield" :discountrate="discountrate"  @addProduct="addProduct" @addSuccess="addProducts"></addProduct>
+                  :tradefield="tradefield"   @addProduct="addProduct" @addSuccess="addProducts"></addProduct>
     </el-drawer>
   </div>
 </template>
@@ -45,6 +104,7 @@ import addProject from '@/template/prediction/addProjectTemp'
 import addProduct from '@/template/prediction/addProductTemp'
 export default {
   name: "projectList",
+  props:['id','isDisabled'],
   components:{tableList,addProject,addProduct},
   data(){
     return {
@@ -52,7 +112,7 @@ export default {
       brandid:'',
       tradefield:'',
       sa_brandid:'',
-      discountrate:'',
+      discountrate:1,
       projectCols:[],
       productCols:[],
       tablecolsAdd:[],
@@ -60,11 +120,19 @@ export default {
       productList:[],
       loading:false,
       items:[],
+      itemsPro:[],
       selectProject:'',
+      selectProjectid:'',
+      totalProject:0,
+      totalProduct:0,
+      projectPrice:0,
+      productPrice:0,
       projectParam:{
         "id": 20230705144904,
         "content": {
-          "sa_salesforecastbillid":this.$route.query.id,
+          "sa_salesforecastbillid":this.id,
+          "pageNumber": 1,
+          "pageSize": 20,
           "where":{
             "condition":""
           }
@@ -74,6 +142,8 @@ export default {
         "id": 20230705145004,
         "content": {
           "sa_salesforecastprojectid": '',
+          "pageNumber": 1,
+          "pageSize": 20,
           "where":{
             "condition":""
           }
@@ -84,7 +154,7 @@ export default {
         "content": {
           "pageNumber": 1,
           "pageSize": 20,
-          "sa_salesforecastbillid":this.$route.query.id,
+          "sa_salesforecastbillid":this.id,
           "where": {
             "condition": ""
           }
@@ -95,32 +165,63 @@ export default {
         "content": {
           "pageNumber": 1,
           "pageSize": 20,
-          "sa_salesforecastbillid":this.$route.query.id,
+          "sa_salesforecastbillid":this.id,
           "sa_salesforecastprojectid":'',
           "sa_projectid":"",
           "where": {
             "condition": ""
           }
         }
-      }
+      },
+      currentRow: 0
     }
   },
   methods:{
-    /*项目列表*/
+    /*初始化项目列表*/
     async listData(){
       const res = await this.$api.requested(this.projectParam)
       this.list = res.data
+      this.totalProject = res.total
       this.selectProject = res.data[0].sa_salesforecastprojectid
+      this.selectProjectid = res.data[0].sa_projectid
+      this.$refs.projectRef.$refs.table.setCurrentRow(this.list[0])
+      if (res.data.length > 0){
+        this.projectPrice = res.data[0].sumprojectamount
+        this.discountrate = res.data[0].discountrate * 100
+      }else {
+        this.projectPrice = 0
+        this.discountrate = ''
+      }
       this.productData(res.data[0].sa_salesforecastprojectid)
     },
+    /*更改数据后项目列表*/
+    async projectData(){
+      const res = await this.$api.requested(this.projectParam)
+      this.list = res.data
+      if (res.data.length > 0){
+        this.projectPrice = res.data[0].sumprojectamount
+      }else {
+        this.projectPrice = 0
+      }
+      this.$refs.projectRef.$refs.table.setCurrentRow(this.list[this.currentRow])
+      this.productData(this.selectProject)
+    },
     /*产品列表*/
     async productData(id){
       this.productParam.content.sa_salesforecastprojectid = id
       const res = await this.$api.requested(this.productParam)
       this.productList = res.data
+      this.totalProduct = res.total
+      if (res.data.length > 0){
+        this.productPrice = res.data[0].sumorderamount
+      }else {
+        this.productPrice = 0
+      }
+
     },
     /*添加项目*/
     async addProject(id){
+      console.log(id,'项目id')
       const res = await this.$api.requested({
         "id": 20230705145104,
         "content": {
@@ -130,7 +231,7 @@ export default {
             {
               "sa_salesforecastprojectid": 0,
               "ownerid": id,
-              "discountrate": 0.1
+              "discountrate": 1
             }
           ]
         }
@@ -138,6 +239,7 @@ export default {
       this.tool.showMessage(res,()=>{
         this.projectParam.content.pageNumber = 1
         this.listData()
+        this.$emit('onSuccess')
       })
     },
     /*批量添加项目*/
@@ -153,6 +255,7 @@ export default {
       this.tool.showMessage(res,()=>{
         this.projectParam.content.pageNumber = 1
         this.listData()
+        this.$emit('onSuccess')
       })
     },
     /*删除项目*/
@@ -167,6 +270,7 @@ export default {
       this.tool.showMessage(res,()=>{
         this.projectParam.content.pageNumber = 1
         this.listData()
+        this.$emit('onSuccess')
       })
 
     },
@@ -193,14 +297,20 @@ export default {
     selectionChange(val){
       this.items = val
     },
+    /*勾选产品*/
+    selectionChangePro(val){
+      this.itemsPro = val
+    },
     /*添加产品*/
     onProduct(val){
       console.log(val,'项目信息')
+      this.selectProject = val.sa_salesforecastprojectid
+      this.selectProjectid = val.sa_projectid
       this.paramProduct.content.sa_salesforecastprojectid = val.sa_salesforecastprojectid
       this.paramProduct.content.sa_projectid = val.sa_projectid
       this.tradefield = val.tradefield
       this.sa_brandid = val.sa_brandid
-      this.discountrate = val.discountrate
+      this.discountrate = val.discountrate * 100
       this.dialogVisible = true
       this.$nextTick(()=>{
         this.$refs.productRef.onShow()
@@ -213,13 +323,13 @@ export default {
         "id": 20230705145204,
         "content": {
           "sa_salesforecastbillid": this.$route.query.id,
-          "sa_salesforecastprojectid": this.paramProduct.content.sa_salesforecastprojectid,
+          "sa_salesforecastprojectid": this.selectProject,
           "salesforecast": [
             {
               "itemid": val.itemid,
               "orderqty": val.qty,
-              "orderamount": val.orderamount,
-              "price": val.price,
+              "orderamount":(val.marketprice * (this.discountrate/100))*val.qty,
+              "price": val.marketprice * (this.discountrate / 100),
               "sa_salesforecastid":0
             }
           ]
@@ -227,18 +337,17 @@ export default {
       })
       this.tool.showMessage(res,()=>{
         this.dialogVisible = false
-        this.productData(this.selectProject)
+        this.onSuccess()
       })
     },
     async addProducts(val){
-      console.log(val,'需要添加的产品')
       let items = []
       items = val.map(item=>{
         return {
           "itemid": item.itemid,
           "orderqty": item.qty,
-          "orderamount": (item.marketprice * this.discountrate)*item.qty,
-          "price": item.marketprice * this.discountrate,
+          "orderamount": (item.marketprice * (this.discountrate /100))*item.qty,
+          "price": item.marketprice * (this.discountrate /100),
           "sa_salesforecastid":0
         }
       })
@@ -247,13 +356,13 @@ export default {
         "id": 20230705145204,
         "content": {
           "sa_salesforecastbillid": this.$route.query.id,
-          "sa_salesforecastprojectid": this.paramProduct.content.sa_salesforecastprojectid,
+          "sa_salesforecastprojectid": this.selectProject,
           "salesforecast": items
         }
       })
       this.tool.showMessage(res,()=>{
         this.dialogVisible = false
-        this.productData(this.selectProject)
+        this.onSuccess()
       })
     },
     /*删除商品*/
@@ -267,8 +376,136 @@ export default {
         }
       })
       this.tool.showMessage(res,()=>{
-        this.productData(this.selectProject)
+        this.onSuccess()
+      })
+    },
+    /*批量删除商品*/
+    async delProducts(){
+      console.log(this.itemsPro)
+      let ids = []
+      ids = this.itemsPro.map(item=>item.sa_salesforecastid)
+      console.log(ids)
+      const res = await this.$api.requested({
+        "id": 20230705145404,
+        "content": {
+          "sa_salesforecastbillid":this.$route.query.id,
+          "sa_salesforecastids":ids
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.itemsPro = []
+        this.productParam.content.pageNumber = 1
+        this.onSuccess()
+      })
+    },
+    onSuccess(){
+      this.projectData()
+      this.$emit('onSuccess')
+    },
+    rowClick(val){
+      console.log(val)
+      this.currentRow = val.rowindex -1
+      this.$refs.projectRef.$refs.table.setCurrentRow(this.list[this.currentRow])
+      this.selectProject = val.sa_salesforecastprojectid
+      this.selectProjectid = val.sa_projectid
+      this.discountrate = val.discountrate * 100
+      this.projectData()
+    },
+    handleSizeChangeProject(val) {
+      // console.log(`每页 ${val} 条`);
+      this.projectParam.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChangeProject(val) {
+      // console.log(`当前页: ${val}`);
+      this.projectParam.content.pageNumber = val
+      this.listData()
+    },
+    handleSizeChangeProduct(val) {
+      // console.log(`每页 ${val} 条`);
+      this.productParam.content.pageSize = val
+      this.productData(this.selectProject)
+    },
+    handleCurrentChangeProduct(val) {
+      // console.log(`当前页: ${val}`);
+      this.productParam.content.pageNumber = val
+      this.productData(this.selectProject)
+    },
+    onChange(val,index,data){
+      console.log(val,'9999')
+      if (val < data.orderminqty){
+        data.orderqty = data.orderminqty.toFixed(2)
+      }else {
+        if ((val - data.orderminqty)/data.orderaddqty > 0){
+          let k = ((val - data.orderminqty)/data.orderaddqty).toFixed(0)
+          data.orderqty = k * data.orderaddqty + data.orderminqty
+        }else {
+          data.orderqty = val.toFixed(2)
+        }
+      }
+      data.orderamount = (data.price * data.orderqty).toFixed(2)
+      this.$set(this.productList,index,data)
+      /*this.onChangQty(data,data.orderqty)*/
+      setTimeout(()=>{
+        this.onChangeQty(data)
+      },1000)
+
+    },
+    async onChangeQty(val){
+      const res = await this.$api.requested({
+        "id": 20230705145204,
+        "content": {
+          "sa_salesforecastbillid": this.$route.query.id,
+          "sa_salesforecastprojectid": this.selectProject,
+          "salesforecast": [
+            {
+              "itemid": val.itemid,
+              "orderqty": val.orderqty,
+              "orderamount":val.price*val.orderqty,
+              "price": val.price ,
+              "sa_salesforecastid":val.sa_salesforecastid
+            }
+          ]
+        }
+      })
+      this.dialogVisible = false
+      this.onSuccess()
+    },
+    priceChange(val,index,data){
+      console.log(data,'价格')
+      if(val < 0) {
+        data.price = 0
+      }else {
+        data.price = this.tool.formatAmount(val ,2)
+      }
+      data.orderamount = this.tool.formatAmount(data.price * data.orderqty,2)
+      console.log(data)
+      this.$set(this.productList,index,data)
+      /*setTimeout(()=>{*/
+        this.onChangeQty(data)
+     /* },1000)*/
+    },
+    async discountrateChange(val){
+      if(val < 0){
+        this.discountrate = 0
+      }else {
+        this.discountrate = Math.round(val * 100)/100
+      }
+      const res = await this.$api.requested({
+        "id": 20230705145104,
+        "content": {
+          "sa_salesforecastbillid": this.$route.query.id,
+          "ownertable": "sa_project",
+          "salesforecastproject": [
+            {
+              "sa_salesforecastprojectid": this.selectProject,
+              "ownerid": this.selectProjectid,
+              "discountrate": this.discountrate/100
+            }
+          ]
+        }
       })
+      this.onSuccess()
     }
   },
   mounted() {

+ 85 - 2
src/HDrpManagement/projectPredictionManage/details/modules/subordinate.vue

@@ -1,12 +1,95 @@
 <template>
   <div>
-
+    <basicDetails
+        ref="details"
+        :titleText="mainData.title"
+        formPath="projectChange"
+        :editData="mainData"
+        :mainAreaData="mainAreaData"
+        idname="sa_salesforecastbillid"
+        :tags="[]"
+        :tabs="['项目产品清单']"
+        @onEditSuccess="queryMainData($route.query.id)"
+       >
+      <div slot="slot0" class=" normal-panel">
+        <projectList :id="id" :isDisabled="true"></projectList>
+      </div>
+    </basicDetails>
   </div>
 </template>
 
 <script>
+import projectList from './projectList'
 export default {
-  name: "subordinate"
+  name: "subordinate",
+  components:{projectList},
+  props:["id"],
+  data(){
+    return {
+      mainData:'',
+      mainAreaData:'',
+    }
+  },
+  methods:{
+    async queryMainData () {
+      const res = await this.$api.requested({
+        "id": 20230705144704,
+        "content": {
+          "sa_salesforecastbillid":this.id
+        }
+      })
+      this.mainData = res.data
+      this.changeDataStructure()
+
+    },
+    changeDataStructure () {
+      let that = this
+      this.mainAreaData = [
+        {
+          label:'标题',
+          value: this.mainData.title
+        },
+        {
+          label:'单号',
+          value: this.mainData.billnum
+        },
+        {
+          label:'提报人',
+          value: this.mainData.name
+        },
+        {
+          label:'预测时间',
+          value: this.mainData.periodstart + '至' + this.mainData.periodend
+        },
+        {
+          label:'状态',
+          value: this.mainData.status,
+          style: ()=> {
+            let style = {}
+            switch (that.mainData.status) {
+              case '进行中':
+                style = {color:'#00B32B'}
+                break;
+              default:
+                break;
+            }
+            return style
+          }
+        },
+        {
+          label:'预测金额',
+          value: '¥'+this.tool.formatAmount(this.mainData.projectamount,2),
+          style: ()=> {
+            let style = {color:'#ff0000'}
+            return style
+          }
+        },
+      ]
+    },
+  },
+  mounted() {
+    this.queryMainData()
+  }
 }
 </script>
 

+ 3 - 3
src/HDrpManagement/projectPredictionManage/index.vue

@@ -57,7 +57,7 @@
       </template>
       <template v-slot:tbOpreation="scope">
         <edit v-if="scope.data.data.status === '进行中'" :data="scope.data.data"></edit>
-        <detailsBtn v-else></detailsBtn>
+        <detailInfo v-else :data="scope.data.data"></detailInfo>
       </template>
     </basicLayout>
   </div>
@@ -65,7 +65,7 @@
 
 <script>
 import edit from './modules/edit'
-import detailsBtn from './modules/details'
+import detailInfo from './modules/detailInfo'
 export default {
   name: "index",
   data(){
@@ -88,7 +88,7 @@ export default {
       }
     }
   },
-  components:{edit,detailsBtn},
+  components:{edit,detailInfo},
   methods:{
     listData(){
       this.$refs.basicLayout.param.content.baseonproject = 1

+ 51 - 0
src/HDrpManagement/projectPredictionManage/modules/detailInfo.vue

@@ -0,0 +1,51 @@
+<template>
+  <div>
+    <el-button size="mini" type="text" @click="onShow">详 情</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "detailInfo",
+  props:['data'],
+  data(){
+    return {
+      drawer:false,
+      mainAreaData:'',
+      mainData:""
+    }
+  },
+  methods:{
+    onShow(){
+      this.drawer = true
+      let query = {id:this.data.sa_salesforecastbillid,rowindex:this.data.rowindex,isDetail:1}
+      this.$router.push({path:'/projectManageDetail',query:query})
+      this.$store.dispatch('changeDetailDrawer',true)
+      /*this.queryMainData()*/
+    },
+    async queryMainData () {
+      const res = await this.$api.requested({
+        "id": 20230705144704,
+        "content": {
+          "sa_salesforecastbillid":37
+        }
+      })
+      console.log(res.data,'1111')
+      this.mainData = res.data
+      this.changeDataStructure()
+    },
+    changeDataStructure () {
+      this.mainAreaData = [
+        {
+          label:'标题',
+          value: this.mainData.title
+        },
+      ]
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 0 - 15
src/HDrpManagement/projectPredictionManage/modules/details.vue

@@ -1,15 +0,0 @@
-<template>
-  <div>
-    <el-button size="mini" type="text">详 情</el-button>
-  </div>
-</template>
-
-<script>
-export default {
-  name: "details"
-}
-</script>
-
-<style scoped>
-
-</style>

+ 0 - 14
src/HDrpManagement/projectPredictionManage/modules/edit.vue

@@ -1,27 +1,13 @@
 <template>
   <div>
     <el-button size="mini" type="text" @click="onShow">编 辑</el-button>
-
-<!--    <el-drawer
-        :visible.sync="drawer"
-        :with-header="false"
-        direction="rtl"
-        size="90%"
-        append-to-body
-        >
-      <div class="detail__panel">
-        <detailsInfo></detailsInfo>
-      </div>
-    </el-drawer>-->
   </div>
 </template>
 
 <script>
-import detailsInfo from '../details/index'
 export default {
   name: "edit",
   props:['data'],
-  components:{detailsInfo},
   data(){
     return {
       drawer:false,

+ 97 - 0
src/SDrpManagement/projectPrediction/detail/index.vue

@@ -0,0 +1,97 @@
+<template>
+  <div>
+    <basicDetails
+        ref="details"
+        :titleText="mainData.title"
+        :editData="mainData"
+        :mainAreaData="mainAreaData"
+        idname="sa_salesforecastbillid"
+        :tags="[]"
+        :tabs="['项目产品清单']"
+        @onEditSuccess="queryMainData($route.query.id)"
+       >
+      <div slot="slot0" class="normal-panel">
+        <projectList :id="id" :isDisabled="isDisabled"></projectList>
+      </div>
+    </basicDetails>
+  </div>
+</template>
+
+<script>
+import projectList from '@/HDrpManagement/projectPredictionManage/details/modules/projectList'
+export default {
+  name: "subordinate",
+  components:{projectList},
+  props:["id",'isDisabled'],
+  data(){
+    return {
+      mainData:'',
+      mainAreaData:'',
+    }
+  },
+  methods:{
+    async queryMainData () {
+      const res = await this.$api.requested({
+        "id": 20230705144704,
+        "content": {
+          "sa_salesforecastbillid":this.id
+        }
+      })
+      this.mainData = res.data
+      this.changeDataStructure()
+
+    },
+    changeDataStructure () {
+      let that = this
+      this.mainAreaData = [
+        {
+          label:'标题',
+          value: this.mainData.title
+        },
+        {
+          label:'单号',
+          value: this.mainData.billnum
+        },
+        {
+          label:'提报人',
+          value: this.mainData.name
+        },
+        {
+          label:'预测时间',
+          value: this.mainData.periodstart + '至' + this.mainData.periodend
+        },
+        {
+          label:'状态',
+          value: this.mainData.status,
+          style: ()=> {
+            let style = {}
+            switch (that.mainData.status) {
+              case '进行中':
+                style = {color:'#00B32B'}
+                break;
+              default:
+                break;
+            }
+            return style
+          }
+        },
+        {
+          label:'预测金额',
+          value: '¥'+this.tool.formatAmount(this.mainData.projectamount,2),
+          style: ()=> {
+            let style = {color:'#ff0000'}
+            return style
+          }
+        },
+      ]
+    },
+  },
+  mounted() {
+    this.queryMainData()
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 524 - 0
src/SDrpManagement/projectPrediction/detail/projectList.vue

@@ -0,0 +1,524 @@
+<template>
+  <div>
+    <addProject v-if="!isDisabled" ref="addProject" :param="paramProject" class="inline-16" @add="addProject" @adds="addProjects"></addProject>
+    <el-button v-if="!isDisabled" :type="items.length > 0?'primary':''" size="small" @click="delProjects" class="inline-16" :disabled="items.length === 0">删 除</el-button>
+    <el-input  style="width:200px;" placeholder="搜索" :suffix-icon="projectParam.content.where.condition?projectParam.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="projectParam.content.where.condition" @keyup.native.enter="listData(projectParam.content.pageNumber = 1)" @clear="listData(projectParam.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
+    </el-input>
+    <tableList :height="'100px'" ref="projectRef" style="margin-top: 10px;height: 100px" :checkbox="true"  :layout="projectCols" :data="list" :opwidth="200" :custom="true"  fixedName="operation"
+               highlight-current-row @selectionChange="selectionChange" @rowClick="rowClick" >
+      <template v-slot:customcol="scope">
+        <div v-if="scope.column.columnname === 'operation'">
+          <span>{{scope.column.data[scope.column.columnname]}}</span>
+        </div>
+        <p v-else>{{scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname]:'--'}}</p>
+      </template>
+      <template v-slot:opreation="scope">
+        <el-button type="text" size="mini" @click="onProduct(scope.data)" :disabled="isDisabled">添加产品</el-button>
+        <el-button size="mini" type="text" @click="delProject(scope.data)" :disabled="isDisabled">删 除</el-button>
+      </template>
+    </tableList>
+    <div class=" container "  style="text-align:left;float: left">
+      <span style="font-size: 14px">预测金额: ¥{{tool.formatAmount(projectPrice,2)}}</span>
+    </div>
+    <div  class="container " style="text-align:right;float: right">
+      <el-pagination
+          background
+          @size-change="handleSizeChangeProject"
+          @current-change="handleCurrentChangeProject"
+          :current-page="projectParam.content.pageNumber"
+          :page-sizes="[20, 50, 100, 200]"
+          :page-size="20"
+          layout="total,sizes, prev, pager, next, jumper"
+          :total="totalProject">
+      </el-pagination>
+    </div>
+    <el-row>
+      <el-col :span="19">
+        <el-button v-if="!isDisabled" :type="itemsPro.length > 0?'primary':''" size="small" @click="delProducts" class="inline-16" :disabled="itemsPro.length === 0">删 除</el-button>
+        <el-input  style="width:200px;" placeholder="搜索" :suffix-icon="productParam.content.where.condition?productParam.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="productParam.content.where.condition" @keyup.native.enter="listData(productParam.content.pageNumber = 1)" @clear="listData(productParam.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
+        </el-input>
+      </el-col>
+      <el-col :span="5">
+        <el-input :disabled="isDisabled" style="width:100px;float: right" v-model="discountrate" placeholder="默认100" @change="discountrateChange(discountrate)">
+        </el-input>
+        <span style="float: right;line-height: 40px;height:40px;font-size:13px;vertical-align: auto">折扣(%):</span>
+      </el-col>
+    </el-row>
+
+    <tableList :height="'calc(90vh - 1750px)'" style="margin-top: 10px" :checkbox="true"  :layout="productCols" :data="productList" :opwidth="200" :custom="true"  fixedName="operation"
+               @selectionChange="selectionChangePro">
+      <template v-slot:customcol="scope">
+        <div v-if="scope.column.columnname === 'operation'">
+          <span>{{scope.column.data[scope.column.columnname]}}</span>
+        </div>
+        <div v-else-if="scope.column.columnname === 'orderqty'">
+          <span v-if="isDisabled">{{scope.column.data[scope.column.columnname]}}</span>
+          <span v-else>
+            <el-input-number size="mini" v-model="scope.column.data.orderqty" @change="onChange(scope.column.data.orderqty,scope.$index,scope.column.data)" :min="scope.column.data.orderminqty" :step="scope.column.data.orderaddqty"></el-input-number>
+          </span>
+        </div>
+        <div v-else-if="scope.column.columnname === 'price'">
+          <span v-if="isDisabled">{{scope.column.data[scope.column.columnname]}}</span>
+          <span v-else>
+            <el-input size="mini" v-model="scope.column.data.price" @change="priceChange(scope.column.data.price,scope.$index,scope.column.data)"></el-input>
+          </span>
+        </div>
+        <p v-else>{{scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname]:'--'}}</p>
+      </template>
+      <template v-slot:opreation="scope">
+        <el-button size="mini" type="text" @click="delProduct(scope.data)" :disabled="isDisabled">删 除</el-button>
+      </template>
+    </tableList>
+    <div class=" container "  style="text-align:left;float: left">
+      <span style="font-size: 14px">预测金额: ¥{{tool.formatAmount(productPrice,2)}}</span>
+    </div>
+    <div  class="container " style="text-align:right;float: right">
+      <el-pagination
+          background
+          @size-change="handleSizeChangeProduct"
+          @current-change="handleCurrentChangeProduct"
+          :current-page="productParam.content.pageNumber"
+          :page-sizes="[20, 50, 100, 200]"
+          :page-size="20"
+          layout="total,sizes, prev, pager, next, jumper"
+          :total="totalProduct">
+      </el-pagination>
+    </div>
+    <el-drawer
+        title="添加商品"
+        :visible.sync="dialogVisible"
+        size="90%"
+        direction="rtl"
+        :show-close="false"
+        append-to-body
+        >
+      <addProduct ref="productRef" :params="paramProduct" :tablecolsAdd="tablecolsAdd" :querySa_brandid="brandid"
+                  :tradefield="tradefield"   @addProduct="addProduct" @addSuccess="addProducts"></addProduct>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import tableList from '@/components/table/index5'
+import addProject from '@/template/prediction/addProjectTemp'
+import addProduct from '@/template/prediction/addProductTemp'
+export default {
+  name: "projectList",
+  props:['id','isDisabled'],
+  components:{tableList,addProject,addProduct},
+  data(){
+    return {
+      dialogVisible:false,
+      brandid:'',
+      tradefield:'',
+      sa_brandid:'',
+      discountrate:1,
+      projectCols:[],
+      productCols:[],
+      tablecolsAdd:[],
+      list:[],
+      productList:[],
+      loading:false,
+      items:[],
+      itemsPro:[],
+      selectProject:'',
+      selectProjectid:'',
+      totalProject:0,
+      totalProduct:0,
+      projectPrice:0,
+      productPrice:0,
+      projectParam:{
+        "id": 20230705144904,
+        "content": {
+          "sa_salesforecastbillid":this.id,
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where":{
+            "condition":""
+          }
+        }
+      },
+      productParam:{
+        "id": 20230705145004,
+        "content": {
+          "sa_salesforecastprojectid": '',
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where":{
+            "condition":""
+          }
+        }
+      },
+      paramProject:{
+        "id": 20230705145604,
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 20,
+          "sa_salesforecastbillid":this.id,
+          "where": {
+            "condition": ""
+          }
+        }
+      },
+      paramProduct:{
+        "id": 20230705145704,
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 20,
+          "sa_salesforecastbillid":this.id,
+          "sa_salesforecastprojectid":'',
+          "sa_projectid":"",
+          "where": {
+            "condition": ""
+          }
+        }
+      },
+      currentRow: 0
+    }
+  },
+  methods:{
+    /*初始化项目列表*/
+    async listData(){
+      const res = await this.$api.requested(this.projectParam)
+      this.list = res.data
+      this.totalProject = res.total
+      this.selectProject = res.data[0].sa_salesforecastprojectid
+      this.selectProjectid = res.data[0].sa_projectid
+      this.$refs.projectRef.$refs.table.setCurrentRow(this.list[0])
+      if (res.data.length > 0){
+        this.projectPrice = res.data[0].sumprojectamount
+        this.discountrate = res.data[0].discountrate * 100
+      }else {
+        this.projectPrice = 0
+        this.discountrate = ''
+      }
+      this.productData(res.data[0].sa_salesforecastprojectid)
+    },
+    /*更改数据后项目列表*/
+    async projectData(){
+      const res = await this.$api.requested(this.projectParam)
+      this.list = res.data
+      if (res.data.length > 0){
+        this.projectPrice = res.data[0].sumprojectamount
+      }else {
+        this.projectPrice = 0
+      }
+      this.$refs.projectRef.$refs.table.setCurrentRow(this.list[this.currentRow])
+      this.productData(this.selectProject)
+    },
+    /*产品列表*/
+    async productData(id){
+      this.productParam.content.sa_salesforecastprojectid = id
+      const res = await this.$api.requested(this.productParam)
+      this.productList = res.data
+      this.totalProduct = res.total
+      if (res.data.length > 0){
+        this.productPrice = res.data[0].sumorderamount
+      }else {
+        this.productPrice = 0
+      }
+
+    },
+    /*添加项目*/
+    async addProject(id){
+      console.log(id,'项目id')
+      const res = await this.$api.requested({
+        "id": 20230705145104,
+        "content": {
+          "sa_salesforecastbillid": this.$route.query.id,
+          "ownertable": "sa_project",
+          "salesforecastproject": [
+            {
+              "sa_salesforecastprojectid": 0,
+              "ownerid": id,
+              "discountrate": 1
+            }
+          ]
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.projectParam.content.pageNumber = 1
+        this.listData()
+        this.$emit('onSuccess')
+      })
+    },
+    /*批量添加项目*/
+    async addProjects(ids){
+      const res = await this.$api.requested({
+        "id": 20230705145104,
+        "content": {
+          "sa_salesforecastbillid": this.$route.query.id,
+          "ownertable": "sa_project",
+          "salesforecastproject": ids
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.projectParam.content.pageNumber = 1
+        this.listData()
+        this.$emit('onSuccess')
+      })
+    },
+    /*删除项目*/
+    async delProject(val){
+      const res = await this.$api.requested({
+        "id": 20230705145304,
+        "content": {
+          "sa_salesforecastbillid":this.$route.query.id,
+          "sa_salesforecastprojectids":[val.sa_salesforecastprojectid]
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.projectParam.content.pageNumber = 1
+        this.listData()
+        this.$emit('onSuccess')
+      })
+
+    },
+    /*批量删除项目*/
+    async delProjects(){
+      console.log(this.items)
+      let ids = []
+      ids = this.items.map(item=>item.sa_salesforecastprojectid)
+      console.log(ids)
+      const res = await this.$api.requested({
+        "id": 20230705145304,
+        "content": {
+          "sa_salesforecastbillid":this.$route.query.id,
+          "sa_salesforecastprojectids":ids
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.items = []
+        this.projectParam.content.pageNumber = 1
+        this.listData()
+      })
+    },
+    /*勾选的项目*/
+    selectionChange(val){
+      this.items = val
+    },
+    /*勾选产品*/
+    selectionChangePro(val){
+      this.itemsPro = val
+    },
+    /*添加产品*/
+    onProduct(val){
+      console.log(val,'项目信息')
+      this.selectProject = val.sa_salesforecastprojectid
+      this.selectProjectid = val.sa_projectid
+      this.paramProduct.content.sa_salesforecastprojectid = val.sa_salesforecastprojectid
+      this.paramProduct.content.sa_projectid = val.sa_projectid
+      this.tradefield = val.tradefield
+      this.sa_brandid = val.sa_brandid
+      this.discountrate = val.discountrate * 100
+      this.dialogVisible = true
+      this.$nextTick(()=>{
+        this.$refs.productRef.onShow()
+      })
+
+    },
+    async addProduct(val){
+      console.log(val,'需要添加的产品')
+      const res = await this.$api.requested({
+        "id": 20230705145204,
+        "content": {
+          "sa_salesforecastbillid": this.$route.query.id,
+          "sa_salesforecastprojectid": this.selectProject,
+          "salesforecast": [
+            {
+              "itemid": val.itemid,
+              "orderqty": val.qty,
+              "orderamount":(val.marketprice * (this.discountrate/100))*val.qty,
+              "price": val.marketprice * (this.discountrate / 100),
+              "sa_salesforecastid":0
+            }
+          ]
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.dialogVisible = false
+        this.onSuccess()
+      })
+    },
+    async addProducts(val){
+      let items = []
+      items = val.map(item=>{
+        return {
+          "itemid": item.itemid,
+          "orderqty": item.qty,
+          "orderamount": (item.marketprice * (this.discountrate /100))*item.qty,
+          "price": item.marketprice * (this.discountrate /100),
+          "sa_salesforecastid":0
+        }
+      })
+      console.log(items,'item')
+      const res = await this.$api.requested({
+        "id": 20230705145204,
+        "content": {
+          "sa_salesforecastbillid": this.$route.query.id,
+          "sa_salesforecastprojectid": this.selectProject,
+          "salesforecast": items
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.dialogVisible = false
+        this.onSuccess()
+      })
+    },
+    /*删除商品*/
+    async delProduct(val){
+      console.log(val)
+      const res = await this.$api.requested({
+        "id": 20230705145404,
+        "content": {
+          "sa_salesforecastbillid":this.$route.query.id,
+          "sa_salesforecastids":[val.sa_salesforecastid]
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.onSuccess()
+      })
+    },
+    /*批量删除商品*/
+    async delProducts(){
+      console.log(this.itemsPro)
+      let ids = []
+      ids = this.itemsPro.map(item=>item.sa_salesforecastid)
+      console.log(ids)
+      const res = await this.$api.requested({
+        "id": 20230705145404,
+        "content": {
+          "sa_salesforecastbillid":this.$route.query.id,
+          "sa_salesforecastids":ids
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.itemsPro = []
+        this.productParam.content.pageNumber = 1
+        this.onSuccess()
+      })
+    },
+    onSuccess(){
+      this.projectData()
+      this.$emit('onSuccess')
+    },
+    rowClick(val){
+      console.log(val)
+      this.currentRow = val.rowindex -1
+      this.$refs.projectRef.$refs.table.setCurrentRow(this.list[this.currentRow])
+      this.selectProject = val.sa_salesforecastprojectid
+      this.selectProjectid = val.sa_projectid
+      this.discountrate = val.discountrate * 100
+      this.projectData()
+    },
+    handleSizeChangeProject(val) {
+      // console.log(`每页 ${val} 条`);
+      this.projectParam.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChangeProject(val) {
+      // console.log(`当前页: ${val}`);
+      this.projectParam.content.pageNumber = val
+      this.listData()
+    },
+    handleSizeChangeProduct(val) {
+      // console.log(`每页 ${val} 条`);
+      this.productParam.content.pageSize = val
+      this.productData(this.selectProject)
+    },
+    handleCurrentChangeProduct(val) {
+      // console.log(`当前页: ${val}`);
+      this.productParam.content.pageNumber = val
+      this.productData(this.selectProject)
+    },
+    onChange(val,index,data){
+      console.log(val,'9999')
+      if (val < data.orderminqty){
+        data.orderqty = data.orderminqty.toFixed(2)
+      }else {
+        if ((val - data.orderminqty)/data.orderaddqty > 0){
+          let k = ((val - data.orderminqty)/data.orderaddqty).toFixed(0)
+          data.orderqty = k * data.orderaddqty + data.orderminqty
+        }else {
+          data.orderqty = val.toFixed(2)
+        }
+      }
+      data.orderamount = (data.price * data.orderqty).toFixed(2)
+      this.$set(this.productList,index,data)
+      /*this.onChangQty(data,data.orderqty)*/
+      setTimeout(()=>{
+        this.onChangeQty(data)
+      },1000)
+
+    },
+    async onChangeQty(val){
+      const res = await this.$api.requested({
+        "id": 20230705145204,
+        "content": {
+          "sa_salesforecastbillid": this.$route.query.id,
+          "sa_salesforecastprojectid": this.selectProject,
+          "salesforecast": [
+            {
+              "itemid": val.itemid,
+              "orderqty": val.orderqty,
+              "orderamount":val.price*val.orderqty,
+              "price": val.price ,
+              "sa_salesforecastid":val.sa_salesforecastid
+            }
+          ]
+        }
+      })
+      this.dialogVisible = false
+      this.onSuccess()
+    },
+    priceChange(val,index,data){
+      console.log(data,'价格')
+      if(val < 0) {
+        data.price = 0
+      }else {
+        data.price = this.tool.formatAmount(val ,2)
+      }
+      data.orderamount = this.tool.formatAmount(data.price * data.orderqty,2)
+      console.log(data)
+      this.$set(this.productList,index,data)
+      /*setTimeout(()=>{*/
+        this.onChangeQty(data)
+     /* },1000)*/
+    },
+    async discountrateChange(val){
+      if(val < 0){
+        this.discountrate = 0
+      }else {
+        this.discountrate = Math.round(val * 100)/100
+      }
+      const res = await this.$api.requested({
+        "id": 20230705145104,
+        "content": {
+          "sa_salesforecastbillid": this.$route.query.id,
+          "ownertable": "sa_project",
+          "salesforecastproject": [
+            {
+              "sa_salesforecastprojectid": this.selectProject,
+              "ownerid": this.selectProjectid,
+              "discountrate": this.discountrate/100
+            }
+          ]
+        }
+      })
+      this.onSuccess()
+    }
+  },
+  mounted() {
+    this.listData()
+  },
+  created() {
+    this.productCols = this.tool.tabelCol(this.$route.name).productList.tablecols
+    this.projectCols = this.tool.tabelCol(this.$route.name).projectList.tablecols
+    this.tablecolsAdd = this.tool.tabelCol(this.$route.name).addProductTable.tablecols
+  },
+}
+</script>
+
+<style scoped>
+
+</style>

+ 5 - 1
src/SDrpManagement/projectPrediction/index.vue

@@ -56,15 +56,19 @@
         </p>
       </template>
       <template v-slot:tbOpreation="scope">
-
+        <edit v-if="scope.data.data.status === '进行中'"  :data="scope.data.data"></edit>
+        <detailInfo v-else :data="scope.data.data"></detailInfo>
       </template>
     </basicLayout>
   </div>
 </template>
 
 <script>
+import edit from './modules/edit'
+import detailInfo from './modules/detailInfo'
 export default {
   name: "index",
+  components:{edit,detailInfo},
   data(){
     return {
       dateSelect:'',

+ 69 - 0
src/SDrpManagement/projectPrediction/modules/detailInfo.vue

@@ -0,0 +1,69 @@
+<template>
+  <div>
+    <el-button size="mini" type="text" @click="goDetail">详 情</el-button>
+    <el-drawer
+        :visible.sync="drawer"
+        :with-header="false"
+        direction="rtl"
+        size="90%"
+        append-to-body
+    >
+      <div class="detail__panel">
+        <detailIn :id="id" ref="subordinate" :isDisabled="true"></detailIn>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import detailIn from '../detail/index'
+export default {
+  name: "detailInfo",
+  props:['data'],
+  components:{detailIn},
+  data(){
+    return {
+      drawer:false,
+      mainAreaData:'',
+      mainData:"",
+      id:""
+    }
+  },
+  methods:{
+    goDetail(){
+      this.id = this.data.sa_salesforecastbillid
+      this.drawer = true
+    },
+    onShow(){
+      this.drawer = true
+      let query = {id:this.data.sa_salesforecastbillid,rowindex:this.data.rowindex,isDetail:1}
+      this.$router.push({path:'/projectManageDetail',query:query})
+      this.$store.dispatch('changeDetailDrawer',true)
+      /*this.queryMainData()*/
+    },
+    async queryMainData () {
+      const res = await this.$api.requested({
+        "id": 20230705144704,
+        "content": {
+          "sa_salesforecastbillid":37
+        }
+      })
+      console.log(res.data,'1111')
+      this.mainData = res.data
+      this.changeDataStructure()
+    },
+    changeDataStructure () {
+      this.mainAreaData = [
+        {
+          label:'标题',
+          value: this.mainData.title
+        },
+      ]
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 72 - 0
src/SDrpManagement/projectPrediction/modules/edit.vue

@@ -0,0 +1,72 @@
+<template>
+  <div>
+    <el-button size="mini" type="text" @click="goDetail">编 辑</el-button>
+    <el-drawer
+        :visible.sync="drawer"
+        :with-header="false"
+        direction="rtl"
+        size="90%"
+        append-to-body
+    >
+      <div class="detail__panel">
+        <detailInfo :id="id" ref="subordinate"></detailInfo>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import detailInfo from '../detail/index'
+export default {
+  name: "edit",
+  props:['data'],
+  components:{detailInfo},
+  data(){
+    return {
+      drawer:false,
+      mainAreaData:'',
+      mainData:"",
+      id:''
+    }
+  },
+  methods:{
+    goDetail(){
+
+      this.id = this.data.sa_salesforecastbillid
+      this.drawer = true
+    },
+    onShow(){
+      this.drawer = true
+      let query = {id:this.data.sa_salesforecastbillid,rowindex:this.data.rowindex}
+      this.$router.push({path:'/projectPredictionDetail',query:query})
+      this.$store.dispatch('changeDetailDrawer',true)
+      /*this.queryMainData()*/
+    },
+    async queryMainData () {
+      const res = await this.$api.requested({
+        "id": 20230705144704,
+        "content": {
+          "sa_salesforecastbillid":37
+        }
+      })
+      console.log(res.data,'1111')
+      this.mainData = res.data
+      this.changeDataStructure()
+    },
+    changeDataStructure () {
+      this.mainAreaData = [
+        {
+          label:'标题',
+          value: this.mainData.title
+        },
+      ]
+    }
+  },
+  mounted() {
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 1
src/components/newDetailTemp/index.vue

@@ -27,7 +27,7 @@
         <div style="margin:10px 10px 0 5px;border-radius:5px;position:relative" class="container normal-panel sticky" >
           <slot name="bottomRight"></slot>
         </div>
-        <div style="margin:10px 10px 0 5px;border-radius:5px;position:relative" class="container normal-panel sticky" >
+        <div style="height: calc(100vh - 140px);margin:10px 10px 0 5px;border-radius:5px;position:relative" class="container normal-panel sticky" >
 <!--          <slot name="bottomTabs"></slot>-->
           <tabTemp :tabs="tabs" :editData="editData" :idname="idname" :ownertable="ownertable?ownertable:idname.slice(0, this.idname.length - 2)" @onTabClick="onTabClick">
             <div :slot="'slot' + index" v-for="(tab,index) in tabs" :key="tab.index">

+ 3 - 3
src/components/table/index5.vue

@@ -1,13 +1,13 @@
 <template>
   <div>
     <!-- :header-cell-style="{background:'#EEEEEE',color:'#333'}" -->
-    <el-table ref="table" :row-class-name="tableClassName" highlight-current-row :data="data"  size="mini"  :height="data.length <= 4?'260px':data.length <= 20?'':'calc(100vh - 420px)'"  @row-click="rowClick" style="width:100%;min-height:260px;max-height: calc(100vh - 420px)" :header-cell-style="{height:'40px',color:'#606266',fontWeight:'400',fontSize:'14px'}"
-              :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}" border @selection-change="selectionChange" v-loading="loading">
+    <el-table ref="table" :row-class-name="tableClassName" highlight-current-row :data="data"  size="mini"  :height="height ==''?data.length <= 4?'260px':data.length <= 20?'':'calc(100vh - 420px)':height"  @row-click="rowClick" style="width:100%;min-height:260px;max-height: calc(100vh - 420px)" :header-cell-style="{height:'40px',color:'#606266',fontWeight:'400',fontSize:'14px'}"
+              :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}" border @selection-change="selectionChange" >
       <el-table-column
           type="selection"
           width="35" fixed v-if="checkbox">
       </el-table-column>
-      <el-table-column v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title"  :fixed="fixedName ? fixedName.indexOf(col.columnname)!= -1?'right':false : false">
+      <el-table-column v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title"  :width="col.width" :fixed="fixedName ? fixedName.indexOf(col.columnname)!= -1?'right':false : false">
         <template slot-scope="scope">
           <div class="table-panel">
             <!-- 自定义表格显示内容 -->

+ 12 - 1
src/router/HDrpManagement.js

@@ -1090,7 +1090,18 @@ const HDrpManagement = [
       keeproute: true,
     },
     component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/invoicePredictionManage/index'),
-
+    children: [
+      {
+        path: '/invoicePredictionManageDetail',
+        name: 'invoicePredictionManage',
+        meta: {
+          title: '出货开票预测管理详情',
+          ast_nav: true,
+          keeproute: true,
+        },
+        component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/invoicePredictionManage/details/index'),
+      }
+    ]
   },
 
 

+ 13 - 1
src/router/SDrpManagement.js

@@ -295,7 +295,19 @@ const SDrpManagement = [
       ast_nav: true,
       keeproute: true,
     },
-    component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/projectPrediction/index')
+    component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/projectPrediction/index'),
+    children: [
+      {
+        path: '/projectPredictionDetail',
+        name: 'projectPrediction',
+        meta: {
+          title: '项目成交预测详情',
+          ast_nav: true,
+          keeproute: true,
+        },
+        component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/projectPrediction/detail/index'),
+      }
+    ]
   },
   {
     path: '/invoicePrediction',

+ 1 - 1
src/template/prediction/addProjectTemp.vue

@@ -87,7 +87,7 @@ export default {
         return {
           "sa_salesforecastprojectid": 0,
           "ownerid": item.sa_projectid,
-          "discountrate": 0.1
+          "discountrate":1
         }
       })
       this.dialogVisible = false