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

+ 116 - 3
src/HDrpManagement/contractManage/components/productDetailList/productDetailList.vue

@@ -4,6 +4,20 @@
       <div class="flex-align-center" style="margin-bottom:10px">
         <el-input size="small" style="width:200px;margin-right:10px" v-model="params.content.where.condition" placeholder="输入搜索内容" @clear="listData(params.content.pageNumber = 1)" @keyup.native.enter="listData(params.content.pageNumber = 1)" clearable></el-input>
         <slot name="addProduct"/>
+        <uploadAllData
+            v-if="tool.checkAuth($route.name,'productDetailManage') && data.status === '新建' && isLeader"
+            :total="total"
+            @onSuccess="listData()"
+            @handlePullApi="handlePullApi"
+            @handleDelApi="handleDelApi"
+            idName="sa_contract_itemsid"
+            type="del"
+        ></uploadAllData>
+        <addProduct v-if="tool.checkAuth($route.name,'productDetailManage') && data.status === '新建' && isLeader"
+                    class="inline-16"  :params="paramsAdd" :tablecolsAdd="tablecolsAdd" title="添加"
+                    @addSuccess="addProducts" @addProduct="addProduct" @uploadData="uploadData" @closeDrawer="listData"
+                     ref="addProduct"
+        ></addProduct>
       </div>
       <tableLayout :layout="tablecols" :data="list" :opwidth="200" height="calc(100vh - 550px)" :width="true" :custom="true" fixedName="operation qty marketprice discountrate price countPrice" >
         <template v-slot:customcol="scope">
@@ -74,18 +88,34 @@
 
 <script>
 // import edit from './editProduct'
-import addProduct from './addProduct'
+
+// import addProduct from './addProduct'
+import addProduct from '@/template/addProduct'
 import previewImage from '@/components/previewImage/index'
