Forráskód Böngészése

调整项目商机,产品设置页面

qymljy 2 éve
szülő
commit
e90230ab2e

+ 12 - 5
src/HDrpManagement/collectionRule/components/add.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <el-button size="mini" type="primary" @click="dialogFormVisible = true">新 建</el-button>
-    <el-dialog title="新建收款条件" append-to-body :visible.sync="dialogFormVisible" width="40%">
+    <el-dialog title="新建收款条件" append-to-body :visible.sync="dialogFormVisible" width="40%" @close="onClose">
       <el-row :gutter="20">
         <el-form :model="form" :rules="rules" ref="form" label-width="110px" label-position="right" size="mini">
           <el-col :span="24">
@@ -15,7 +15,7 @@
           </el-col>
           <el-col :span="24" v-if="form.point == '订单审核'">
             <el-form-item label="立账额度比例" prop="amountrate">
-              <el-input v-model="form.amountrate" placeholder="请输入立账额度比例"></el-input>
+              <el-input v-model="form.amountrate" placeholder="请输入立账额度比例" @change="amountrateChange(form.amountrate)"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="24">
@@ -36,7 +36,7 @@
         </el-form>
       </el-row>
       <div class="dialog-footer">
-        <el-button size="small" @click="dialogFormVisible = false" class="normal-btn-width">取 消</el-button>
+        <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
         <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
       </div>
     </el-dialog>
@@ -48,10 +48,10 @@ export default {
   name: "add",
   data(){
     var NumberSize = (rule, value, callback) => {
-      if (+value >= 0.1 && +value <= 1) {
+      if (+value >= 0 && +value <= 1) {
         callback()
       } else {
-        return callback(new Error('额度比率范围(0.1-1)'));
+        return callback(new Error('额度比率范围(0-1)'));
       }
     }
     return {
@@ -97,6 +97,13 @@ export default {
           this.dialogFormVisible = false
         })
       })
+    },
+    amountrateChange(val){
+      this.form.amountrate = Math.round(val *100)/100
+    },
+    onClose(){
+      this.$refs['form'].resetFields();
+      this.dialogFormVisible = false
     }
   }
 }

+ 2 - 2
src/HDrpManagement/collectionRule/modules/table.vue

@@ -18,7 +18,7 @@
             label="订单审核"
             width="120">
             <template slot-scope="scope">
-              <div v-if="scope.row.point == '订单审核'">√</div>
+              <div v-if="scope.row.point == '订单审核'" style="color: red">是</div>
               <div v-else>--</div>
             </template>
           </el-table-column>
@@ -87,7 +87,7 @@
         label="是否默认条件"
         width="120">
         <template slot-scope="scope">
-          <span v-if="scope.row.isdefault">是</span>
+          <span v-if="scope.row.isdefault" style="color: red">是</span>
           <span v-else>否</span>
         </template>
       </el-table-column>

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

@@ -186,7 +186,8 @@ export default {
       })
 
       this.mainData = res.data
-      console.log(this.mainData);
+      this.mainData.discountrate = Math.round((this.mainData.discountrate * 100) * 100)/100
+      console.log(this.mainData,"项目商机详情");
       
       /* 获取标签数据 */
       /*this.tagObj = await this.$store.dispatch('queryTagList',{table:'sa_project',id:this.mainData.sa_projectid})*/

+ 37 - 11
src/HDrpManagement/projectChange/modules/modules/productSet/add.vue

@@ -104,23 +104,33 @@
             </el-table-column>
             <el-table-column
                 prop="marketprice"
-                label="牌价"
-                width="150">
+                label="牌价(元)"
+                fixed="right"
+                width="80">
             </el-table-column>
             <el-table-column
                 prop="num"
                 fixed="right"
                 label="数量"
-                width="150">
+                width="140">
               <template slot-scope="scope">
                 <el-input-number v-model="scope.row.qty" size="mini" :min="1"  label="描述文字" @change="numChange(scope.row.qty,scope.$index,scope.row)"></el-input-number>
               </template>
             </el-table-column>
+            <el-table-column
+                prop="price"
+                label="单价"
+                fixed="right"
+                width="90">
+              <template slot-scope="scope">
+                <el-input v-model="scope.row.price" size="mini" placeholder="请输入单价" @change="priceChange(scope.row.price,scope.$index,scope.row)"></el-input>
+              </template>
+            </el-table-column>
             <el-table-column
                 prop="totalPrice"
                 fixed="right"
                 label="金额"
