Browse Source

项目报价

qymljy 2 years ago
parent
commit
31c45bb862

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

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-button size="mini"  :type="btnType?btnType:'text'"  @click="onShow" >编 辑</el-button>
+    <el-button size="mini" :disabled="data.status !== '新建'"  :type="btnType?btnType:'text'"  @click="onShow" >编 辑</el-button>
     <el-drawer
         title="创建报价单"
         :visible.sync="drawer"
@@ -187,7 +187,7 @@ export default {
           "content": this.form
         })
         console.log(res,"报价单id一")
-        this.$refs.quoterPrice.quoterPrice(res.data.sa_quotedpriceid,this.form.type)
+        this.$refs.quoterPrice.quoterPrice(res.data.sa_quotedpriceid,res.data.quotedpricetype)
       })
     },
     getSubmit(){

+ 13 - 4
src/SDrpManagement/QuotedPrice/components/productTable.vue

@@ -192,10 +192,13 @@ export default {
     },
     /*获取产品信息*/
     queryProduct(id,type){
+      console.log(id,type)
       this.dialogProductVisible = true
       this.params.content.sa_projectid = this.id
       console.log(id,"报价单id五")
+
       this.type = type
+      console.log(this.type)
       this.productData(id)
     },
     /*产品配置信息*/
@@ -207,9 +210,13 @@ export default {
       this.list = res.data
       this.total = res.total
       console.log(res,'产品配置信息')
+      console.log(this.type)
       this.$nextTick(()=>{
-        for (let i=0;i<this.list.length;i++){
-          this.$refs.multipleTable.toggleRowSelection(this.list[i],true)
+        console.log(this.type)
+        if (this.type === '项目报价'){
+          for (let i=0;i<this.list.length;i++){
+            this.$refs.multipleTable.toggleRowSelection(this.list[i],true)
+          }
         }
       })
 
@@ -246,8 +253,9 @@ export default {
             sa_quotedprice_itemsid:'0',
             itemid:e.itemid,
             oldprice:0,
+            /*price:(e.marketprice * 100)/100,*/
             price:e.price,
-            discountrate:50,
+            discountrate:100,
             qty:e.qty
           }
         })
@@ -259,8 +267,9 @@ export default {
             sa_quotedprice_itemsid:'0',
             itemid:e.itemid,
             oldprice:0,
+            /*price:(e.marketprice * 100)/100,*/
             price:e.price,
-            discountrate:50,
+            discountrate:100,
             qty:1
           }
         })

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

@@ -151,7 +151,7 @@
           label="是否特价"
           width="100">
           <template slot-scope="scope">