+import uploadAllData from '@/components/uploadAllData/index'
 export default {
-  components: {addProduct,previewImage},
+  components: {addProduct,previewImage,uploadAllData},
   name: '',
+  props:["data","isLeader"],
   data() {
     return {
       list:[],
+      paramsAdd:{
+        "id": 20221124093602,
+        "content": {
+          "sa_contractid": this.$route.query.id,
+          "pageNumber": 1,
+          "pageSize": 100,
+          "where": {
+            "condition": "",
+            "istool":0//是否是工具
+          }
+        },
+      },
       params: {
           "id": 20221122165302,
           "content": {
-              "sa_contractid": '',
+              "sa_contractid": this.$route.query.id,
               "pageNumber": 1,
               "pageSize": 100,
               "where": {
@@ -100,6 +130,7 @@ export default {
         type:''
       },
       tablecols:[],
+      tablecolsAdd:[],
       total:0,
       editIndex:''
     };
@@ -111,6 +142,8 @@ export default {
   created () {
     if (this.$route.query.id) this.listData()
     this.tablecols = this.tool.tabelCol(this.$route.name).productDetailTable.tablecols
+    this.tablecolsAdd = this.tool.tabelCol(this.$route.name).addProductTable.tablecols
+
   },
   methods: {
     async listData(){
@@ -178,6 +211,86 @@ export default {
       this.params.content.pageNumber = val
       this.listData()
     },
+    /*批量添加*/
+    async addProducts(data){
+      let item = data.map(item => {
+        return {
+          "itemid": item.itemid,
+          "price": item.marketprice,
+          "qty": 1,
+          'marketprice':item.marketprice,
+          type:'折扣系数'
+        }
+      })
+      const res = await this.$api.requested({
+        "id": 20221123164402,
+        "content": {
+          "sa_contractid": this.$route.query.id,
+          "items": item
+        },
+      })
+      this.tool.showMessage(res,()=>{
+        this.listData()
+        this.$refs.addProduct.listData()
+      })
+    },
+    /*单独添加*/
+    async addProduct(data){
+      let res = await this.$api.requested({
+        "id": 20221123164402,
+        "content": {
+          "sa_contractid": this.$route.query.id,
+          "items": [
+            {
+              "itemid": data.itemid,
+              "price": data.marketprice,
+              "qty": 1,
+              'marketprice':data.marketprice,
+              type:'折扣系数'
+            }
+          ]
+        },
+      })
+      this.tool.showMessage(res,() => {
+        this.listData()
+        this.$refs.addProduct.listData()
+      })
+    },
+    /*一键添加*/
+    uploadData(uploadApi,data){
+      uploadApi.id = 20221123164402
+      uploadApi.content = {
+        "sa_contractid": this.$route.query.id, //订单ID
+        "items": data.map(e=>{
+          return {
+            "itemid": e.itemid,
+            "price": e.marketprice,
+            "qty": 1,
+            'marketprice':e.marketprice,
+            type:'折扣系数'
+          }
+        })
+      }
+      this.listData()
+      this.$refs.addProduct.listData()
+    },
+    /*获取要删除的数据*/
+    handlePullApi (pullApi) {
+      pullApi.content = JSON.parse(JSON.stringify(this.params.content))
+      pullApi.id = 20221122165302
+      pullApi.content.sa_contractid = this.$route.query.id
+    },
+    /*一键删除*/
+    handleDelApi (delApi,data) {
+      delApi.id = 20221123164502
+      delApi.content = {
+        "sa_contractid":this.$route.query.id,
+        "sa_contract_itemsids":data,
+        "pageNumber":0,
+        "pageSize":0
+      }
+      this.listData()
+    },
   },
 };
 </script>

+ 5 - 2
src/HDrpManagement/contractManage/modules/detail.vue

@@ -41,8 +41,9 @@
           </template>
         </productBillno>
         <!--产品明细折扣表-->
-        <productDetailList ref="productDetailList" v-if="mainData.type == '框架'" @priceChange="queryMainData">
-          <addProductDetail :disabled="mainData.status != '新建' || !isLeader" slot="addProduct" v-if="tool.checkAuth($route.name,'productDetailManage')" @onSuccess="$refs.productDetailList.listData()"/>
+        <productDetailList :data="mainData" :isLeader="isLeader" ref="productDetailList" v-if="mainData.type == '框架'" @priceChange="queryMainData">
+<!--          <addProductDetail :disabled="mainData.status != '新建' || !isLeader" slot="addProduct" v-if="tool.checkAuth($route.name,'productDetailManage')"
+                            @onSuccess="$refs.productDetailList.listData()" />-->
           <template v-slot:edit="scope">
             <el-button 
               v-if="tool.checkAuth($route.name,'productDetailManage')"
@@ -150,6 +151,7 @@ import reverseCheck from '../components/reverseCheck'
 import revoke from "@/HDrpManagement/contractManage/components/revoke";
 import BaseInfo from '@/HDrpManagement/projectChange/modules/modules/baseInfo/baseInfo'
 import itemClass from '../components/itemClass/index.vue'
+import addProductTeamp from '@/template/addProduct'
 export default {
   name: "detail",
   data() {
@@ -167,6 +169,7 @@ export default {
     SubmitCheck,
     editBtn,
     productBillno,
+    addProductTeamp,
     addProduct,
     productDetailList,
     addProductDetail,

+ 26 - 5
src/HDrpManagement/orderManage/details/tabs/productlist.vue

@@ -3,7 +3,10 @@
     <el-col :span="setcol">
       <div class="flex-align-center">
         <slot name="operation"></slot>
-        <el-button style="margin:0 0 10px 10px" size="small" type="primary" :disabled="data.status !== '新建'" v-if="type !== 'confirmdate'" @click="drawer = true">{{setcol === 24?'添 加':'取 消'}}</el-button>
+<!--        <el-button style="margin:0 0 10px 10px" size="small" type="primary" :disabled="data.status !== '新建'" v-if="type !== 'confirmdate'" @click="drawer = true">{{setcol === 24?'添 加':'取 消'}}</el-button>-->
+        <addProduct style="margin:0 0 10px 10px" v-if="type !== 'confirmdate' && data.status === '新建' " :drawer="drawer" :data="data" @onConfirm="onConfirm" ref="addpro"
+                    :params="paramsAdd" :tablecolsAdd="tablecolsAdd" title="添 加"
+        ></addProduct>
         <excel style="margin:0 0 10px 10px" :tablecols="columnTitle" :param="param" :total="total" :excelTitle="excelTitle"></excel>
         <uploadAllData 
           style="margin:0 0 10px 10px"
@@ -332,7 +335,9 @@
         size="80%"
         direction="rtl">
           <div class="drawer__panel">
-            <addProduct :drawer="drawer" :data="data" @onConfirm="onConfirm" ref="addpro"></addProduct>
+            <addProduct :drawer="drawer" :data="data" @onConfirm="onConfirm" ref="addpro"
+                        :params="paramsAdd"
+            ></addProduct>
           </div>
       </el-drawer>
     </el-col>
@@ -348,7 +353,8 @@
 </template>
 
 <script>
-import addProduct from './addProduct.vue'
+/*import addProduct from './addProduct.vue'*/
+import addProduct from '@/template/addProduct/index'
 import excel from '../export_excel.vue'
 import uploadAllData from '@/components/uploadAllData/index'
 export default {
@@ -396,7 +402,7 @@ export default {
       param:{
         "id": 20221109093902,
         "content": {
-          "sa_orderid": 0, //订单ID
+          "sa_orderid": this.$route.query.id, //订单ID
           "pageNumber": 1,
           "pageSize": 20,
           "where": {
@@ -422,7 +428,19 @@ export default {
       totalPage:0,
       progress:0,
       progressVisible:false,
-      deleteIds:[]
+      deleteIds:[],
+      paramsAdd:{
+        "id": null,
+        "content": {
+          "sa_orderid": this.$route.query.id, //订单ID
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where": {
+            "condition": ""
+          }
+        },
+      },
+      tablecolsAdd:[]
     }
   },
   methods:{
@@ -688,6 +706,9 @@ export default {
     })
     // console.log(this.columnTitle)
   },
+  created() {
+    this.tablecolsAdd = this.tool.tabelCol(this.$route.name).addProductTable.tablecols
+  }
 }
 
 </script>

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

@@ -199,7 +199,6 @@ export default {
       this.totalPrice = 0
       const res = await this.$api.requested({
         "id": "20221021103902",
-        "version":1,
         "content": {
             "sa_projectid":this.$route.query.id
         }

+ 121 - 8
src/HDrpManagement/projectChange/modules/modules/productSet/index.vue

@@ -2,7 +2,20 @@
 <template>
   <div>
     <div style="margin-bottom: 15px">
-      <addProduct :tradefield="data.tradefield" v-if="tool.checkAuth($route.name,'productSetManage') && data.disabled" class="inline-16"  @addSuccess="onSuccess" :discountrate="discountrate"></addProduct>
+      <addProduct ref="addProduct" @uploadData="uploadData" @closeDrawer="listData"
+                  :tradefield="data.tradefield" v-if="tool.checkAuth($route.name,'productSetManage') && data.disabled"
+                  class="inline-16" :params="paramsAdd" title="添 加"
+                  @addSuccess="addProducts" :discountrate="discountrate" @addProduct="addProduct" :tablecolsAdd="tablecolsAdd"
+      ></addProduct>
+      <uploadAllData
+          class="inline-16"
+          :total="total"
+          @onSuccess="listData()"
+          @handlePullApi="handlePullApi"
+          @handleDelApi="handleDelApi"
+          idName="sa_project_itemsid"
+          type="del"
+      ></uploadAllData>
       <el-button  v-if="tool.checkAuth($route.name,'productSetManage') && data.disabled" class="inline-16" size="small" :type="delProductData.length === 0?'':'primary'" @click="onDelProduct" :disabled="delProductData.length === 0">删 除</el-button>
       <el-input
           size="small"
@@ -206,14 +219,16 @@ import to_del from "@/HDrpManagement/projectChange/modules/modules/andEnterprise
 import uploadFile from "@/components/upload/hw_obs_upload";
 import previewImage from "@/components/previewImage";
 import delete_product from './deleteProduct'
+import uploadAllData from '@/components/uploadAllData/index'
 export default {
   props:["data"],
-  components:{add,addProduct,uploadFile, previewImage,delete_product},
+  components:{add,uploadAllData,addProduct,uploadFile, previewImage,delete_product},
   data () {
     return {
       tableHieght:"860px",
       totalPrice:0,
       tablecols:[],
+      tablecolsAdd:[],
       list:[],
       total:0,
       currentPage:0,
@@ -222,17 +237,36 @@ export default {
       productList:'',
       delProductData:[],
       discountrate:'',
+      paramsAdd:{
+        "id": 20221021171802,
+        "content": {
+          "sa_projectid": this.$route.query.id,
+          "pageNumber": 1,
+          "pageSize": 100,
+          "where": {
+            "condition": "",
+            "tradefield": "",
+            "standards": "",
+            "itemclassid": "",
+            "sa_brandid": "",
+            "model":"",
+            "spec":"",
+            "material":''
+          }
+        },
+      },
       params:{
         "id": 20221021145702,
         "content": {
-          "sa_projectid": 2,
+          "sa_projectid": this.$route.query.id,
           "pageNumber": 1,
           "pageSize": 100,
           "where": {
             "condition": ""
           }
         },
-      }
+      },
+      items:[]
     }
   },
   provide () {
@@ -246,16 +280,50 @@ export default {
     },*/
 
     async listData(){
+      console.log("成功")
       this.discountrate = Math.round((this.data.discountrate * 100) * 100) / 100
       this.totalPrice = 0
       this.params.content.sa_projectid = this.data.sa_projectid
       const res = await this.$api.requested(this.params)
       this.list = res.data
-      /*res.data.forEach((e,index)=>{
-        this.totalPrice = this.totalPrice + e.amount
-      })*/
+      res.data.forEach((e,index)=>{
+        this.list[index].price = this.list[index].price.toFixed(2)
+      })
       this.totalPrice = res.tips.amount
       this.total = res.total
+      this.$emit("delSuccess")
+    },
+    uploadData (uploadApi,data) {
+      uploadApi.id = 20221021145502
+      uploadApi.content = {
+        "sa_projectid": this.$route.query.id, //订单ID
+        "items": data.map(e=>{
+          return {
+            sa_project_itemsid:0,
+            itemid:e.itemid,
+            qty:e.orderminqty,
+            remarks:e.remarks,
+            marketprice:e.marketprice,
+            price:(e.marketprice * (this.discountrate / 100)).toFixed(4)
+          }
+        })
+      }
+    },
+    handlePullApi (pullApi) {
+      pullApi.content = JSON.parse(JSON.stringify(this.params.content))
+      pullApi.id = 20221021145702
+      pullApi.content.sa_projectid = this.$route.query.id
+    },
+    handleDelApi (delApi,data) {
+      delApi.id = 20221021145602
+      delApi.content = {
+        "deletereason": "",
+        "sa_projectid":this.$route.query.id,
+        "sa_project_itemsids":data,
+        "pageNumber":0,
+        "pageSize":0
+      }
+      this.listData()
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
@@ -267,6 +335,50 @@ export default {
       this.params.content.pageNumber = val
       this.listData()
     },
+    async addProducts(items){
+      console.log(items,'商品明细')
+      this.items = []
+      this.items = items.map(e=>{
+        return {
+          sa_project_itemsid:0,
+          itemid:e.itemid,
+          qty:e.orderminqty,
+          remarks:e.remarks,
+          marketprice:e.marketprice,
+          price:(e.marketprice * (this.discountrate / 100)).toFixed(4)
+        }
+      })
+      const res = await this.$api.requested({
+        "id": 20221021145502,
+        "content": {
+          "sa_projectid": this.$route.query.id,
+          "items": this.items
+        },
+      })
+      this.$refs.addProduct.listData()
+      this.listData()
+    },
+    async addProduct(items){
+      console.log(items,'商品明细')
+      const res = await this.$api.requested({
+        "id": 20221021145502,
+        "content": {
+          "sa_projectid": this.$route.query.id,
+          "items": [
+            {
+              "sa_project_itemsid":0,
+              "itemid": items.itemid,
+              "qty": items.orderminqty,
+              "remarks": "",
+              "marketprice":items.marketprice,
+              "price":(items.marketprice * (this.discountrate / 100)).toFixed(4)
+            }
+          ]
+        },
+      })
+      this.$refs.addProduct.listData()
+      this.listData()
+    },
     onSuccess(){
       this.listData()
       this.$emit("productSetSuccess")
@@ -403,7 +515,8 @@ export default {
   },
   created() {
     /*this.getProductList()*/
-    this.tablecols = this.tool.tabelCol(this.$route.name).projectSetTable.tablecols
+    /*this.tablecols = this.tool.tabelCol(this.$route.name).projectSetTable.tablecols*/
+    this.tablecolsAdd = this.tool.tabelCol(this.$route.name).addProductTable.tablecols
    /* this.data.discountrate = Math.round((this.data.discountrate * 100) * 100) / 100*/
   },
   mounted () {

+ 153 - 4
src/SDrpManagement/QuotedPrice/detail/modules/productInventory/index.vue

@@ -13,9 +13,27 @@
           clearable>
       </el-input>&nbsp;
 <!--      <product_table style="float: right" :data="data"  ref="quoterPrice" @productAdd="productInitialization" ></product_table>-->
+      <uploadAllData
+          class="inline-16"
+          :total="total"
+          @onSuccess="productData()"
+          @handlePullApi="handlePullApi"
+          @handleDelApi="handleDelApi"
+          idName="sa_quotedprice_itemsid"
+          type="del"
+      ></uploadAllData>
       <el-button size="small" class="inline-16" :type="itemids.length === 0?'':'primary'" :disabled="itemids.length === 0" @click="deleteProducts">删除</el-button>
-      <productTableProject v-if="tool.checkAuth($route.name,'productDetails') && data.status === '新建' && disabled && data.quotedpricetype === '项目报价'"  :sa_projectid="data.sa_projectid" :type="data.quotedpricetype" class="inline-16" @productAdd="productData"></productTableProject>
-      <productTable v-if="tool.checkAuth($route.name,'productDetails') && data.status === '新建' && disabled"  class="inline-16" @productAdd="productData"></productTable>
+      <addProductProject v-if="tool.checkAuth($route.name,'productDetails') && data.status === '新建' && disabled && data.quotedpricetype === '项目报价'"
+                           class="inline-16" @productAdd="productData" title="自项目产品添加" :params="paramsProjectAdd" :tablecolsAdd="tablecolsAdd"
+                         @addSuccess="addProducts" @addProduct="addProduct" @uploadData="uploadData" @closeDrawer="productData"
+                         :tradefield="data.tradefield" ref="addProductProject"
+      ></addProductProject>
+<!--      <productTable v-if="tool.checkAuth($route.name,'productDetails') && data.status === '新建' && disabled"  class="inline-16" @productAdd="productData"></productTable>-->
+      <addProduct v-if="tool.checkAuth($route.name,'productDetails') && data.status === '新建' && disabled"
+                  class="inline-16" @productAdd="productData" :params="paramsAdd" :tablecolsAdd="tablecolsAdd" title="自产品档案添加"
+                  @addSuccess="addProducts" @addProduct="addProduct" @uploadData="uploadData" @closeDrawer="productData"
+                  :tradefield="data.tradefield" ref="addProduct"
+      ></addProduct>
     </div>
     <div class="produtMag-panel">
       <el-table
@@ -305,13 +323,18 @@ import previewImage from "@/components/previewImage";
 import product_table from './productTable'
 import productTableProject from "@/SDrpManagement/QuotedPrice/components/productTableProject";
 import productTable from "@/SDrpManagement/QuotedPrice/components/productTable";
+import addProduct from '@/template/addProduct'
+import addProductProject from '@/template/addProduct'
+import uploadAllData from '@/components/uploadAllData/index'
 export default {
   props:["data","disabled"],
   name: "productInventory",
-  components:{uploadFile, previewImage,product_table,productTableProject,productTable},
+  components:{uploadAllData,addProductProject,addProduct,uploadFile, previewImage,product_table,productTableProject,productTable},
   data(){
     return {
+      discountrate:'',
       tablecols:[],
+      tablecolsAdd:[],
       list:[],
       total:0,
       currentPage:0,
@@ -325,6 +348,40 @@ export default {
       setDownColor:{
         color:'#ef230c'
       },
+      paramsAdd:{
+        "id": 20221020164903,
+        "content": {
+          "sa_projectid":0,
+          "sa_quotedpriceid":this.$route.query.id,
+          "pageNumber": 1,
+          "pageSize": 100,
+          "where": {
+            "condition": "",
+            "tradefield":"",
+            "itemclassid":"",
+            "sa_brandid":"",
+            "standards":""
+          }
+
+        }
+      },
+      paramsProjectAdd:{
+        "id": 20221020164903,
+        "content": {
+          "sa_projectid":this.data.sa_projectid,
+          "sa_quotedpriceid":this.$route.query.id,
+          "pageNumber": 1,
+          "pageSize": 100,
+          "where": {
+            "condition": "",
+            "tradefield":"",
+            "itemclassid":"",
+            "sa_brandid":"",
+            "standards":""
+          }
+
+        }
+      },
       param:{
         "id": 20221021095503,
         "content": {
@@ -336,7 +393,8 @@ export default {
           }
         }
       },
-      itemids:[]
+      itemids:[],
+      items:[]
     }
   },
   methods:{
@@ -360,6 +418,78 @@ export default {
       this.$emit('productSuccess')
 
     },
+    /*批量添加商品*/
+    async addProducts(item){
+      this.items = []
+      this.items = item.map(e=>{
+        this.discountrate = e.discountrate || this.data.discountrate.toFixed(4)
+        return {
+          "sa_quotedprice_itemsid":0,
+          "itemid":e.itemid,
+          "price":(e.marketprice * this.discountrate).toFixed(4),
+          "marketprice":e.marketprice,
+          "discountrate":this.discountrate,
+          "qty":e.qty === ''? e.orderminqty:e.qty
+        }
+      })
+      const res = await this.$api.requested({
+        "id": 20221021095403,
+        "content": {
+          "sa_quotedpriceid":this.$route.query.id,     //sat_notice_classid<=0时 为新增
+          "items":this.items
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.productData()
+        this.$refs.addProduct.listData()
+        this.$refs.addProductProject.listData()
+
+      })
+    },
+    /*单个添加商品*/
+    async addProduct(item){
+      this.discountrate = item.discountrate || this.data.discountrate.toFixed(4)
+      const res = await this.$api.requested({
+        "id": 20221021095403,
+        "content": {
+          "sa_quotedpriceid":this.$route.query.id,     //sat_notice_classid<=0时 为新增
+          "items":[
+            {
+              "sa_quotedprice_itemsid":0,
+              "itemid":item.itemid,
+              "price":(item.marketprice * this.discountrate).toFixed(4),
+              "discountrate":this.discountrate,
+              "qty":item.qty === '' ? item.orderminqty : item.qty,
+            }
+          ]
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.productData()
+        this.$refs.addProduct.listData()
+        this.$refs.addProductProject.listData()
+      })
+    },
+    /*一键全选*/
+    uploadData(uploadApi,data){
+      uploadApi.id = 20221021095403
+      uploadApi.content = {
+        "sa_quotedpriceid": this.$route.query.id, //订单ID
+        "items": data.map(e=>{
+          this.discountrate = e.discountrate || this.data.discountrate.toFixed(4)
+          return {
+            sa_quotedprice_itemsid:0,
+            itemid:e.itemid,
+            qty:e.qty === '' ? e.orderminqty : e.qty,
+            marketprice:e.marketprice,
+            price:(e.marketprice * this.discountrate).toFixed(4),
+            discountrate:this.discountrate
+          }
+        })
+      }
+      this.productData()
+      this.$refs.addProduct.listData()
+    },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
       this.param.content.pageSize = val
@@ -430,6 +560,22 @@ export default {
         });
       });
     },
+    /*获取要删除的数据*/
+    handlePullApi (pullApi) {
+      pullApi.content = JSON.parse(JSON.stringify(this.param.content))
+      pullApi.id = 20221021095503
+      pullApi.content.sa_quotedpriceid = this.$route.query.id
+    },
+    /*一键删除*/
+    handleDelApi (delApi,data) {
+      delApi.id = 20221021095603
+      delApi.content = {
+        "sa_quotedprice_itemsids":data,
+        "pageNumber":0,
+        "pageSize":0
+      }
+      this.productData()
+    },
     onChangeNum (val,data,index) {
       data.qty = Math.round(val *100)/100
       data.amount = Math.round((data.qty * data.price) * 100)/100
@@ -513,6 +659,9 @@ export default {
   },
   mounted() {
     this.productData()
+  },
+  created() {
+    this.tablecolsAdd = this.tool.tabelCol(this.$route.name).addProductTable.tablecols
   }
 }
 </script>

+ 560 - 0
src/SDrpManagement/QuotedPrice/detail/modules/productInventory/indexCopy.vue

@@ -0,0 +1,560 @@
+<template>
+  <div>
+    <div style="margin-bottom: 15px">
+      <el-input
+          size="small"
+          style="width: 200px;"
+          class="inline-16"
+          suffix-icon="el-icon-search"
+          v-model="param.content.where.condition"
+          placeholder="产品名称,产品编号,品号"
+          @keyup.enter.native="productData(param.content.pageNumber = 1)"
+          @clear="productData(param.content.pageNumber = 1)"
+          clearable>
+      </el-input>&nbsp;
+<!--      <product_table style="float: right" :data="data"  ref="quoterPrice" @productAdd="productInitialization" ></product_table>-->
+      <el-button size="small" class="inline-16" :type="itemids.length === 0?'':'primary'" :disabled="itemids.length === 0" @click="deleteProducts">删除</el-button>
+      <productTableProject v-if="tool.checkAuth($route.name,'productDetails') && data.status === '新建' && disabled && data.quotedpricetype === '项目报价'"  :sa_projectid="data.sa_projectid" :type="data.quotedpricetype" class="inline-16" @productAdd="productData"></productTableProject>
+<!--      <productTable v-if="tool.checkAuth($route.name,'productDetails') && data.status === '新建' && disabled"  class="inline-16" @productAdd="productData"></productTable>-->
+      <addProduct v-if="tool.checkAuth($route.name,'productDetails') && data.status === '新建' && disabled"
+                  class="inline-16" @productAdd="productData" :params="paramsAdd" :tablecolsAdd="tablecolsAdd" title="自产品档案添加"
+                  @addSuccess="addProducts"
+      ></addProduct>
+    </div>
+    <div class="produtMag-panel">
+      <el-table
+          ref="multipleTable"
+          :data="list"
+          style="width: 100%"
+          height="calc(100vh - 500px)"
+          :header-cell-style="{height:'50px',color:'#606266',fontWeight:'400'}"
+          :cell-style="{height:'50px',color:'#666666',fontWeight:'400'}"
+          @selection-change="selectionChange"
+         >
+        <el-table-column
+            type="selection"
+            width="55"
+            fixed>
+        </el-table-column>
+        <el-table-column
+            align="center"
+            label="产品图"
+            width="100">
+          <template slot-scope="scope">
+            <div v-if="scope.row.attinfos[0]">
+              <previewImage class="image" :image="scope.row.attinfos[0]" :list="scope.row.attinfos" :deletebtn="false"></previewImage>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="num"
+            label="数量"
+            width="160"
+        >
+          <template slot-scope="scope">
+            <span>
+              <el-input-number :disabled="!saveShow || index !== scope.row.rowindex" v-model="scope.row.qty" size="mini"  :min="1" label="描述文字" @change="onChangeNum(scope.row.qty,scope.row,scope.$index)"></el-input-number>
+            </span>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="marketprice"
+            label="牌价"
+            width="80"
+        >
+          <template slot-scope="scope">
+            <p><span>{{scope.row.marketprice?tool.formatAmount(scope.row.marketprice,2):'--'}}</span></p>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="discountrate"
+            label="折扣(%)"
+            width="100"
+        >
+          <template slot-scope="scope">
+            <div v-if="scope.row.discountDifferenceAmount >= 0 ">
+              <p v-if="!saveShow || index !== scope.row.rowindex"><span :style="[setTopColor]">{{scope.row.discountrate}}</span></p>
+              <span v-if="saveShow && index === scope.row.rowindex">
+                 <el-input v-model="scope.row.discountrate" size="mini" placeholder="请输入折扣" @change="onChangeDiscountrate(scope.row.discountrate,scope.row,scope.$index)"></el-input>
+              </span>
+            </div>
+            <div v-else-if="scope.row.discountDifferenceAmount < 0 ">
+              <p v-if="!saveShow || index !== scope.row.rowindex"><span :style="[setDownColor]">{{scope.row.discountrate}}</span></p>
+              <span v-if="saveShow && index === scope.row.rowindex">
+                 <el-input v-model="scope.row.discountrate" size="mini" placeholder="请输入折扣" @change="onChangeDiscountrate(scope.row.discountrate,scope.row,scope.$index)"></el-input>
+              </span>
+            </div>
+<!--            <span v-else>
+              <span v-if="saveShow && index === scope.row.rowindex">
+                 <el-input v-model="scope.row.discountrate" size="mini" placeholder="请输入折扣" @change="onChangeDiscountrate(scope.row.discountrate,scope.row,scope.$index)"></el-input>
+              </span>
+              <span v-else>
+                <span >{{tool.formatAmount(scope.row.discountrate,2)}}</span>
+              </span>
+
+            </span>-->
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="price"
+            label="单价"
+            width="120"
+        >
+          <template slot-scope="scope">
+            <div v-if="scope.row.discountDifferenceAmount >= 0 ">
+              <p v-if="!saveShow || index !== scope.row.rowindex"><span :style="[setTopColor]">{{tool.formatAmount(scope.row.price,2)}}</span></p>
+              <span v-if="saveShow && index === scope.row.rowindex">
+                <el-input v-model="scope.row.price" size="mini" placeholder="请输入单价" @change="onChangePrice(scope.row.price,scope.row,scope.$index)"></el-input>
+              </span>
+            </div>
+            <div v-else-if="scope.row.discountDifferenceAmount < 0 " >
+              <p v-if="!saveShow || index !== scope.row.rowindex"><span :style="[setDownColor]">{{tool.formatAmount(scope.row.price,2)}}</span></p>
+              <span v-if="saveShow && index === scope.row.rowindex">
+                <el-input v-model="scope.row.price" size="mini" placeholder="请输入单价" @change="onChangePrice(scope.row.price,scope.row,scope.$index)"></el-input>
+              </span>
+            </div>
+<!--            <span v-else>
+              <span v-if="saveShow && index === scope.row.rowindex">
+                <el-input v-model="scope.row.price" size="mini" placeholder="请输入单价" @change="onChangePrice(scope.row.price,scope.row,scope.$index)"></el-input>
+              </span>
+               <span v-else>
+                <span >{{tool.formatAmount(scope.row.price,2)}}</span>
+              </span>
+            </span>-->
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="discountDifferenceAmount"
+            label="单价差额(元)"
+            width="100"
+        >
+          <template slot-scope="scope">
+            <p><span>{{tool.formatAmount(scope.row.discountDifferenceAmount,2)}}</span></p>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="itemno"
+            label="产品编号"
+            width="180">
+        </el-table-column>
+        <el-table-column
+            prop="itemname"
+            label="产品名称"
+            width="180">
+        </el-table-column>
+        <el-table-column
+            prop="erpitemno"
+            label="品号"
+            width="180">
+        </el-table-column>
+        <el-table-column
+            prop="standards"
+            label="标准"
+            width="100">
+        </el-table-column>
+        <el-table-column
+            label="型号"
+            width="180">
+          <template slot-scope="scope">
+            <p><span>{{scope.row.model}}</span></p>
+          </template>
+        </el-table-column>
+        <el-table-column
+            label="规格"
+            width="180">
+          <template slot-scope="scope">
+            <p><span>{{scope.row.spec}}</span></p>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="material"
+            label="材质"
+            width="180">
+          <template slot-scope="scope">
+            <p><span>{{scope.row.material?scope.row.material:'--'}}</span></p>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="device"
+            label="装置"
+            width="180">
+          <template slot-scope="scope">
+            <p><span>{{scope.row.device || '--'}}</span></p>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="prodline"
+            label="产线"
+            width="180">
+          <template slot-scope="scope">
+            <p><span>{{scope.row.prodline || '--'}}</span></p>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="specalnote"
+            label="特殊说明"
+            width="180">
+          <template slot-scope="scope">
+            <p><span>{{scope.row.specalnote || '--'}}</span></p>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="brand"
+            label="品牌"
+            width="200">
+          <template slot-scope="scope">
+            <p v-for="(item,index) in scope.row.brand">
+              <span style="float: left" v-if="index === scope.row.brand.length -1">{{item?item.brandname+'':'--'}}</span>
+              <span style="float: left" v-else>{{item?item.brandname+',':'--'}}</span>
+            </p>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="itemclass"
+            label="类别"
+            width="200">
+          <template slot-scope="scope">
+            <p v-for="(item,index) in scope.row.itemclass">
+              <span style="float: left" v-if="index === scope.row.itemclass.length -1">{{item?item.itemclassname+'':'--'}}</span>
+              <span style="float: left" v-else>{{item?item.itemclassname+',':'--'}}</span>
+            </p>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="unitid"
+            label="计量单位"
+            width="100">
+          <template slot-scope="scope">
+            <el-tag size="mini" type="info" effect="plain">{{scope.row.unitname}}/{{scope.row.axunitname}}</el-tag>
+          </template>
+        </el-table-column>
+
+        <el-table-column
+            prop="mindiscountrate"
+            label="最低授权折扣(%)"
+            width="80"
+            >
+          <template slot-scope="scope">
+            <p><span>{{scope.row.mindiscountrate}}</span></p>
+          </template>
+        </el-table-column>
+
+        <el-table-column
+            prop="amount"
+            label="金额"
+            width="100"
+            fixed="right">
+          <template slot-scope="scope">
+            <div v-if="scope.row.discountDifferenceAmount >= 0  ">
+              <p ><span style="color: #79da56">{{tool.formatAmount(scope.row.amount,2)}}</span></p>
+            </div>
+            <div v-else-if="scope.row.discountDifferenceAmount < 0 " >
+              <p><span style="color: #ef230c ">{{tool.formatAmount(scope.row.amount,2)}}</span></p>
+            </div>
+<!--            <p v-else><span>{{tool.formatAmount(scope.row.amount,2)}}</span></p>-->
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="specialoffer"
+            label="是否特价"
+            width="50"
+            fixed="right">
+          <template slot-scope="scope">
+            <i class="el-icon-check" v-if="scope.row.discountDifferenceAmount < 0"  style="color: red;font-size: 20px"></i>
+            <p v-else>--</p>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="operation"
+            fixed="right"
+            label="操作"
+            width="120">
+          <template slot-scope="scope">
+            <el-button  size="mini" type="text" class="inline-16" @click="onEdit(scope.row)" v-if="index !== scope.row.rowindex" :disabled="!tool.checkAuth($route.name,'productDetails') || data.status !== '新建' || !disabled">编 辑</el-button>
+            <el-button  size="mini" type="text" class="inline-16" @click="onSave(scope.row)" v-if="saveShow && index === scope.row.rowindex">保 存</el-button>
+            <el-popconfirm
+                title="确定删除该产品吗?"
+                @confirm="deleteProduct(scope.row)"
+            >
+              <el-button class="inline-16" slot="reference" size="mini" type="text"  :disabled="!tool.checkAuth($route.name,'productDetails') || data.status !== '新建' || !disabled" >删 除</el-button>
+            </el-popconfirm>
+
+<!--            <el-button  size="mini" type="text" class="inline-16" @click="saveShow = false;index = '';productData()" v-if="saveShow && index === scope.row.rowindex">取 消</el-button>-->
+          </template>
+        </el-table-column>
+      </el-table>
+      <div style="height: 35px;margin-top: 20px">
+        <div style="float: left">总金额(元):{{ tool.formatAmount(totalPrice,2) }}</div>
+        <div style="float: right">
+          <el-pagination
+              background
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="param.content.pageNumber"
+              :page-sizes="[20, 50, 100, 200]"
+              :page-size="100"
+              layout="total,sizes, prev, pager, next, jumper"
+              :total="total">
+          </el-pagination>
+        </div>
+
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import uploadFile from "@/components/upload/hw_obs_upload";
+import previewImage from "@/components/previewImage";
+import product_table from './productTable'
+import productTableProject from "@/SDrpManagement/QuotedPrice/components/productTableProject";
+import productTable from "@/SDrpManagement/QuotedPrice/components/productTable";
+import addProduct from '@/template/addProduct'
+export default {
+  props:["data","disabled"],
+  name: "productInventory",
+  components:{addProduct,uploadFile, previewImage,product_table,productTableProject,productTable},
+  data(){
+    return {
+      tablecols:[],
+      tablecolsAdd:[],
+      list:[],
+      total:0,
+      currentPage:0,
+      changeList:[],
+      totalPrice:0,
+      saveShow:false,
+      index:'',
+      setTopColor:{
+        color:'#79da56'
+      },
+      setDownColor:{
+        color:'#ef230c'
+      },
+      paramsAdd:{
+        "id": 20221020164903,
+        "content": {
+          "sa_projectid":0,
+          "sa_quotedpriceid":"",
+          "pageNumber": 1,
+          "pageSize": 100,
+          "where": {
+            "condition": "",
+            "tradefield":"",
+            "itemclassid":"",
+            "sa_brandid":"",
+            "standards":""
+          }
+
+        }
+      },
+      param:{
+        "id": 20221021095503,
+        "content": {
+          "sa_quotedpriceid":'',
+          "pageNumber": 1,
+          "pageSize": 100,
+          "where": {
+            "condition": ""
+          }
+        }
+      },
+      itemids:[]
+    }
+  },
+  methods:{
+    /*产品配置信息*/
+    async productData(){
+      this.param.content.sa_quotedpriceid = this.$route.query.id
+      const res = await this.$api.requested(this.param)
+      this.list = res.data
+      this.total = res.total
+      this.totalPrice = 0
+      for (var i=0 ;i<res.data.length;i++){
+        this.list[i].discountrate = Math.round((res.data[i].discountrate * 100)*100)/100
+        this.list[i].mindiscountrate = Math.round((res.data[i].mindiscountrate * 100) * 100)/100
+        this.list[i].price = Math.round(res.data[i].price * 100)/100
+        this.list[i].discountDifferenceAmount = Math.round(res.data[i].discountDifferenceAmount * 100)/100
+       /* this.totalPrice = this.totalPrice + res.data[i].qty * res.data[i].price*/
+      }
+      if (this.total !== 0){
+        this.totalPrice = Math.round(res.data[0].rowstotal[0].sumamount * 100)/100
+      }
+      this.$emit('productSuccess')
+
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.productData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.productData()
+    },
+    onSuccess(){
+      this.productData()
+    },
+    clearData(){
+      this.search = ""
+      this.param.content.where.condition = this.search
+      this.productData()
+    },
+    queryClick(){
+      this.param.content.where.condition = this.search
+      this.productData()
+    },
+    /*批量勾选*/
+    selectionChange(val){
+      this.itemids = []
+      val.forEach((item,index)=>{
+        this.itemids[index] = item.sa_quotedprice_itemsid
+      })
+    },
+    checkForm(){
+      this.$emit('checkForm')
+    },
+    quoterPrice(id,type){
+      this.$refs.quoterPrice.queryProduct(id,type)
+    },
+    /*删除添加的产品*/
+    async deleteProduct(val){
+      const res = await this.$api.requested({
+        "id": 20221021095603,
+        "content": {
+          "sa_quotedprice_itemsids":[val.sa_quotedprice_itemsid]     //sat_notice_classid<=0时 为新增
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.productData()
+      })
+    },
+    /*批量删除添加的产品*/
+   deleteProducts(){
+      this.$confirm('确定删除已选的产品吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        const res = await this.$api.requested({
+          "id": 20221021095603,
+          "content": {
+            "sa_quotedprice_itemsids":this.itemids     //sat_notice_classid<=0时 为新增
+          }
+        })
+        this.tool.showMessage(res,()=>{
+          this.productData()
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+    },
+    onChangeNum (val,data,index) {
+      data.qty = Math.round(val *100)/100
+      data.amount = Math.round((data.qty * data.price) * 100)/100
+      data.discountDifferenceAmount = Math.round((data.marketprice * (data.discountrate/100) - data.marketprice * (data.mindiscountrate/100)) * 100)/100
+      this.$set(this.list,index,data)
+      this.totalPrice = 0
+      for (var i=0 ;i<this.list.length;i++){
+        this.totalPrice = this.totalPrice + this.list[i].qty * this.list[i].price
+      }
+      this.totalPrice = Math.round(this.totalPrice * 100)/100
+      this.$emit('productData',this.list)
+    },
+    onChangeDiscountrate(val,data,index) {
+      data.specialoffer = 0
+      if (val > 100){
+        data.discountrate = 100
+      }else if (val <= 0){
+        data.discountrate = 1
+      }else {
+        data.discountrate = Math.round(val * 100)/100
+      }
+      data.price = Math.round((data.marketprice * (data.discountrate / 100)) *100)/100
+      data.amount = Math.round((data.qty * data.price)*100)/100
+      data.discountDifferenceAmount =  Math.round(( data.marketprice * (data.discountrate/100) - data.marketprice * (data.mindiscountrate/100)) * 100)/100
+      if (data.discountDifferenceAmount < 0){
+        data.specialoffer =1
+      }
+      this.$set(this.list,index,data)
+      this.totalPrice = 0
+      for (var i=0 ;i<this.list.length;i++){
+        this.totalPrice = this.totalPrice + this.list[i].qty * this.list[i].price
+      }
+      this.totalPrice = Math.round(this.totalPrice * 100)/100
+      this.$emit('productData',this.list)
+    },
+    onChangePrice(val,data,index){
+      data.specialoffer = 0
+      if (val > data.marketprice) {
+        data.price = data.marketprice
+      }else if (val < data.marketprice * 0.01){
+        data.price = data.marketprice * 0.01
+      }else {
+        data.price = Math.round(data.price * 100)/100
+      }
+      data.discountrate = Math.round(((data.price / data.marketprice) * 100) *100)/100
+      data.discountDifferenceAmount =  Math.round(( data.marketprice * (data.discountrate/100) - data.marketprice * (data.mindiscountrate/100)) * 100)/100
+      data.amount = Math.round((data.qty * data.price)*100)/100
+      if (data.discountDifferenceAmount < 0){
+        data.specialoffer =1
+      }
+      this.$set(this.list,index,data)
+      this.totalPrice = 0
+      for (var i=0 ;i<this.list.length;i++){
+        this.totalPrice = this.totalPrice + this.list[i].qty * this.list[i].price
+      }
+      this.totalPrice = Math.round(this.totalPrice * 100)/100
+      this.$emit('productData',this.list)
+    },
+    onEdit(row){
+      this.saveShow = true
+      this.index = row.rowindex
+    },
+    async onSave(row){
+
+      row.discountrate = (row.discountrate / 100).toFixed(4)
+      const res = await this.$api.requested({
+        "id": 20221021095403,
+        "content": {
+          "sa_quotedpriceid":this.$route.query.id,     //sat_notice_classid<=0时 为新增
+          "items":[row]
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.saveShow = false
+        this.index = ''
+        this.productData()
+        this.$emit('productSuccess')
+
+      })
+    }
+  },
+  mounted() {
+    this.productData()
+  },
+  created() {
+    this.tablecolsAdd = this.tool.tabelCol(this.$route.name).addProductTable.tablecols
+  }
+}
+</script>
+
+<style scoped>
+.produtMag-panel{
+  /* margin: 30px; */
+  padding:0 10px 10px 10px;
+  background: #fff;
+  border-radius:5px;
+  overflow: hidden;
+  border:1px solid rgb(0 0 0 / 5%)
+  /* box-shadow: 0 5px 5px rgb(0 0 0 / 10%);
+  transform: translate3d(0,-2px,0); */
+}
+.image {
+  width:38px;height:38px;margin:0px auto;
+}
+</style>

+ 2 - 0
src/components/uploadAllData/index.vue

@@ -14,6 +14,8 @@
 </template>
 
 <script>
+import {log} from "@antv/g2plot/lib/utils";
+
 export default {
   name: '',
   data() {

+ 112 - 45
src/template/addProduct/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-button size="small" type="primary" @click="onShow" >添 加</el-button>
+    <el-button size="small" type="primary" @click="onShow" >{{title}}</el-button>
     <el-drawer
         title="添加商品"
         :visible.sync="dialogFormVisible"
@@ -11,7 +11,7 @@
         @close="onClose">
       <div class="drawer__panel">
         <div class="flex-between">
-          <el-select v-model="sa_brandid" placeholder="选择品牌" size="small" clearable class="inline-24" @change="queryClass">
+          <el-select v-model="sa_brandid" placeholder="选择品牌" size="small" clearable class="inline-24" @change="brandChange">
             <el-option
                 v-for="item in options.brands"
                 :key="item.sa_brandid"
@@ -21,42 +21,54 @@
           </el-select>
           <el-cascader
               placeholder="选择分类" size="small"
+              v-model="itemclassid"
               :options="options.itemclass"
               :props="{ checkStrictly: true,children:'subdep',label:'itemclassname',value:'itemclassid' }"
-              clearable></el-cascader>
+              clearable @change="classChange"></el-cascader>
         </div>
         <div class="top-margin">
-          <el-button size="small" class="bottom-margin inline-16">一键全选</el-button>
-          <el-button size="small" class="inline-24 bottom-margin">添加选中商品</el-button>
+          <uploadAllData
+              class="inline-16"
+              :total="total"
+              @handlePullApi="handlePullApi"
+              @handleUploadApi="handleUploadApi"
+              @onSuccess="onSuccess"
+          ></uploadAllData>
+          <el-button :disabled="items.length === 0" :type="items.length > 0?'primary':''" size="small" class="inline-24 bottom-margin" @click="batchAdd">添加选中商品</el-button>
           <el-input  style="width:200px;" placeholder="商品名称/编码/品号" :suffix-icon="params.content.where.condition?params.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="params.content.where.condition" @keyup.native.enter="listData(params.content.pageNumber = 1)" @clear="listData(params.content.pageNumber = 1)" size="small" class="input-with-select inline-24 layout_search__panel bottom-margin" clearable>
           </el-input>
-          <el-select v-model="sa_brandid" placeholder="选择标准" size="small" clearable class="inline-24 bottom-margin" @change="queryClass">
+          <el-select v-model="itemstandard" placeholder="选择标准" size="small" clearable class="inline-24 bottom-margin" @change="queryChange">
             <el-option
-                v-for="item in options.brands"
-                :key="item.sa_brandid"
-                :label="item.brandname"
-                :value="item.sa_brandid">
+                v-for="item in options.itemstandards"
+                :key="item.value"
+                :label="item.value"
+                :value="item.value">
+              <span style="float: left">{{ item.value }}</span>
+              <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?item.remarks:'暂无描述' }}</span>
             </el-option>
           </el-select>
-          <el-select v-model="sa_brandid" placeholder="选择材质" size="small" clearable class="inline-24 bottom-margin" @change="queryClass">
+          <el-select v-model="itemmaterial" placeholder="选择材质" size="small" clearable class="inline-24 bottom-margin" @change="queryChange">
             <el-option
-                v-for="item in options.brands"
-                :key="item.sa_brandid"
-                :label="item.brandname"
-                :value="item.sa_brandid">
+                v-for="item in options.itemmaterials"
+                :key="item.value"
+                :label="item.value"
+                :value="item.value">
+              <span style="float: left">{{ item.value }}</span>
+              <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?item.remarks:'暂无描述' }}</span>
             </el-option>
           </el-select>
-          <el-input  style="width:200px;" placeholder="型号" :suffix-icon="params.content.where.condition?params.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="params.content.where.condition" @keyup.native.enter="listData(params.content.pageNumber = 1)" @clear="listData(params.content.pageNumber = 1)" size="small" class="bottom-margin input-with-select inline-24 layout_search__panel" clearable>
+          <el-input  style="width:200px;" placeholder="型号" :suffix-icon="params.content.where.model?params.content.where.model.length > 0?'':'':'el-icon-search'" v-model="params.content.where.model" @keyup.native.enter="listData(params.content.pageNumber = 1)" @clear="listData(params.content.pageNumber = 1)" size="small" class="bottom-margin input-with-select inline-24 layout_search__panel" clearable>
           </el-input>
-          <el-input  style="width:200px;" placeholder="规格" :suffix-icon="params.content.where.condition?params.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="params.content.where.condition" @keyup.native.enter="listData(params.content.pageNumber = 1)" @clear="listData(params.content.pageNumber = 1)" size="small" class="bottom-margin input-with-select inline-24 layout_search__panel" clearable>
+          <el-input  style="width:200px;" placeholder="规格" :suffix-icon="params.content.where.spec?params.content.where.spec.length > 0?'':'':'el-icon-search'" v-model="params.content.where.spec" @keyup.native.enter="listData(params.content.pageNumber = 1)" @clear="listData(params.content.pageNumber = 1)" size="small" class="bottom-margin input-with-select inline-24 layout_search__panel" clearable>
           </el-input>
         </div>
         <div class="top-margin">
-          <tableTemp :data="list" :layout="tablecols" :opwidth="200" :custom="true" height="calc(100vh - 370px)">
+          <tableTemp :data="list" :layout="tablecolsAdd" :opwidth="200" :custom="true" height="calc(100vh - 370px)" @checkboxCallBack="checkboxCallBack">
             <template v-slot:customcol="scope">
               <p >{{scope.column.data[scope.column.columnname]}}</p>
             </template>
             <template v-slot:opreation="scope">
+              <el-button type="text" size="mini" @click="addProduct(scope)">添 加</el-button>
             </template>
           </tableTemp>
           <div  class="container normal-panel" style="text-align:right">
@@ -79,54 +91,66 @@
 
 <script>
 import tableTemp from './table'
+import uploadAllData from '@/components/uploadAllData/index'
+
 export default {
   name: "index",
-  props:["tradefield"],
-  components:{tableTemp},
+  props:["data","tradefield","discountrate","params","title","tablecolsAdd","sa_projectid"],
+  components:{tableTemp,uploadAllData},
   data(){
     return {
       dialogFormVisible:false,
       sa_brandid:'',
       itemclassid:'',
-      tablecols:{},
+      itemstandard:'',
+      itemmaterial:'',
       list:[],
       total:0,
       options:{
         brands:[],
-        itemclass:[]
-      },
-      params:{
-        "id": 20221021171802,
-        "content": {
-          "sa_projectid": 2,
-          "pageNumber": 1,
-          "pageSize": 100,
-          "where": {
-            "condition": "",
-            "tradefield": "",
-            "standards": "",
-            "itemclassid": "",
-            "sa_brandid": ""
-          }
-        },
+        itemclass:[],
+        itemstandards:[],
+        itemmaterials:[]
       },
+      items:[]
     }
   },
   methods:{
     onShow(){
       this.dialogFormVisible = true
-      console.log(this.tradefield)
+      this.$store.dispatch('optiontypeselect','itemstandards').then(res=>{
+        this.options.itemstandards = res.data
+      })
+      this.$store.dispatch('optiontypeselect','itemmaterial').then(res=>{
+        this.options.itemmaterials = res.data
+      })
       this.queryBrands()
       this.listData()
     },
     /*可添加商品*/
     async listData(){
-      this.params.content.sa_projectid = this.$route.query.id
+      console.log(this.tradefield,'领域')
+      switch (this.data.type) {
+        case '标准订单':
+          this.params.id = 20221109153502
+          break;
+        case '项目订单':
+          this.params.id = 20230103155002
+          break;
+        case '促销订单':
+          this.params.id = 20230107182302
+          break;
+        case '工具订单':
+          this.params.id = 20221109153502
+          break;
+        default:
+          this.params.id = 20221109153502
+          break;
+      }
+      this.params.content.where.tradefield = this.tradefield
       const res = await this.$api.requested(this.params)
-      console.log(res,'可添加商品')
       this.list = res.data
       this.total = res.total
-      console.log(this.list)
     },
     /*获取品牌*/
     async queryBrands () {
@@ -141,6 +165,11 @@ export default {
       })
       this.options.brands = res.data
     },
+    brandChange(){
+      this.params.content.where.sa_brandid = this.sa_brandid
+      this.listData()
+      this.queryClass()
+    },
     /*获取分类*/
     async queryClass () {
       const res = await this.$api.requested({
@@ -149,12 +178,50 @@ export default {
           "sa_brandid":this.sa_brandid !== '' ? this.sa_brandid : 0
         }
       })
-      console.log(res.data,'pop')
       this.options.itemclass = res.data[0].ttemclass
-      console.log(this.options.itemclass,'pop')
+
+    },
+    classChange(){
+      this.params.content.where.itemclassid = this.itemclassid[this.itemclassid.length -1]
+      this.listData()
+    },
+    queryChange(){
+      this.params.content.where.standards = this.itemstandard
+      this.params.content.where.material = this.itemmaterial
+      this.listData()
+    },
+    /*拉取数据*/
+    handlePullApi (pullApi) {
+      pullApi.content = JSON.parse(JSON.stringify(this.params.content))
+      pullApi.id = this.params.id
+      /*pullApi.content.sa_projectid = this.$route.query.id*/
+    },
+    /*上传数据*/
+    handleUploadApi (uploadApi,data) {
+      this.$emit('uploadData',uploadApi,data)
+    },
+    /*勾选*/
+    checkboxCallBack(val){
+      this.items = val
+    },
+    /*批量添加*/
+    batchAdd(){
+      console.log(this.items,'item')
+      this.$emit('addSuccess',this.items)
+    },
+    /*添加商品*/
+    addProduct(val){
+      console.log(val,'添加商品')
+      this.items = val
+      this.$emit('addProduct',this.items.data)
+    },
+    onSuccess () {
+      console.log('成功')
+      this.listData()
     },
     onClose(){
-
+      this.dialogFormVisible = false
+      this.$emit("closeDrawer")
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
@@ -170,7 +237,7 @@ export default {
   mounted() {
   },
   created() {
-    this.tablecols = this.tool.tabelCol(this.$route.name).addProductTable.tablecols
+
   }
 }
 </script>

+ 4 - 3
src/template/addProduct/table.vue

@@ -1,9 +1,9 @@
 <template>
   <div>
-    <el-table ref="table" :row-class-name="tableClassName" highlight-current-row :data="data"  size="mini" :height="height" @row-click="rowClick" style="width:100%;min-height:300px"  border>
+    <el-table ref="table" @selection-change="selectionChange" :row-class-name="tableClassName" highlight-current-row :data="data"  size="mini" :height="height" @row-click="rowClick" style="width:100%;min-height:300px"  border>
       <el-table-column
           type="selection"
-          width="55" @handleSelectionChange="handleSelectionChange" >
+          width="55"  >
       </el-table-column>
       <el-table-column v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title" :width="width && col.width === 0 ? 150 : col.width" :fixed="fixedName ? fixedName.indexOf(col.columnname)!= -1?'right':false : false">
         <template slot-scope="scope">
@@ -43,12 +43,13 @@ export default {
   },
   methods:{
     rowClick (row) {
+      console.log(row,'勾选')
       this.$emit('rowClick',row)
     },
     tableClassName ({row,rowIndex}) {
       row.index = rowIndex
     },
-    handleSelectionChange(val) {
+    selectionChange(val) {
       this.$emit('checkboxCallBack',val)
     },
     isCheck(row,rowIndex) {

+ 2 - 2
vue.config.js

@@ -15,8 +15,8 @@ module.exports = {
       proxy: {
         '/apis': {
           // target: 'http://61.164.207.46:8000',  // target host*/
-          target: 'http://192.168.3.9:8080',  // target host*/
-          // target: 'https://oms.idcgroup.com.cn:8079/',  // target host
+          /*target: 'http://192.168.3.9:8080',  // target host*!/*/
+          target: 'https://oms.idcgroup.com.cn:8079/',  // target host
           // target: 'localhost:8080',  // target host
           ws: true,  // proxy websockets 
           changeOrigin: true,  // needed for virtual hosted sites