-                width="150">
+                width="90">
               <template slot-scope="scope">
                 <span>{{scope.row.totalPrice}}</span>
               </template>
@@ -129,7 +139,7 @@
                 prop="totalPrice"
                 fixed="right"
                 label="操作"
-                width="80">
+                width="60">
               <template slot-scope="scope">
                 <el-button type="text" @click="onSelect(scope.row)">添 加</el-button>
               </template>
@@ -167,6 +177,7 @@ import previewImage from "@/components/previewImage";
 
 export default {
   name: "add",
+  props:["discountrate"],
   components:{uploadFile, previewImage},
   data(){
     return {
@@ -241,6 +252,8 @@ export default {
     onClose(){
       this.dialogFormVisible = false
       this.tableSelectData = []
+      console.log("关闭设置产品")
+
     },
     onShow(){
       this.dialogFormVisible = true
@@ -250,11 +263,12 @@ export default {
     async listData () {
       this.params.content.sa_projectid = this.$route.query.id
       const res = await this.$api.requested(this.params)
-      this.tableData = res.data
-      this.tableData.forEach((item,index)=>{
-        this.tableData[index] = item
-        this.tableData[index].qty = 1
-        this.tableData[index].totalPrice = this.tableData[index].qty * this.tableData[index].marketprice
+
+      this.tableData = res.data.map((item,index)=>{
+        item.qty = 1
+        item.price = Math.round((item.marketprice * (this.discountrate / 100) ) *100)/100
+        item.totalPrice = item.qty * item.price
+        return item
       })
       console.log(this.tableData,"报价表格数据")
       this.total = res.total
@@ -269,7 +283,7 @@ export default {
       }else {
         data.qty = Math.round(val *100)/100
       }
-      data.totalPrice = Math.round((data.qty * data.marketprice) * 100) /100
+      data.totalPrice = Math.round((data.qty * data.price) * 100) /100
       this.$set(this.tableData,index,data)
     /*  data.qty = val.toFixed(2)
       console.log(val,index)
@@ -277,6 +291,18 @@ export default {
       console.log(data.marketprice,val,data.totalPrice)
       this.$set(this.tableData,index,data)  */
     },
+    priceChange(val,index,data){
+      console.log(val,index,data)
+      if (val < 0){
+        data.price = 0
+      }else if (val > data.marketprice){
+        data.price = data.marketprice
+      }else {
+        data.price = Math.round(val * 100)/100
+      }
+      data.totalPrice = Math.round((data.qty * data.price) * 100) /100
+      this.$set(this.tableData,index,data)
+    },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
       this.params.content.pageSize = val

+ 79 - 3
src/HDrpManagement/projectChange/modules/modules/productSet/index.vue

@@ -2,7 +2,7 @@
 <template>
   <div>
     <div style="margin-bottom: 15px">
-      <add v-if="tool.checkAuth($route.name,'productSetManage') && data.disabled" class="inline-16"  @addSuccess="onSuccess"></add>
+      <add v-if="tool.checkAuth($route.name,'productSetManage') && data.disabled" class="inline-16"  @addSuccess="onSuccess" :discountrate="data.discountrate"></add>
       <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"
@@ -13,6 +13,10 @@
           @keyup.enter.native="listData(params.content.pageNumber= 1)"
           @clear="listData(params.content.pageNumber= 1)"
           clearable></el-input>&nbsp;
+      <div style="float: right">
+        <label class="search__label">预计折扣(%):</label>
+        <el-input style="width: 100px;" v-model="data.discountrate" size="small"   label="默认折扣"  :disabled="!tool.checkAuth($route.name,'productSetManage') || !data.disabled" @change="discountrateChange(data.discountrate)"></el-input>
+      </div>
     </div>
     <div class="produtMag-panel">
       <el-table
@@ -119,6 +123,7 @@
         <el-table-column
             prop="marketprice"
             label="牌价(元)"
+            fixed="right"
             width="100">
           <template slot-scope="scope">
             <p><span>{{scope.row.marketprice?scope.row.marketprice:'--'}}</span></p>
@@ -133,6 +138,15 @@
             <el-input-number v-model="scope.row.qty" size="mini" :min="1"  label="描述文字" @change="numChange(scope.row.qty,scope.$index,scope.row)" :disabled="!data.disabled"></el-input-number>
           </template>
         </el-table-column>
+        <el-table-column
+            prop="price"
+            label="单价(元)"
+            fixed="right"
+            width="100">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.price" size="mini"    @change="priceChange(scope.row.price,scope.$index,scope.row)" :disabled="!data.disabled"></el-input>
+          </template>
+        </el-table-column>
         <el-table-column
             prop="amount"
             label="总金额(元)"
@@ -212,6 +226,9 @@ export default {
     },*/
 
     async listData(){
+      console.log(this.data,"data的数据")
+      console.log(this.data.discountrate)
+      /*this.data.discountrate = Math.round(this.data.discountrate * 100) / 100*/
       this.totalPrice = 0
       this.params.content.sa_projectid = this.data.sa_projectid
       const res = await this.$api.requested(this.params)
@@ -219,6 +236,7 @@ export default {
       res.data.forEach((e,index)=>{
         this.totalPrice = this.totalPrice + e.amount
       })
+      console.log(this.data.discountrate)
       this.total = res.total
     },
     handleSizeChange(val) {
@@ -282,10 +300,23 @@ export default {
     /*修改商品数量*/
     numChange(val,index,data){
       data.qty = val.toFixed(2)
-      data.amount = (data.marketprice * data.qty).toFixed(2)
+      data.amount = (data.price * data.qty).toFixed(2)
       this.$set(this.list,index,data)
       this.onChangQty(data,data.qty)
     },
+    /*修改单价*/
+    priceChange(val,index,data){
+      if (val > data.marketprice){
+        data.price = data.marketprice
+      }else if(val < 0) {
+        data.price = 0
+      }else {
+        data.price = Math.round(val * 100)/100
+      }
+      data.amount = Math.round((data.price * data.qty)*100)/100
+      this.$set(this.list,index,data)
+      this.onChangePrice(data,data.price)
+    },
     async onChangQty(data,val){
       const res = await this.$api.requested({
         "id": 20221021145502,
@@ -296,17 +327,62 @@ export default {
               "sa_project_itemsid":data.sa_project_itemsid,
               "itemid": data.itemid,
               "qty": val,
-              "remarks": ""
+              "remarks": "",
+              "marketprice": data.marketprice, //市场价
+              "price": data.price //单价
+            }
+          ]
+        }
+      })
+      this.listData()
+      this.$emit("productSetSuccess")
+    },
+    async onChangePrice(data,val){
+      const res = await this.$api.requested({
+        "id": 20221021145502,
+        "content": {
+          "sa_projectid": this.data.sa_projectid,
+          "items": [
+            {
+              "sa_project_itemsid":data.sa_project_itemsid,
+              "itemid": data.itemid,
+              "qty": data.qty,
+              "remarks": "",
+              "marketprice": data.marketprice, //市场价
+              "price": val //单价
             }
           ]
         }
       })
       this.listData()
+      this.$emit("productSetSuccess")
+    },
+    /*修改预计折扣*/
+    async discountrateChange(val){
+      if (val > 100){
+        this.data.discountrate = 100
+      }else if(val < 1){
+        this.data.discountrate = 1
+      }else {
+        this.data.discountrate = Math.round(val * 100)/100
+      }
+      console.log(this.data,"修改预计折扣")
+      this.data.discountrate = this.data.discountrate / 100
+      const res = await this.$api.requested({
+        "id": 20221020144202,
+        "content": this.data
+      })
+      this.tool.showMessage(res,()=>{
+        this.listData()
+        this.data.discountrate = Math.round((this.data.discountrate * 100) * 100) / 100
+        this.$emit("productSetSuccess")
+      })
     }
   },
   created() {
     /*this.getProductList()*/
     this.tablecols = this.tool.tabelCol(this.$route.name).projectSetTable.tablecols
+   /* this.data.discountrate = Math.round((this.data.discountrate * 100) * 100) / 100*/
   },
   mounted () {
     this.listData()

+ 1 - 1
src/HManagement/clueManage/m_activity/index.vue

@@ -63,7 +63,7 @@
           <span style="color:#cccccc" v-else-if="scope.data.column.data[[scope.data.column.columnname]] == '结束'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
           <span style="color: rgb(82, 196, 26)" v-else-if="scope.data.column.data[[scope.data.column.columnname]] == '发布'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
         </div>
-        <div v-else-if="scope.data.column.columnname == 'director'">
+        <div v-else-if="scope.data.column.columnname == 'leader'">
           <span >{{scope.data.column.data.leader.length !== 0?scope.data.column.data.leader[0].name:'--'}}</span>
         </div>
         <div v-else-if="scope.data.column.columnname == 'allocationstatus'">

+ 2 - 2
src/HManagement/clueManage/m_activity/modules/add.vue

@@ -24,8 +24,8 @@
               </el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="负责人" prop="director">
-            <el-input v-model="form.director" placeholder="请输入负责人"></el-input>
+          <el-form-item label="活动负责人" prop="director">
+            <el-input v-model="form.director" placeholder="请输入活动负责人"></el-input>
           </el-form-item>
           <el-form-item label="地址" prop="address">
             <el-input v-model="form.address" placeholder="请输入地址"></el-input>

+ 8 - 4
src/HManagement/clueManage/m_activity/modules/details.vue

@@ -93,8 +93,8 @@ export default {
           value:this.mainData.type
         },
         {
-          label:'负责人',
-          value:this.mainData.leader[0].name
+          label:'活动负责人',
+          value:this.mainData.director
         },
         {
           label:'线索数',
@@ -130,8 +130,8 @@ export default {
           value:this.mainData.type
         },
         {
-          label:'负责人',
-          value:this.mainData.leader[0].name
+          label:'活动负责人',
+          value:this.mainData.director
         },
         {
           label:'线索数',
@@ -167,6 +167,10 @@ export default {
               return style
             }
           },
+          {
+            label:'负责人',
+            value:this.mainData.leader[0].name
+          },
 
         ],
         systemInfo: [

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

@@ -106,7 +106,7 @@
             </el-table-column>
             <el-table-column
                 prop="marketprice"
-                label="牌价"
+                label="牌价(元)"
                 fixed="right"
                 width="100">
               <template slot-scope="scope">

+ 2 - 2
src/SDrpManagement/QuotedPrice/components/edit/productTableProject.vue

@@ -106,11 +106,11 @@
             </el-table-column>
             <el-table-column
                 prop="marketprice"
-                label="牌价"
+                label="牌价(元)"
                 fixed="right"
                 width="100">
               <template slot-scope="scope">
-                  <span >{{scope.row.marketprice?scope.row.marketprice+',':'--'}}</span>
+                  <span >{{scope.row.marketprice?scope.row.marketprice:'--'}}</span>
               </template>
             </el-table-column>
             <el-table-column

+ 1 - 1
src/SDrpManagement/QuotedPrice/components/edit/quotedPriceProduct.vue

@@ -122,7 +122,7 @@
         </el-table-column>
         <el-table-column
             prop="marketprice"
-            label="牌价"
+            label="牌价(元)"
             width="100">
           <template slot-scope="scope">
             <p><span>{{scope.row.marketprice?scope.row.marketprice:'--'}}</span></p>

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

@@ -106,7 +106,7 @@
             </el-table-column>
             <el-table-column
                 prop="marketprice"
-                label="牌价"
+                label="牌价(元)"
                 fixed="right"
                 width="100">
               <template slot-scope="scope">

+ 5 - 3
src/SDrpManagement/QuotedPrice/components/productTableProject.vue

@@ -29,7 +29,8 @@
               @selection-change="selectionChange">
             <el-table-column
                 type="selection"
-                width="55">
+                width="42"
+                fixed>
             </el-table-column>
             <el-table-column
                 align="center"
@@ -105,10 +106,11 @@
             </el-table-column>
             <el-table-column
                 prop="marketprice"
-                label="牌价"
+                label="牌价(元)"
+                fixed="right"
                 width="100">
               <template slot-scope="scope">
-                  <span >{{scope.row.marketprice?scope.row.marketprice+',':'--'}}</span>
+                  <span >{{scope.row.marketprice?scope.row.marketprice:'--'}}</span>
               </template>
             </el-table-column>
             <el-table-column

+ 2 - 2
src/SDrpManagement/QuotedPrice/components/quotedPriceProduct.vue

@@ -33,7 +33,7 @@
         <el-table-column
             align="center"
             label="产品图"
-            width="100">
+            width="80">
           <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>
@@ -122,7 +122,7 @@
         </el-table-column>
         <el-table-column
             prop="marketprice"
-            label="牌价"
+            label="牌价(元)"
             width="100">
           <template slot-scope="scope">
             <p><span>{{scope.row.marketprice?scope.row.marketprice:'--'}}</span></p>