-            <p><span>{{scope.row.specialoffer?scope.row.specialoffer:'--'}}</span></p>
+            <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
@@ -246,6 +246,8 @@ export default {
       this.$emit('checkForm')
     },
     quoterPrice(id,type){
+      console.log(id,"报价单id")
+      console.log(type,"项目报价")
       this.$refs.quoterPrice.queryProduct(id,type)
     },
     onChangeNum (val,data,index) {

+ 9 - 4
src/SDrpManagement/QuotedPrice/detail/index.vue

@@ -7,6 +7,7 @@
         :editData="mainData"
         :mainAreaData="mainAreaData"
         turnPageId="20221020165103"
+        delApiId="20221020165503"
         idname="sa_quotedpriceid"
         ownertable="sa_quotedprice"
         :tags="[]"
@@ -19,8 +20,8 @@
       </div>
       <div slot="customOperation">
         <!-- 此区域提供了自定义操作按钮 -->
-        <submit_to class="inline-16" :sa_quotedpriceid="mainData.sa_quotedpriceid" @onSubmit="onSuccess"></submit_to>
-        <examine_to class="inline-16" :sa_quotedpriceid="mainData.sa_quotedpriceid" @onExamine="onSuccess"></examine_to>
+        <submit_to class="inline-16" v-if="tool.checkAuth($route.name,'submit') && mainData.status === '新建'" :sa_quotedpriceid="mainData.sa_quotedpriceid" @onSubmit="onSuccess"></submit_to>
+        <examine_to class="inline-16" v-if="tool.checkAuth($route.name,'toExamine') && mainData.status === '提交'" :sa_quotedpriceid="mainData.sa_quotedpriceid" @onExamine="onSuccess"></examine_to>
       </div>
       <div slot="slot0" class="container normal-panel">
         <detailed :data="mainData"  v-if="flag"></detailed>
@@ -28,6 +29,9 @@
       <div slot="slot1" class="container normal-panel">
         <project_change :data="mainData" v-if="flag"></project_change>
       </div>
+      <div slot="slot2" class="container normal-panel">
+        <customer_assocalated :data="mainData" v-if="flag"></customer_assocalated>
+      </div>
       <div slot="slot3" class="container normal-panel">
         <contacts  :data="mainData"  v-if="flag"></contacts>
       </div>
@@ -45,6 +49,7 @@ import address_manage from './modules/addressManage/list'
 import submit_to from './components/submitTo'
 import examine_to from './components/examineTo'
 import project_change from './modules/projectChange/index'
+import customer_assocalated from './modules/customerAssociated/index'
 export default {
   name: "index",
   data(){
@@ -55,7 +60,7 @@ export default {
     }
   },
   components:{
-    detailed,contacts,address_manage,submit_to,examine_to,project_change
+    detailed,contacts,address_manage,submit_to,examine_to,project_change,customer_assocalated
   },
   methods:{
     async queryMainData(id){
@@ -97,7 +102,7 @@ export default {
         },
         {
           label:'有效期',
-          value:this.mainData.invaliddate
+          value:this.mainData.begdate?this.mainData.begdate + '至' + this.mainData.enddate:"--"
         },
         {
           label:'负责人',

+ 4 - 4
src/SDrpManagement/QuotedPrice/detail/modules/contacts/list.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <add class="normal-margin" :data="data"  @insertSuccess="onSuccess" style="float: left;"></add>
+<!--    <add class="normal-margin" :data="data"  @insertSuccess="onSuccess" style="float: left;"></add>
     <div style="width: 20%;float: left;margin-left: 2%">
       <el-input
           placeholder="请输入内容"
@@ -11,14 +11,14 @@
           @keyup.enter.native="queryClick()">
         <i slot="prefix" class="el-icon-search" @click="queryClick()"></i>
       </el-input>
-    </div>
+    </div>-->
     <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true"  :height="tableHieght" >
       <template v-slot:customcol="scope">
         <p>{{scope.column.data[scope.column.columnname]}}</p>
       </template>
       <template v-slot:opreation="scope">
-        <edit v-if="tool.checkAuth($route.name,'update')" :data="scope.data" @updateSuccess="onSuccess"></edit>
-        <toVoid v-if="tool.checkAuth($route.name,'toVoid')" :data="scope.data" @toVoidSuccess="onSuccess"></toVoid>
+<!--        <edit v-if="tool.checkAuth($route.name,'update')" :data="scope.data" @updateSuccess="onSuccess"></edit>
+        <toVoid v-if="tool.checkAuth($route.name,'toVoid')" :data="scope.data" @toVoidSuccess="onSuccess"></toVoid>-->
       </template>
     </tableLayout>
     <div style="margin-top:16px;text-align:right">

+ 50 - 0
src/SDrpManagement/QuotedPrice/detail/modules/customerAssociated/index.vue

@@ -0,0 +1,50 @@
+<template>
+  <div>
+    <tableLayout  :layout="tablecols" :data="list" :custom="true" height="200">
+      <template v-slot:customcol="scope">
+        <p>{{scope.column.data[scope.column.columnname]}}</p>
+      </template>
+    </tableLayout>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "index",
+  props:["data"],
+  data() {
+    return {
+      tablecols:'',
+      list:[],
+    }
+  },
+  mounted() {
+    if (this.data.quotedpricetype === '项目报价') {
+      this.list[0] = this.data
+      console.log(this.list)
+    }else {
+      this.list[0] = this.data
+    }
+  },
+  methods:{
+    /*async listData(id){
+      const res = await this.$api.requested({
+        "id": 20221012164302,
+        "content": {
+          "sa_customersid": id
+        },
+      })
+      console.log(res)
+      this.list[0] = res.data
+      console.log(this.list)
+    }*/
+  },
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).customerTable.tablecols
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 1
src/SDrpManagement/QuotedPrice/detail/modules/detailed/index.vue

@@ -7,7 +7,7 @@
         <el-descriptions-item label="项目编号">{{ basic.projectnum?basic.projectnum:"--" }}</el-descriptions-item>
         <el-descriptions-item label="项目名称">{{ basic.projectname?basic.projectname:"--"}}</el-descriptions-item>
         <el-descriptions-item label="项目地址">{{ basic.address?basic.address:"--" }}</el-descriptions-item>
-        <el-descriptions-item label="有效期">{{ basic.invaliddate?basic.invaliddate:"--" }}</el-descriptions-item>
+        <el-descriptions-item label="有效期">{{ basic.begdate?basic.begdate + '至' + basic.enddate:"--" }}</el-descriptions-item>
         <el-descriptions-item label="负责人">{{ basic.contactsname?basic.contactsname:"--" }}</el-descriptions-item>
         <el-descriptions-item label="备注">{{ basic.remarks?basic.remarks:"--" }}</el-descriptions-item>
         <el-descriptions-item label="状态">{{ basic.status?basic.status:"--" }}</el-descriptions-item>

+ 20 - 0
src/SDrpManagement/QuotedPrice/index.vue

@@ -75,6 +75,12 @@
         <div v-else-if="scope.data.column.columnname === 'invaliddate'">
           <p>{{scope.data.column.data.begdate?scope.data.column.data.begdate+ '到' + scope.data.column.data.enddate:'--'}}</p>
         </div>
+        <div v-else-if="scope.data.column.columnname === 'salesman'">
+          {{issaler?'--':scope.data.column.data.createby}}
+        </div>
+        <div v-else-if="scope.data.column.columnname === 'distributor'">
+          {{issaler?scope.data.column.data.createby:'--'}}
+        </div>
         <div v-else>
           {{scope.data.column.data[[scope.data.column.columnname]]}}
         </div>
@@ -93,6 +99,7 @@ export default {
   name: "index",
   data(){
     return {
+      issaler:false,
       options:[],
       tabName:"1",
       tabIndex:"1",
@@ -152,7 +159,20 @@ export default {
       this.$refs.quotedPriceList.param.content.type = this.tabIndex
       this.$refs.quotedPriceList.param.content.where = this.selectParam
       this.$refs.quotedPriceList.listData()
+    },
+    async isSaler(){
+      const res = await this.$api.requested({
+        classname: "common.usercenter.usercenter",
+        content: {},
+        method: "queryUserMsg"
+      })
+      console.log(res,"是否营销")
+      this.issaler = res.data.hr.issaler
+      console.log(this.issaler)
     }
+  },
+  mounted() {
+    this.isSaler()
   }
 }
 </script>

+ 0 - 1
src/SDrpManagement/QuotedPrice/modules/ProjectQuotationAdd.vue

@@ -168,7 +168,6 @@ export default {
           "version":1,
           "content": this.form
         })
-        console.log(res.data,"报价单id一")
         this.$refs.quoterPrice.quoterPrice(res.data.sa_quotedpriceid,this.form.type)
         this.form.sa_quotedpriceid = res.data.sa_quotedpriceid
       })