Browse Source

报价单调整

qymljy 2 years ago
parent
commit
f0b0ebb1b3

+ 2 - 2
src/Form/QuotedPrice/edit.vue

@@ -231,11 +231,11 @@
                 <el-input  v-model="form.contactsphonenumber" autocomplete="off" placeholder="手机号" disabled></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="6">
+<!--            <el-col :span="6">
               <el-form-item label="总金额:" label-width="90px" >
                 <el-input  v-model="form.totalPrice" autocomplete="off" placeholder="总金额" disabled></el-input>
               </el-form-item>
-            </el-col>
+            </el-col>-->
           </el-form>
         </el-row>
       </div>

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

@@ -143,7 +143,7 @@ export default {
         enterprisename:'',
         type:'',
         source:'',
-        parentid:'',
+        parentid:0,
         superiorenterprisename:'',
         abbreviation:'',
         taxno:'',

+ 49 - 0
src/SDrpManagement/QuotedPrice/components/delProduct.vue

@@ -0,0 +1,49 @@
+<template>
+  <div>
+    <el-button type="primary" size="small" @click="dialogVisible = true">删 除</el-button>
+    <el-dialog
+        title="提示"
+        :visible.sync="dialogVisible"
+        append-to-body
+        width="20%"
+        >
+      <span>确定删除这些商品嘛</span>
+      <span slot="footer" class="dialog-footer">
+    <el-button size="mini" @click="dialogVisible = false">取 消</el-button>
+    <el-button size="mini" type="primary" @click="delProduct">确 定</el-button>
+  </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "delProduct",
+  props:['data'],
+  data(){
+    return {
+      dialogVisible:false
+    }
+  },
+  methods:{
+    async delProduct(){
+      console.log(this.data)
+      const res = await this.$api.requested({
+        "id": 20221021095603,
+        "version":1,
+        "content": {
+          "sa_quotedprice_itemsids":this.data     //sat_notice_classid<=0时 为新增
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.dialogVisible = false
+        this.$emit('delSuccess')
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 1
src/SDrpManagement/QuotedPrice/components/productTable.vue

@@ -286,6 +286,6 @@ export default {
 
 <style scoped>
 .image {
-  width:40px;height:40px;margin:0px auto;
+  width:38px;height:38px;margin:0px auto;
 }
 </style>

+ 53 - 25
src/SDrpManagement/QuotedPrice/components/quotedPriceProduct.vue

@@ -11,7 +11,10 @@
           @clear="productData(param.content.pageNumber = 1)"
           clearable>
       </el-input>
-      <productTable style="float: right" :id="id" @checkForm="checkForm" ref="quoterPrice" @productAdd="productInitialization"></productTable>
+
+<!--      <importExcel style="float: right" @onSuccess="onSuccess"></importExcel>-->
+      <productTable style="float: right;margin-right: 10px" :id="id" @checkForm="checkForm" ref="quoterPrice" @productAdd="productInitialization"></productTable>
+      <delProduct style="float: right;margin-right: 10px" :data="selectDel" @delSuccess="delSuccess"></delProduct>
     </div>
     <div class="produtMag-panel">
       <el-table
@@ -111,7 +114,7 @@
             label="数量"
             width="180">
           <template slot-scope="scope">
-            <el-input-number  v-model="scope.row.qty" size="mini" :min="1" :step="scope.row.orderaddqty" label="描述文字" @change="onChangeNum(scope.row.qty,scope.row,scope.$index)"></el-input-number>
+            <el-input-number  v-model="scope.row.qty" size="mini" :min="1" :step="scope.row.orderaddqty?scope.row.orderaddqty:1" label="描述文字" @change="onChangeNum(scope.row.qty,scope.row,scope.$index)"></el-input-number>
           </template>
         </el-table-column>
         <el-table-column
@@ -154,26 +157,31 @@
             <i class="el-icon-check" v-if="scope.row.specialoffer === 1"  style="color: red;font-size: 20px"></i>
           </template>
         </el-table-column>
-        <el-table-column
+<!--        <el-table-column
             prop="operation"
             label="操作"
             width="100">
           <template slot-scope="scope">
             <el-button size="mini" type="text" @click="deleteProduct(scope.row)">删除</el-button>
           </template>
-        </el-table-column>
+        </el-table-column>-->
       </el-table>
-      <div style="margin-top:16px;text-align:right">
-        <el-pagination
-            background
-            small
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            :current-page="currentPage"
-            :page-size="param.content.pageSize"
-            layout="total, prev, pager, next, jumper"
-            :total="total">
-        </el-pagination>
+      <div style="height: 35px;margin-top: 20px">
+        <div style="float: left">总金额:{{ totalPrice }}元</div>
+        <div style="float: right">
+          <el-pagination
+              background
+              small
+              style="text-align: right;"
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              :page-size="param.content.pageSize"
+              layout="total, prev, pager, next, jumper"
+              :total="total">
+          </el-pagination>
+        </div>
+
       </div>
     </div>
   </div>
@@ -184,13 +192,16 @@ import uploadFile from "@/components/upload/hw_obs_upload";
 import previewImage from "@/components/previewImage";
 import productTable from '../components/productTable'
 import importExcel from '../modules/importQuotedPrice'
+import delProduct from "@/SDrpManagement/QuotedPrice/components/delProduct";
 
 export default {
   props:["id"],
   name: "quotedPriceProduct",
-  components:{uploadFile, previewImage,productTable,importExcel},
+  components:{uploadFile, previewImage,productTable,importExcel,delProduct},
   data(){
     return {
+      selectDel:[],
+      totalPrice:0,
       step:1,
       tablecols:[],
       list:[],
@@ -220,22 +231,27 @@ export default {
       const res = await this.$api.requested(this.param)
       this.list = res.data
       this.total = res.total
-      let totalPrice = 0
+      this.totalPrice = 0
+
       for (var i=0 ;i<this.list.length;i++){
         this.list[i].discountrate = this.list[i].discountrate * 100
-        totalPrice = totalPrice + this.list[i].qty * this.list[i].price
+        this.totalPrice = this.totalPrice + this.list[i].qty * this.list[i].price
       }
       this.$emit("queryTotalPrice",totalPrice)
       console.log(this.list,totalPrice,'产品配置信息')
     },
     /*产品配置信息*/
     async productData(id){
+      console.log(id,"配置信息")
+      this.sa_quotedpriceid = id
       this.param.content.sa_quotedpriceid = 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<this.list.length;i++){
         this.list[i].discountrate = this.list[i].discountrate * 100
+        this.totalPrice = this.totalPrice + this.list[i].qty * this.list[i].price
       }
       console.log(this.list,'产品配置信息')
     },
@@ -245,8 +261,10 @@ export default {
       const res = await this.$api.requested(this.param)
       this.list = res.data
       this.total = res.total
+      this.totalPrice = 0
       for (var i=0 ;i<this.list.length;i++){
         this.list[i].discountrate = this.list[i].discountrate * 100
+        this.totalPrice = this.totalPrice + this.list[i].qty * this.list[i].price
       }
       console.log(this.list,'产品配置信息')
     },
@@ -260,6 +278,10 @@ export default {
       this.param.content.pageNumber = val
       this.productData()
     },
+    /*批量删除*/
+    delSuccess(){
+      this.productInitialization(this.sa_quotedpriceid)
+    },
     onSuccess(){
       this.productData()
     },
@@ -272,7 +294,13 @@ export default {
       this.param.content.where.condition = this.search
       this.productData()
     },
-    selectionChange(){},
+    selectionChange(val){
+      console.log(val,'选择')
+      for (let i=0;i<val.length;i++){
+        this.selectDel[i] = val[i].sa_quotedprice_itemsid
+      }
+      console.log(this.selectDel)
+    },
     checkForm(){
       this.$emit('checkForm')
     },
@@ -300,8 +328,8 @@ export default {
           data.qty = val
         }
       }*/
-      /*this.$set(this.list,index,data)*/
-      /*this.$nextTick(()=>{
+      this.$set(this.list,index,data)
+      this.$nextTick(()=>{
         let obj = this.list.map(e=>{
           return {
             sa_quotedprice_itemsid:e.sa_quotedprice_itemsid,
@@ -313,7 +341,7 @@ export default {
           }
         })
         this.changeData(obj)
-      })*/
+      })
     },
     onChangeDiscountrate(val,data,index) {
      /* data.price = data.marketprice * (data.discountrate / 100)
@@ -399,15 +427,15 @@ export default {
 
 <style scoped>
 .produtMag-panel{
-   margin-top: 35px;
+   margin-top: 0px;
   background: #fff;
   border-radius:5px;
 
-  border:1px solid rgb(0 0 0 / 5%)
+  border:1px solid rgb(0 0 0 / 1%)
   /* box-shadow: 0 5px 5px rgb(0 0 0 / 10%);
   transform: translate3d(0,-2px,0); */
 }
 .image {
-  width:80px;height:80px;margin:0px auto;
+  width:38px;height:38px;margin:0px auto;
 }
 </style>

+ 3 - 0
src/SDrpManagement/QuotedPrice/detail/index.vue

@@ -66,6 +66,7 @@ export default {
         }
       })
       this.mainData = res.data
+      this.productList()
       this.changeDataStructure()
      /* this.$refs.detailed.detailedList(this.mainData)*/
       this.flag = true
@@ -77,6 +78,7 @@ export default {
       this.queryMainData(id)
     },
     changeDataStructure(){
+
       this.mainAreaData = [
         {
           label:'客户名称',
@@ -126,6 +128,7 @@ export default {
         }
       })
       console.log(res,"计算产品明细合计信息")
+      this.totalPrice = 0
       res.data.forEach((item)=> {
         console.log(item,"类别数据")
         this.totalPrice = this.totalPrice + item.price * item.qty

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

@@ -22,10 +22,10 @@
           :cell-style="{height:'50px',color:'#666666',fontWeight:'400'}"
           @selection-change="selectionChange"
          >
-        <el-table-column
+<!--        <el-table-column
             type="selection"
             width="55">
-        </el-table-column>
+        </el-table-column>-->
         <el-table-column
             align="center"
             label="产品图"
@@ -417,6 +417,6 @@ export default {
   transform: translate3d(0,-2px,0); */
 }
 .image {
-  width:80px;height:80px;margin:0px auto;
+  width:40px;height:40px;margin:0px auto;
 }
 </style>

+ 1 - 1
src/SDrpManagement/QuotedPrice/detail/modules/productInventory/productTable.vue

@@ -281,6 +281,6 @@ export default {
 
 <style scoped>
 .image {
-  width:40px;height:40px;margin:0px auto;
+  width:38px;height:38px;margin:0px auto;
 }
 </style>

+ 2 - 2
src/SDrpManagement/QuotedPrice/modules/ProjectQuotationAdd.vue

@@ -224,11 +224,11 @@
                 <el-input  v-model="form.phonenumber" autocomplete="off" placeholder="手机号" disabled></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="6">
+<!--            <el-col :span="6">
               <el-form-item label="总金额:" label-width="90px" >
                 <el-input  v-model="form.totalPrice" autocomplete="off" placeholder="总金额" disabled></el-input>
               </el-form-item>
-            </el-col>
+            </el-col>-->
           </el-form>
         </el-row>
       </div>