Browse Source

代码更新

qymljy 2 years ago
parent
commit
338b0f3e73
26 changed files with 2956 additions and 164 deletions
  1. 700 0
      src/Form/QuotedPrice/edit copy1.vue
  2. 45 19
      src/Form/QuotedPrice/edit.vue
  3. 673 0
      src/Form/QuotedPrice/editCopy copy1.vue
  4. 15 15
      src/Form/QuotedPrice/editCopy.vue
  5. 1 1
      src/Form/cashcoupon/add.vue
  6. 1 1
      src/Form/cashcoupon/edit.vue
  7. 73 26
      src/Form/projectChange/add.vue
  8. 86 22
      src/Form/projectChange/edit.vue
  9. 1 1
      src/HDrpManagement/ProductGroupMag/index.vue
  10. 1 1
      src/HDrpManagement/ProductMag/modules/priceLevelSetting.vue
  11. 4 2
      src/HDrpManagement/contractManage/components/addContract.vue
  12. 54 1
      src/HDrpManagement/projectChange/index.vue
  13. 2 0
      src/HDrpManagement/projectChange/modules/detail.vue
  14. 4 4
      src/HDrpManagement/projectChange/modules/modules/productSet/Select.vue
  15. 1 1
      src/HDrpManagement/projectChange/modules/modules/productSet/add.vue
  16. 15 0
      src/SDrpManagement/QuotedPrice/components/edit/itemClassAdd.vue
  17. 316 0
      src/SDrpManagement/QuotedPrice/components/edit/quotedPriceItemClass.vue
  18. 22 14
      src/SDrpManagement/QuotedPrice/components/productTable.vue
  19. 377 0
      src/SDrpManagement/QuotedPrice/components/productTableCopy.vue
  20. 25 15
      src/SDrpManagement/QuotedPrice/components/productTableProject.vue
  21. 377 0
      src/SDrpManagement/QuotedPrice/components/productTableProjectCopy.vue
  22. 3 3
      src/SDrpManagement/QuotedPrice/detail/components/copyTo.vue
  23. 1 1
      src/SDrpManagement/QuotedPrice/detail/index.vue
  24. 119 17
      src/SDrpManagement/QuotedPrice/detail/modules/productInventory/index.vue
  25. 37 20
      src/SDrpManagement/QuotedPrice/modules/ProjectQuotationAdd.vue
  26. 3 0
      src/template/selectSaler/index.vue

+ 700 - 0
src/Form/QuotedPrice/edit copy1.vue

@@ -0,0 +1,700 @@
+<template>
+  <div>
+<!--    <el-button size="mini" :disabled="data.status !== '新建'"  :type="btnType?btnType:'text'"  @click="onShow" >编 辑</el-button>-->
+    <el-button size="mini" :disabled="data.status !== '新建' || !data.disabled"  :type="data.status !== '新建' || !data.disabled ?'':'primary'"  @click="onShow" >编 辑</el-button>
+    <el-drawer
+        title="编辑报价单"
+        :visible.sync="drawer"
+        size="92%"
+        direction="rtl"
+        :show-close="false"
+        append-to-body
+        @close="onClose">
+      <div class="drawer__panel" style="margin-bottom: 0px">
+        <el-row style="margin-top: 10px" :gutter="10">
+          <el-form :model="form" :rules="rules" ref="form"  size="mini" label-position="right">
+            <el-col :span="8">
+              <el-form-item label="报价类型:" label-width="100px" >
+                <el-input v-model="form.quotedpricetype" autocomplete="off" placeholder="报价类型" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col  :span="8">
+              <el-form-item label="是否特价:" label-width="100px" >
+                <el-input  v-model="form.specialoffer === 0?'否':'是'" autocomplete="off" placeholder="是否特价" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col  :span="8" v-if="isQuotedPrice">
+              <el-form-item label="项目名称:" label-width="100px" prop="projectname">
+                <el-popover
+                    placement="bottom"
+                    width="700"
+                    trigger="click"
+                    v-model="projectShow"
+                    @show="projectList">
+                  <el-input
+                      style="width:300px;margin-bottom: 10px"
+                      placeholder="请输入内容"
+                      v-model="projectParam.content.where.condition"
+                      clearable
+                      @clear="projectList(projectParam.content.pageNumber = 1)"
+                      size="mini"
+                      @keyup.enter.native="projectList(projectParam.content.pageNumber = 1)">
+                    <i slot="prefix" class="el-icon-search" @click="projectList(projectParam.content.pageNumber = 1)"></i>
+                  </el-input>
+                  <el-table :data="project.projectData" @row-click="projectOpen" height="396px" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
+                    <el-table-column
+                        label="项目编号"
+                        width="180">
+                      <template slot-scope="scope">
+                        <span style="margin-left: 10px">{{ scope.row.projectnum?scope.row.projectnum:'--' }}</span>
+                      </template>
+                    </el-table-column>
+                    <el-table-column
+                        label="项目名称"
+                        width="180">
+                      <template slot-scope="scope">
+                        <span style="margin-left: 10px">{{ scope.row.projectname?scope.row.projectname:'--' }}</span>
+                      </template>
+                    </el-table-column>
+                    <el-table-column
+                        label="地址"
+                        >
+                      <template slot-scope="scope">
+                        <span style="margin-left: 10px">{{ scope.row.address?scope.row.address:'--' }}</span>
+                      </template>
+                    </el-table-column>
+                  </el-table>
+                  <div class="container normal-panel" style="text-align:right">
+                    <el-pagination
+                        background
+                        small
+                        @size-change="handleSizeChangeProject"
+                        @current-change="handleCurrentChangeProject"
+                        :page-sizes="[10,20,50,100,]"
+                        layout="total,sizes, prev, pager, next, jumper"
+                        :current-page="project.currentPage"
+                        :total="project.total">
+                    </el-pagination>
+                  </div>
+                  <el-input slot="reference"  :readonly="true" v-model="form.projectname" autocomplete="off" placeholder="请选择项目"  @input="selectProject"></el-input>
+                </el-popover>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8" v-if="isQuotedPrice">
+              <el-form-item label="项目编号:" label-width="100px" >
+                <el-input  v-model="form.projectnum" autocomplete="off" placeholder="项目编号" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="客户名称:" label-width="100px" prop="enterprisename">
+                <el-popover
+                    placement="bottom"
+                    width="700"
+                    trigger="click"
+                    v-model="customerShow"
+                    @show="customerList">
+                  <el-input
+                      style="width:300px;margin-bottom: 10px"
+                      placeholder="请输入内容"
+                      v-model="customerParam.content.where.condition"
+                      clearable
+                      @clear="customerList(customerParam.content.pageNumber = 1)"
+                      size="mini"
+                      @keyup.enter.native="customerList(customerParam.content.pageNumber = 1)">
+                    <i slot="prefix" class="el-icon-search" @click="customerList(customerParam.content.pageNumber = 1)"></i>
+                  </el-input>
+                  <el-table :data="customer.customerData" @row-click="customerData" height="396px" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
+                    <el-table-column
+                        label="客户编号"
+                        width="180">
+                      <template slot-scope="scope">
+                        <span style="margin-left: 10px">{{ scope.row.sa_customersid?scope.row.sa_customersid:'--' }}</span>
+                      </template>
+                    </el-table-column>
+                    <el-table-column
+                        label="客户名称"
+                        width="200">
+                      <template slot-scope="scope">
+                        <span style="margin-left: 10px">{{ scope.row.enterprisename?scope.row.enterprisename:'--'}}</span>
+                      </template>
+                    </el-table-column>
+                    <el-table-column
+                        label="地址"
+                        >
+                      <template slot-scope="scope">
+                        <span style="margin-left: 10px">{{ scope.row.address?scope.row.address:'--' }}</span>
+                      </template>
+                    </el-table-column>
+                  </el-table>
+                  <div class="container normal-panel" style="text-align:right">
+                    <el-pagination
+                        background
+                        small
+                        @size-change="handleSizeChangeCustomer"
+                        @current-change="handleCurrentChangeCustomer"
+                        :page-sizes="[10,20,50,100]"
+                        layout="total,sizes, prev, pager, next, jumper"
+                        :current-page="customer.currentPage"
+                        :total="customer.total">
+                    </el-pagination>
+                  </div>
+                  <el-input slot="reference"  :readonly="true"  v-model="form.enterprisename" autocomplete="off" placeholder="请选择客户"  @input="selectCustomer"></el-input>
+                </el-popover>
+              </el-form-item>
+            </el-col>
+            <el-col  :span="8">
+              <el-form-item label="电话:" label-width="100px" >
+                <el-input  v-model="form.telephone" autocomplete="off" placeholder="输入电话" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="联系人:" label-width="100px" prop="name">
+                <el-popover
+                    placement="bottom"
+                    width="700"
+                    trigger="click"
+                    v-model="contactsShow"
+                    @show="contactsList">
+                  <el-input
+                      style="width:300px;margin-bottom: 10px"
+                      placeholder="请输入内容"
+                      v-model="contactsParam.content.where.condition"
+                      clearable
+                      @clear="contactsList(contactsParam.content.pageNumber = 1)"
+                      size="mini"
+                      @keyup.enter.native="contactsList(contactsParam.content.pageNumber = 1)">
+                    <i slot="prefix" class="el-icon-search" @click="contactsList(contactsParam.content.pageNumber = 1)"></i>
+                  </el-input>
+                  <el-table :data="contacts.contactsData" @row-click="contactsData" height="396px" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
+                    <el-table-column
+                        label="姓名"
+                        width="180">
+                      <template slot-scope="scope">
+                        <span style="margin-left: 10px">{{ scope.row.name?scope.row.name:'--' }}</span>
+                      </template>
+                    </el-table-column>
+                    <el-table-column
+                        label="手机号"
+                        width="180">
+                      <template slot-scope="scope">
+                        <span style="margin-left: 10px">{{ scope.row.phonenumber?scope.row.phonenumber:'--' }}</span>
+                      </template>
+                    </el-table-column>
+                    <el-table-column
+                        label="邮箱"
+                        width="180">
+                      <template slot-scope="scope">
+                        <span style="margin-left: 10px">{{ scope.row.email?scope.row.email:'--' }}</span>
+                      </template>
+                    </el-table-column>
+                    <el-table-column
+                        label="地址"
+                    >
+                      <template slot-scope="scope">
+                        <span style="margin-left: 10px">{{ scope.row.address?scope.row.address:'--' }}</span>
+                      </template>
+                    </el-table-column>
+                  </el-table>
+                  <div class="container normal-panel" style="text-align:right">
+                    <el-pagination
+                        background
+                        small
+                        @size-change="handleSizeChangeContacts"
+                        @current-change="handleCurrentChangeContacts"
+                        :page-sizes="[10,20,50,100,]"
+                        layout="total,sizes, prev, pager, next, jumper"
+                        :current-page="contacts.currentPage"
+                        :total="contacts.total">
+                    </el-pagination>
+                  </div>
+                  <el-input slot="reference"  :readonly="true" v-model="form.contactsname" autocomplete="off" placeholder="请选择联系人"  @input="selectContacts"></el-input>
+                </el-popover>
+              </el-form-item>
+            </el-col>
+            <el-col  :span="8">
+              <el-form-item label="联系人手机号:" label-width="100px" >
+                <el-input  v-model="form.contactsphonenumber" autocomplete="off" placeholder="手机号" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col  :span="8">
+              <el-form-item label="报价日期:" label-width="100px">
+                <el-date-picker
+                    v-model="form.billdate"
+                    style="width: 100%"
+                    type="date"
+                    value-format="yyyy-MM-dd"
+                    placeholder="选择日期"
+                    :picker-options="pickerOptions">
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="有效期:" label-width="100px" prop="date">
+                <el-date-picker
+                    v-model="form.date"
+                    style="width: 100%"
+                    type="daterange"
+                    value-format="yyyy-MM-dd"
+                    range-separator="至"
+                    start-placeholder="开始日期"
+                    end-placeholder="结束日期"
+                    :picker-options="pickerOptions">
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col  :span="8" >
+              <el-form-item label="产品系列:" label-width="100px" prop="itemtype">
+                <el-select
+                    ref="sle"
+                    style="width:100%;"
+                    v-model="form.itemtype"
+                    multiple
+                    placeholder="请选择产品系列"
+                    size="mini"
+                >
+                  <el-option
+                      v-for="item in itemtype"
+                      :key="item.index"
+                      :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-form-item>
+            </el-col>
+            <el-col  :span="8">
+              <el-form-item label="备注:" label-width="100px" prop="remarks">
+                <el-input  v-model="form.remarks" autocomplete="off" placeholder="请输入备注信息" type="textarea" autosize></el-input>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div >
+        <el-divider></el-divider>
+      </div>
+      <div style="margin:20px 20px 20px 20px">
+        <el-tabs type="border-card">
+          <el-tab-pane label="产品明细折扣">
+            <quotedPriceProduct :sa_quotedpriceid="form.sa_quotedpriceid" :sa_projectid="form.sa_projectid" :quotedpricetype="form.quotedpricetype" ref="quoterPrice" @checkForm="onSubmit" @productData="productDataChange"></quotedPriceProduct>
+          </el-tab-pane>
+          <el-tab-pane label="产品类别折扣">
+            <quotedPriceItemClass :sa_quotedpriceid="form.sa_quotedpriceid" :sa_projectid="form.sa_projectid" :quotedpricetype="form.quotedpricetype" ref="quoterPrice" @checkForm="onSubmit" @productData="productDataChange"></quotedPriceItemClass>
+          </el-tab-pane>
+        </el-tabs>
+
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
+        <el-button size="small" type="warning" @click="getSubmit" class="normal-btn-width">保 存</el-button>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import quotedPriceProduct from '@/SDrpManagement/QuotedPrice/components/edit/quotedPriceProduct'
+import quotedPriceItemClass from "@/SDrpManagement/QuotedPrice/components/edit/quotedPriceItemClass";
+export default {
+  name: "edit",
+  props:['data','btnType'],
+  components:{quotedPriceProduct,quotedPriceItemClass},
+  data(){
+    return {
+      projectShow:false,
+      customerShow:false,
+      contactsShow:false,
+      disabled:false,
+      userInfo:JSON.parse(window.sessionStorage.getItem('userInfo')),
+      primary:'primary',
+      text:'',
+      projectParam:{
+        "id": 20221020143502,
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 10,
+          "type":1, //  1:我负责的;2:我参与的;3:我下属负责的;4:我下属参与的
+          "where": {
+            "condition": "",
+            "startdate": "",
+            "enddate": "",
+            "status":"",//跟进中、已成交、已失败
+            "projecttype":"",
+            "stagename":"",
+            "tag":""
+          }
+        },
+      },
+      project:{
+        projectData:[],
+        total:0,
+        currentPage:0,
+      },
+      customerParam:{
+        "id": 20220920083901,
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 10,
+          "where": {
+            "condition": "",
+            "type":4,
+            "sa_projectid":""
+          }
+        }
+      },
+      customer:{
+        customerData:[],
+        total:0,
+        currentPage:0,
+      },
+      contactsParam:{
+        "id": "20221022165503",
+        "content": {
+          "sys_enterpriseid":"",
+          "where": {
+            "condition": "",
+            "workaddress": 0//0表示人,1表示地址
+          }
+        }
+      },
+      contacts:{
+        contactsData:[],
+        total:0,
+        currentPage:0,
+      },
+      pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() + 3600 * 1000 * 24 < Date.now() ;
+        },
+      },
+      drawer:false,
+      isQuotedPrice:false,
+      date:[],
+      clearData:[],
+      form:{
+        quotedpricetype:'',
+        totalPrice:0,
+        type:'',
+        projectnum:'',
+        enterprisename:'',
+        name:'',
+        phonenumber:'',
+        fax:'',
+        telephone:'',
+        specialOffer:'否',
+        sa_quotedpriceid:0,     //sat_notice_classid<=0时 为新增
+        sys_enterpriseid: "",
+        contactsid:8,
+        sa_projectid: "0",
+        discountrate: 0,
+        remarks: "",
+        invaliddate: "",
+        projectname: "",
+        address: "",
+        billdate:"",
+        enddate:'',
+        begdate:'',
+        date:[],
+        itemtype:[],
+        quotedpricenotes: [
+          "1、报价为含税13%税率, 含运费 ",
+          "2、报价有限期 2023-02-02 13:16:47至2023-02-22 13:16:47",
+        ]
+      },
+      rules:{
+        projectname:[
+          { required: true, message: '请选择项目', trigger: 'change'},
+        ],
+        enterprisename:[
+          { required: true, message: '请选择客户', trigger: 'change'},
+        ],
+        itemtype:[
+          { required: true, message: '请选择产品系列', trigger: 'change'},
+        ],
+        date:[
+          { required: true, message: '请选择有效期', trigger: 'change'},
+        ],
+       /* name:[
+          { required: true, message: '请选择联系人', trigger: 'change'},
+        ]*/
+      },
+      itemtype:[]
+    }
+  },
+  watch:{
+    mainData(val) {
+      if (this.data.leader.length !== 0){
+        if (JSON.parse(window.sessionStorage.getItem('userInfo')).userid === this.data.leader[0].userid){
+          this.disabled = false
+        }else {
+          this.disabled = true
+        }
+      }
+      console.log("权限结果",this.disabled)
+    }
+  },
+  methods:{
+    onShow(){
+      this.drawer = true
+      this.form = Object.assign({},this.form,this.data)
+      this.form.date[0] = this.form.begdate
+      this.form.date[1] = this.form.enddate
+      if (this.form.quotedpricetype === '项目报价'){
+        this.isQuotedPrice = true
+      }else {
+        this.isQuotedPrice = false
+      }
+    },
+    onClose(){
+      this.drawer = false
+      this.$emit('onSuccess')
+    },
+    onSubmit(){
+     if (this.form.data.length !== 0){
+       this.form.begdate = this.form.date[0]
+       this.form.enddate = this.form.date[1]
+       this.form.quotedpricenotes[1] = "2、报价有限期" + this.form.begdate + "至" + this.form.enddate
+     }else {
+       this.form.begdate = ''
+       this.form.enddate = ''
+     }
+      this.$refs.form.validate(async (valid) => {
+        if (!valid) return false
+        const res = await this.$api.requested({
+          "id": 20221020164803,
+          "content": this.form
+        })
+      })
+    },
+    getSubmit(){
+      if (this.form.date.length === 0){
+        this.form.begdate = ''
+        this.form.enddate = ''
+      }else {
+        this.form.begdate = this.form.date[0]
+        this.form.enddate = this.form.date[1]
+        this.form.quotedpricenotes[1] = "2、报价有限期" + this.form.begdate + "至" + this.form.enddate
+      }
+      this.$refs.form.validate(async (valid) => {
+        if (!valid) return false
+        const res = await this.$api.requested({
+          "id": 20221020164803,
+          "version":1,
+          "content": this.form
+        })
+        this.tool.showMessage(res,() => {
+          this.drawer = false
+          this.changeData(this.productObj)
+
+        })
+      })
+    },
+    /*修改后的产品数据*/
+    productDataChange(val){
+      let obj = val.map(e=>{
+        return {
+          sa_quotedprice_itemsid:e.sa_quotedprice_itemsid,
+          itemid:e.itemid,
+          oldprice:e.marketprice,
+          price:e.price,
+          discountrate:(e.discountrate/100).toFixed(4),
+          qty:e.qty
+        }
+      })
+      this.productObj = obj
+    },
+    async changeData(obj){
+      const res = await this.$api.requested({
+        "id": 20221021095403,
+        "content": {
+          "sa_quotedpriceid":this.form.sa_quotedpriceid,     //sat_notice_classid<=0时 为新增
+          "items":obj
+        }
+      })
+      this.$emit('onSuccess')
+    },
+    /*刷新总金额*/
+    queryTotalPrice(val){
+      this.form.totalPrice = val
+    },
+    /*可选项目*/
+    async projectList(){
+      const res = await this.$api.requested(this.projectParam)
+      this.project.projectData = res.data
+      this.project.total = res.total
+      this.project.currentPage = res.pageNumber
+    },
+    async selectProject(){
+      this.projectShow = true
+      this.projectParam.content.where.condition = this.form.projectname
+      this.projectList()
+    },
+    /*可选客户*/
+    async customerList(){
+      if (this.form.quotedpricetype === '客户报价'){
+        this.customerParam.content.where.sa_projectid = 0
+        this.customerParam.content.where.type = 2
+      }else {
+        this.customerParam.content.where.type = 4
+        this.customerParam.content.where.sa_projectid = this.form.sa_projectid
+      }
+      const res = await this.$api.requested(this.customerParam)
+      this.customer.customerData = res.data
+      this.customer.total = res.total
+      this.customer.currentPage = res.pageNumber
+    },
+    selectCustomer(){
+      this.customerParam.content.where.condition = this.form.enterprisename
+      this.customerList()
+    },
+    /*可选联系人*/
+    async contactsList(){
+      this.contactsParam.content.sys_enterpriseid = this.form.sys_enterpriseid
+      const res = await this.$api.requested(this.contactsParam)
+      this.contacts.contactsData = res.data
+      this.contacts.total = res.total
+      this.contacts.currentPage = res.pageNumber
+    },
+    selectContacts(){
+      this.contactsShow = true
+      this.contactsParam.content.where.condition = this.form.name
+      this.contactsList()
+    },
+    /*项目选择信息*/
+    projectData(val){
+      this.form.sa_projectid = val.sa_projectid
+      this.form.projectname = val.projectname
+      this.form.projectnum = val.projectnum
+      this.form.sys_enterpriseid = ''
+      this.form.enterprisename = ''
+      this.form.contactsid = 0
+      this.form.contactsname = ''
+      this.form.contactsphonenumber = ''
+      this.form.fax = ''
+      this.form.telephone = ''
+      this.projectShow = false
+    },
+    /*更改项目前提示*/
+    projectOpen(val) {
+      this.$confirm('修改项目后将清空产品配置, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.productList()
+        this.projectData(val)
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });
+      });
+    },
+    /*获取产品明细*/
+    async productList(){
+      const res = await this.$api.requested({
+        "id": 20221021095503,
+        "content": {
+          "sa_quotedpriceid":this.form.sa_quotedpriceid     //sat_notice_classid<=0时 为新增
+        }
+      })
+      console.log(res,"产品明细")
+      this.clearData = []
+      res.data.forEach((item,index)=>{
+        console.log(item)
+        this.clearData[index] = item.sa_quotedprice_itemsid
+      })
+      console.log(this.clearData,"需要删除的产品明细")
+      this.productClear()
+    },
+    /*清空产品明细*/
+    async productClear(){
+      const res = await this.$api.requested({
+        "id": 20221021095603,
+        "content": {
+          "sa_quotedprice_itemsids":this.clearData     //sat_notice_classid<=0时 为新增
+        }
+      })
+      this.$refs.quoterPrice.productData()
+    },
+    /*客户选择信息*/
+    customerData(val){
+      this.form.sys_enterpriseid = val.sys_enterpriseid
+      this.form.enterprisename = val.enterprisename
+      this.form.contactsid = 0
+      this.form.contactsname = ''
+      this.form.contactsphonenumber = ''
+      this.form.fax = ''
+      this.form.telephone = ''
+      this.customerShow = false
+    },
+    /*联系人选择信息*/
+    contactsData(val){
+      this.form.contactsid = val.contactsid
+      this.form.contactsname = val.name
+      this.form.contactsphonenumber = val.phonenumber
+      this.form.fax = val.fax
+      this.form.telephone = val.telephone
+      this.contactsShow = false
+    },
+    /*项目翻页*/
+    handleSizeChangeProject(val) {
+      // console.log(`每页 ${val} 条`);
+      this.projectParam.content.pageSize = val
+      this.projectList()
+    },
+    handleCurrentChangeProject(val) {
+      // console.log(`当前页: ${val}`);
+      this.projectParam.content.pageNumber = val
+      this.projectList()
+    },
+    /*客户翻页*/
+    handleSizeChangeCustomer(val) {
+      // console.log(`每页 ${val} 条`);
+      this.projectParam.content.pageSize = val
+      this.customerList()
+    },
+    handleCurrentChangeCustomer(val) {
+      // console.log(`当前页: ${val}`);
+      this.projectParam.content.pageNumber = val
+      this.customerList()
+    },
+    /*联系人翻页*/
+    handleSizeChangeContacts(val) {
+      // console.log(`每页 ${val} 条`);
+      this.projectParam.content.pageSize = val
+      this.contactsList()
+    },
+    handleCurrentChangeContacts(val) {
+      // console.log(`当前页: ${val}`);
+      this.projectParam.content.pageNumber = val
+      this.contactsList()
+    },
+    /*查询产品系列*/
+    queryItemType(){
+      this.$store.dispatch('optiontypeselect','itemtype').then(res => {
+        this.itemtype = res.data
+      })
+    }
+  },
+  mounted() {
+    this.queryItemType()
+  },
+  created() {
+  }
+}
+</script>
+
+<style scoped>
+>>> .el-divider--horizontal {
+  height: 1px;
+  width: 100%;
+  margin: 0px;
+}
+/deep/.el-input__prefix {
+  display: flex;
+  align-items: center;
+}
+</style>

+ 45 - 19
src/Form/QuotedPrice/edit.vue

@@ -5,7 +5,7 @@
     <el-drawer
         title="编辑报价单"
         :visible.sync="drawer"
-        size="92%"
+        size="600px"
         direction="rtl"
         :show-close="false"
         append-to-body
@@ -13,17 +13,17 @@
       <div class="drawer__panel" style="margin-bottom: 0px">
         <el-row style="margin-top: 10px" :gutter="10">
           <el-form :model="form" :rules="rules" ref="form"  size="mini" label-position="right">
-            <el-col :span="8">
+            <el-col :span="24">
               <el-form-item label="报价类型:" label-width="100px" >
                 <el-input v-model="form.quotedpricetype" autocomplete="off" placeholder="报价类型" disabled></el-input>
               </el-form-item>
             </el-col>
-            <el-col  :span="8">
+<!--            <el-col  :span="24">
               <el-form-item label="是否特价:" label-width="100px" >
                 <el-input  v-model="form.specialoffer === 0?'否':'是'" autocomplete="off" placeholder="是否特价" disabled></el-input>
               </el-form-item>
-            </el-col>
-            <el-col  :span="8" v-if="isQuotedPrice">
+            </el-col>-->
+            <el-col  :span="24" v-if="isQuotedPrice">
               <el-form-item label="项目名称:" label-width="100px" prop="projectname">
                 <el-popover
                     placement="bottom"
@@ -80,12 +80,12 @@
                 </el-popover>
               </el-form-item>
             </el-col>
-            <el-col :span="8" v-if="isQuotedPrice">
+            <el-col :span="24" v-if="isQuotedPrice">
               <el-form-item label="项目编号:" label-width="100px" >
                 <el-input  v-model="form.projectnum" autocomplete="off" placeholder="项目编号" disabled></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+            <el-col :span="24">
               <el-form-item label="客户名称:" label-width="100px" prop="enterprisename">
                 <el-popover
                     placement="bottom"
@@ -142,12 +142,12 @@
                 </el-popover>
               </el-form-item>
             </el-col>
-            <el-col  :span="8">
+            <el-col  :span="24">
               <el-form-item label="电话:" label-width="100px" >
                 <el-input  v-model="form.telephone" autocomplete="off" placeholder="输入电话" disabled></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+            <el-col :span="24">
               <el-form-item label="联系人:" label-width="100px" prop="name">
                 <el-popover
                     placement="bottom"
@@ -211,12 +211,12 @@
                 </el-popover>
               </el-form-item>
             </el-col>
-            <el-col  :span="8">
+            <el-col  :span="24">
               <el-form-item label="联系人手机号:" label-width="100px" >
                 <el-input  v-model="form.contactsphonenumber" autocomplete="off" placeholder="手机号" disabled></el-input>
               </el-form-item>
             </el-col>
-            <el-col  :span="8">
+            <el-col  :span="24">
               <el-form-item label="报价日期:" label-width="100px">
                 <el-date-picker
                     v-model="form.billdate"
@@ -228,7 +228,7 @@
                 </el-date-picker>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+            <el-col :span="24">
               <el-form-item label="有效期:" label-width="100px" prop="date">
                 <el-date-picker
                     v-model="form.date"
@@ -242,7 +242,7 @@
                 </el-date-picker>
               </el-form-item>
             </el-col>
-            <el-col  :span="8" >
+            <el-col  :span="24" >
               <el-form-item label="产品系列:" label-width="100px" prop="itemtype">
                 <el-select
                     ref="sle"
@@ -264,7 +264,12 @@
                 </el-select>
               </el-form-item>
             </el-col>
-            <el-col  :span="8">
+            <el-col  :span="24">
+              <el-form-item label="折扣:" label-width="100px" prop="discountrate">
+                <el-input  v-model="form.discountrate" autocomplete="off" placeholder="请输入折扣" type="textarea" autosize></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col  :span="24">
               <el-form-item label="备注:" label-width="100px" prop="remarks">
                 <el-input  v-model="form.remarks" autocomplete="off" placeholder="请输入备注信息" type="textarea" autosize></el-input>
               </el-form-item>
@@ -272,12 +277,20 @@
           </el-form>
         </el-row>
       </div>
-      <div >
+<!--      <div >
         <el-divider></el-divider>
       </div>
       <div style="margin:20px 20px 20px 20px">
-        <quotedPriceProduct :sa_quotedpriceid="form.sa_quotedpriceid" :sa_projectid="form.sa_projectid" :quotedpricetype="form.quotedpricetype" ref="quoterPrice" @checkForm="onSubmit" @productData="productDataChange"></quotedPriceProduct>
-      </div>
+        <el-tabs type="border-card">
+          <el-tab-pane label="产品明细折扣">
+            <quotedPriceProduct :sa_quotedpriceid="form.sa_quotedpriceid" :sa_projectid="form.sa_projectid" :quotedpricetype="form.quotedpricetype" ref="quoterPrice" @checkForm="onSubmit" @productData="productDataChange"></quotedPriceProduct>
+          </el-tab-pane>
+          <el-tab-pane label="产品类别折扣">
+            <quotedPriceItemClass :sa_quotedpriceid="form.sa_quotedpriceid" :sa_projectid="form.sa_projectid" :quotedpricetype="form.quotedpricetype" ref="quoterPrice" @checkForm="onSubmit" @productData="productDataChange"></quotedPriceItemClass>
+          </el-tab-pane>
+        </el-tabs>
+
+      </div>-->
       <div class="fixed__btn__panel">
         <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
         <el-button size="small" type="warning" @click="getSubmit" class="normal-btn-width">保 存</el-button>
@@ -288,11 +301,19 @@
 
 <script>
 import quotedPriceProduct from '@/SDrpManagement/QuotedPrice/components/edit/quotedPriceProduct'
+import quotedPriceItemClass from "@/SDrpManagement/QuotedPrice/components/edit/quotedPriceItemClass";
 export default {
   name: "edit",
   props:['data','btnType'],
-  components:{quotedPriceProduct},
+  components:{quotedPriceProduct,quotedPriceItemClass},
   data(){
+    var discountrate = (rule,value,callback) =>{
+      if (this.form.discountrate < 0 || this.form.discountrate > 100){
+        callback(new Error('请输入0-100%'))
+      } else {
+        callback();
+      }
+    }
     return {
       projectShow:false,
       customerShow:false,
@@ -379,7 +400,7 @@ export default {
         sys_enterpriseid: "",
         contactsid:8,
         sa_projectid: "0",
-        discountrate: 0,
+        discountrate: '',
         remarks: "",
         invaliddate: "",
         projectname: "",
@@ -407,6 +428,9 @@ export default {
         date:[
           { required: true, message: '请选择有效期', trigger: 'change'},
         ],
+        discountrate:[
+          { required: false, validator: discountrate, trigger: 'change'},
+        ],
        /* name:[
           { required: true, message: '请选择联系人', trigger: 'change'},
         ]*/
@@ -432,6 +456,7 @@ export default {
       this.form = Object.assign({},this.form,this.data)
       this.form.date[0] = this.form.begdate
       this.form.date[1] = this.form.enddate
+      this.form.discountrate = Math.round((this.form.discountrate * 100)*100)/100
       if (this.form.quotedpricetype === '项目报价'){
         this.isQuotedPrice = true
       }else {
@@ -470,6 +495,7 @@ export default {
       }
       this.$refs.form.validate(async (valid) => {
         if (!valid) return false
+        this.form.discountrate = this.form.discountrate / 100
         const res = await this.$api.requested({
           "id": 20221020164803,
           "version":1,

+ 673 - 0
src/Form/QuotedPrice/editCopy copy1.vue

@@ -0,0 +1,673 @@
+<template>
+  <div class="normal-panel">
+    <p class="normal-title container">编辑报价单</p>
+<!--    <el-button size="mini" :disabled="data.status !== '新建'"  :type="btnType?btnType:'text'"  @click="onShow" >编 辑</el-button>-->
+<!--    <el-button size="mini" :disabled="data.status !== '新建'"  :type="data.status === '新建'?primary:text"  @click="onShow" >编 辑</el-button>-->
+    <div class="drawer__panel" style="margin-bottom: 0px">
+      <el-row style="margin-top: 10px">
+        <el-form :model="form" :rules="rules" ref="form"  size="mini" label-position="right">
+          <el-col :span="8">
+            <el-form-item label="报价类型:" label-width="100px" >
+              <el-input v-model="form.quotedpricetype" autocomplete="off" placeholder="报价类型" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col  :span="8">
+            <el-form-item label="是否特价:" label-width="100px" >
+              <el-input  v-model="form.specialoffer === 0?'否':'是'" autocomplete="off" placeholder="是否特价" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col  :span="8" v-if="isQuotedPrice">
+            <el-form-item label="项目名称:" label-width="100px" prop="projectname">
+              <el-popover
+                  placement="bottom"
+                  width="700"
+                  trigger="click"
+                  v-model="projectShow"
+                  @show="projectList">
+                <el-input
+                    style="width:300px;margin-bottom: 10px"
+                    placeholder="请输入内容"
+                    v-model="projectParam.content.where.condition"
+                    clearable
+                    @clear="projectList(projectParam.content.pageNumber = 1)"
+                    size="mini"
+                    @keyup.enter.native="projectList(projectParam.content.pageNumber = 1)">
+                  <i slot="prefix" class="el-icon-search" @click="projectList(projectParam.content.pageNumber = 1)"></i>
+                </el-input>
+                <el-table :data="project.projectData" @row-click="projectOpen" height="396px" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
+                  <el-table-column
+                      label="项目编号"
+                      width="180">
+                    <template slot-scope="scope">
+                      <span style="margin-left: 10px">{{ scope.row.projectnum?scope.row.projectnum:'--' }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                      label="项目名称"
+                      width="180">
+                    <template slot-scope="scope">
+                      <span style="margin-left: 10px">{{ scope.row.projectname?scope.row.projectname:'--' }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                      label="地址"
+                      >
+                    <template slot-scope="scope">
+                      <span style="margin-left: 10px">{{ scope.row.address?scope.row.address:'--' }}</span>
+                    </template>
+                  </el-table-column>
+                </el-table>
+                <div class="container normal-panel" style="text-align:right">
+                  <el-pagination
+                      background
+                      small
+                      @size-change="handleSizeChangeProject"
+                      @current-change="handleCurrentChangeProject"
+                      :page-sizes="[10,20,50,100,]"
+                      layout="total,sizes, prev, pager, next, jumper"
+                      :current-page="project.currentPage"
+                      :total="project.total">
+                  </el-pagination>
+                </div>
+                <el-input slot="reference"  :readonly="true" v-model="form.projectname" autocomplete="off" placeholder="请选择项目"  @input="selectProject"></el-input>
+              </el-popover>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8" v-if="isQuotedPrice">
+            <el-form-item label="项目编号:" label-width="100px" >
+              <el-input  v-model="form.projectnum" autocomplete="off" placeholder="项目编号" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="客户名称:" label-width="100px" prop="enterprisename">
+              <el-popover
+                  placement="bottom"
+                  width="700"
+                  trigger="click"
+                  v-model="customerShow"
+                  @show="customerList">
+                <el-input
+                    style="width:300px;margin-bottom: 10px"
+                    placeholder="请输入内容"
+                    v-model="customerParam.content.where.condition"
+                    clearable
+                    @clear="customerList(customerParam.content.pageNumber = 1)"
+                    size="mini"
+                    @keyup.enter.native="customerList(customerParam.content.pageNumber = 1)">
+                  <i slot="prefix" class="el-icon-search" @click="customerList(customerParam.content.pageNumber = 1)"></i>
+                </el-input>
+                <el-table :data="customer.customerData" @row-click="customerData" height="396px" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
+                  <el-table-column
+                      label="客户编号"
+                      width="180">
+                    <template slot-scope="scope">
+                      <span style="margin-left: 10px">{{ scope.row.sa_customersid?scope.row.sa_customersid:'--' }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                      label="客户名称"
+                      width="200">
+                    <template slot-scope="scope">
+                      <span style="margin-left: 10px">{{ scope.row.enterprisename?scope.row.enterprisename:'--'}}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                      label="地址"
+                      >
+                    <template slot-scope="scope">
+                      <span style="margin-left: 10px">{{ scope.row.address?scope.row.address:'--' }}</span>
+                    </template>
+                  </el-table-column>
+                </el-table>
+                <div class="container normal-panel" style="text-align:right">
+                  <el-pagination
+                      background
+                      small
+                      @size-change="handleSizeChangeCustomer"
+                      @current-change="handleCurrentChangeCustomer"
+                      :page-sizes="[10,20,50,100,]"
+                      layout="total,sizes, prev, pager, next, jumper"
+                      :current-page="customer.currentPage"
+                      :total="customer.total">
+                  </el-pagination>
+                </div>
+                <el-input slot="reference"  :readonly="true" v-model="form.enterprisename" autocomplete="off" placeholder="请选择客户"  @input="selectCustomer"></el-input>
+              </el-popover>
+            </el-form-item>
+          </el-col>
+          <el-col  :span="8">
+            <el-form-item label="电话:" label-width="100px" >
+              <el-input  v-model="form.telephone" autocomplete="off" placeholder="输入电话" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="联系人:" label-width="100px" prop="contactsname">
+              <el-popover
+                  placement="bottom"
+                  width="700"
+                  trigger="click"
+                  v-model="contactsShow"
+                  @show="contactsList">
+                <el-input
+                    style="width:300px;margin-bottom: 10px"
+                    placeholder="请输入内容"
+                    v-model="contactsParam.content.where.condition"
+                    clearable
+                    @clear="contactsList(contactsParam.content.pageNumber = 1)"
+                    size="mini"
+                    @keyup.enter.native="contactsList(contactsParam.content.pageNumber = 1)">
+                  <i slot="prefix" class="el-icon-search" @click="contactsList(contactsParam.content.pageNumber = 1)"></i>
+                </el-input>
+                <el-table :data="contacts.contactsData" @row-click="contactsData" height="396px" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
+                  <el-table-column
+                      label="姓名"
+                      width="180">
+                    <template slot-scope="scope">
+                      <span style="margin-left: 10px">{{ scope.row.name?scope.row.name:'--' }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                      label="手机号"
+                      width="180">
+                    <template slot-scope="scope">
+                      <span style="margin-left: 10px">{{ scope.row.phonenumber?scope.row.phonenumber:'--' }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                      label="邮箱"
+                      width="180">
+                    <template slot-scope="scope">
+                      <span style="margin-left: 10px">{{ scope.row.email?scope.row.email:'--' }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                      label="地址"
+                  >
+                    <template slot-scope="scope">
+                      <span style="margin-left: 10px">{{ scope.row.address?scope.row.address:'--' }}</span>
+                    </template>
+                  </el-table-column>
+                </el-table>
+                <div class="container normal-panel" style="text-align:right">
+                  <el-pagination
+                      background
+                      small
+                      @size-change="handleSizeChangeContacts"
+                      @current-change="handleCurrentChangeContacts"
+                      :page-sizes="[10,20,50,100,]"
+                      layout="total,sizes, prev, pager, next, jumper"
+                      :current-page="contacts.currentPage"
+                      :total="contacts.total">
+                  </el-pagination>
+                </div>
+                <el-input slot="reference"  :readonly="true" v-model="form.contactsname" autocomplete="off" placeholder="请选择联系人"  @input="selectContacts"></el-input>
+              </el-popover>
+            </el-form-item>
+          </el-col>
+          <el-col  :span="8">
+            <el-form-item label="联系人手机号:" label-width="100px" >
+              <el-input  v-model="form.contactsphonenumber" autocomplete="off" placeholder="手机号" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col  :span="8">
+            <el-form-item label="报价日期:" label-width="90px">
+              <el-date-picker
+                  v-model="form.billdate"
+                  style="width: 100%"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  placeholder="选择日期"
+                  :picker-options="pickerOptions">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="有效期:" label-width="100px" prop="date">
+              <el-date-picker
+                  v-model="form.data"
+                  style="width: 100%"
+                  type="daterange"
+                  value-format="yyyy-MM-dd"
+                  range-separator="至"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                  :picker-options="pickerOptions">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col  :span="8" >
+            <el-form-item label="产品系列:" label-width="100px" prop="itemtype">
+              <el-select
+                  ref="sle"
+                  style="width:100%;"
+                  v-model="form.itemtype"
+                  multiple
+                  placeholder="请选择产品系列"
+                  size="mini"
+              >
+                <el-option
+                    v-for="item in itemtype"
+                    :key="item.index"
+                    :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-form-item>
+          </el-col>
+          <el-col  :span="8">
+            <el-form-item label="备注:" label-width="100px" prop="remarks">
+              <el-input  v-model="form.remarks" autocomplete="off" placeholder="请输入备注信息" type="textarea" autosize></el-input>
+            </el-form-item>
+          </el-col>
+        </el-form>
+      </el-row>
+    </div>
+    <div >
+      <el-divider></el-divider>
+    </div>
+    <div style="margin:20px 20px 20px 20px">
+      <quotedPriceProduct :sa_quotedpriceid="form.sa_quotedpriceid" :sa_projectid="form.sa_projectid" :quotedpricetype="form.quotedpricetype" ref="quoterPrice" @checkForm="onSubmit" @productData="productDataChange"></quotedPriceProduct>
+    </div>
+    <div class="fixed__btn__panel">
+      <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
+      <el-button size="small" type="warning" @click="getSubmit" class="normal-btn-width">保 存</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import quotedPriceProduct from '@/SDrpManagement/QuotedPrice/components/edit/quotedPriceProduct'
+export default {
+  name: "edit",
+  props:['btnType'],
+  components:{quotedPriceProduct},
+  data(){
+    return {
+      projectShow:false,
+      customerShow:false,
+      contactsShow:false,
+      data:'',
+      primary:'primary',
+      text:'',
+      projectParam:{
+        "id": 20221020143502,
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 10,
+          "type":0, //  1:我负责的;2:我参与的;3:我下属负责的;4:我下属参与的
+          "where": {
+            "condition": "",
+            "startdate": "",
+            "enddate": "",
+            "status":"",//跟进中、已成交、已失败
+            "projecttype":"",
+            "stagename":"",
+            "tag":""
+          }
+        },
+      },
+      project:{
+        projectData:[],
+        total:0,
+        currentPage:0,
+      },
+      customerParam:{
+        "id": 20220920083901,
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 10,
+          "where": {
+            "condition": "",
+            "type":4,
+            "sa_projectid":""
+          }
+        }
+      },
+      customer:{
+        customerData:[],
+        total:0,
+        currentPage:0,
+      },
+      contactsParam:{
+        "id": "20221022165503",
+        "version": 1,
+        "content": {
+          "sys_enterpriseid":"",
+          "where": {
+            "condition": "",
+            "workaddress": 0//0表示人,1表示地址
+          }
+        }
+      },
+      contacts:{
+        contactsData:[],
+        total:0,
+        currentPage:0,
+      },
+      pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() + 3600 * 1000 * 24 < Date.now() ;
+        },
+      },
+      drawer:true,
+      isQuotedPrice:false,
+      date:[],
+      clearData:[],
+      form:{
+        quotedpricetype:'',
+        totalPrice:0,
+        type:'',
+        projectnum:'',
+        enterprisename:'',
+        name:'',
+        phonenumber:'',
+        fax:'',
+        telephone:'',
+        specialOffer:'否',
+        sa_quotedpriceid:0,     //sat_notice_classid<=0时 为新增
+        sys_enterpriseid: "",
+        contactsid:8,
+        sa_projectid: "0",
+        discountrate: 0,
+        remarks: "",
+        invaliddate: "",
+        projectname: "",
+        address: "",
+        billdate:"",
+        enddate:'',
+        begdate:'',
+        date:[],
+        itemtype:[],
+        quotedpricenotes: [
+          "1、报价为含税13%税率, 含运费 ",
+          "2、报价有限期 2023-02-02 13:16:47至2023-02-22 13:16:47",
+        ]
+      },
+      rules:{
+        projectname:[
+          { required: true, message: '请选择项目', trigger: 'change'},
+        ],
+        enterprisename:[
+          { required: true, message: '请选择客户', trigger: 'change'},
+        ],
+        itemtype:[
+          { required: true, message: '请选择产品系列', trigger: 'change'},
+        ],
+        date:[
+          { required: true, message: '请选择有效期', trigger: 'change'},
+        ],
+        /*contactsname:[
+          { required: true, message: '请选择联系人', trigger: 'change'},
+        ]*/
+      },
+      itemtype:[]
+    }
+  },
+  methods:{
+    onShow(){
+      this.drawer = true
+      this.data = this.$route.query.data
+      this.form = Object.assign({},this.form,this.$route.query.data)
+      this.form.date[0] = this.form.begdate
+      this.form.date[1] = this.form.enddate
+      if (this.form.quotedpricetype === '项目报价'){
+        this.isQuotedPrice = true
+      }else {
+        this.isQuotedPrice = false
+      }
+    },
+    onClose(){
+      this.$store.dispatch('changeDetailDrawer',false)
+      this.$emit('onSuccess')
+    },
+    onSubmit(){
+     if (this.form.data.length !== 0){
+       this.form.begdate = this.form.date[0]
+       this.form.enddate = this.form.date[1]
+       this.form.quotedpricenotes[1] = "2、报价有限期" + this.form.begdate + "至" + this.form.enddate
+     }else {
+       this.form.begdate = ''
+       this.form.enddate = ''
+     }
+    this.$refs.form.validate(async (valid) => {
+      if (!valid) return false
+      const res = await this.$api.requested({
+        "id": 20221020164803,
+        "content": this.form
+      })
+    })
+    },
+    getSubmit(){
+      if (this.form.date.length === 0){
+        this.form.begdate = ''
+        this.form.enddate = ''
+      }else {
+        this.form.begdate = this.form.date[0]
+        this.form.enddate = this.form.date[1]
+        this.form.quotedpricenotes[1] = "2、报价有限期" + this.form.begdate + "至" + this.form.enddate
+      }
+      this.$refs.form.validate(async (valid) => {
+        if (!valid) return false
+        const res = await this.$api.requested({
+          "id": 20221020164803,
+          "version":1,
+          "content": this.form
+        })
+        this.tool.showMessage(res,() => {
+          this.drawer = false
+          this.changeData(this.productObj)
+
+        })
+      })
+    },
+    /*修改后的产品数据*/
+    productDataChange(val){
+      let obj = val.map(e=>{
+        return {
+          sa_quotedprice_itemsid:e.sa_quotedprice_itemsid,
+          itemid:e.itemid,
+          oldprice:e.marketprice,
+          price:e.price,
+          discountrate:(e.discountrate/100).toFixed(4),
+          qty:e.qty
+        }
+      })
+      this.productObj = obj
+    },
+    async changeData(obj){
+      const res = await this.$api.requested({
+        "id": 20221021095403,
+        "content": {
+          "sa_quotedpriceid":this.form.sa_quotedpriceid,     //sat_notice_classid<=0时 为新增
+          "items":obj
+        }
+      })
+      this.$emit('onSuccess')
+      this.$store.dispatch('changeDetailDrawer',false)
+    },
+    /*刷新总金额*/
+    queryTotalPrice(val){
+      this.form.totalPrice = val
+    },
+    async projectList(){
+      const res = await this.$api.requested(this.projectParam)
+      this.project.projectData = res.data
+      this.project.total = res.total
+      this.project.currentPage = res.pageNumber
+    },
+    async selectProject(){
+      this.projectShow = true
+      this.projectParam.content.where.condition = this.form.projectname
+      this.projectList()
+    },
+    async customerList(){
+      if (this.form.quotedpricetype === '客户报价'){
+        this.customerParam.content.where.sa_projectid = 0
+        this.customerParam.content.where.type = 2
+      }else {
+        this.customerParam.content.where.type = 4
+        this.customerParam.content.where.sa_projectid = this.form.sa_projectid
+      }
+      const res = await this.$api.requested(this.customerParam)
+      this.customer.customerData = res.data
+      this.customer.total = res.total
+      this.customer.currentPage = res.pageNumber
+    },
+    selectCustomer(){
+      this.customerParam.content.where.condition = this.form.enterprisename
+      this.customerList()
+    },
+    async contactsList(){
+      this.contactsParam.content.sys_enterpriseid = this.form.sys_enterpriseid
+      const res = await this.$api.requested(this.contactsParam)
+      this.contacts.contactsData = res.data
+      this.contacts.total = res.total
+      this.contacts.currentPage = res.pageNumber
+    },
+    selectContacts(){
+      this.contactsShow = true
+      this.contactsParam.content.where.condition = this.form.name
+      this.contactsList()
+    },
+    /*项目选择信息*/
+    projectData(val){
+      this.form.sa_projectid = val.sa_projectid
+      this.form.projectname = val.projectname
+      this.form.projectnum = val.projectnum
+      this.form.sys_enterpriseid = ''
+      this.form.enterprisename = ''
+      this.form.contactsid = 0
+      this.form.contactsname = ''
+      this.form.contactsphonenumber = ''
+      this.form.fax = ''
+      this.form.telephone = ''
+      this.projectShow = false
+    },
+    /*更改项目前提示*/
+    projectOpen(val) {
+      this.$confirm('修改项目后将清空产品配置, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.productList()
+        this.projectData(val)
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });
+      });
+    },
+    /*获取产品明细*/
+    async productList(){
+      const res = await this.$api.requested({
+        "id": 20221021095503,
+        "content": {
+          "sa_quotedpriceid":this.form.sa_quotedpriceid     //sat_notice_classid<=0时 为新增
+        }
+      })
+      console.log(res,"产品明细")
+      this.clearData = []
+      res.data.forEach((item,index)=>{
+        console.log(item)
+        this.clearData[index] = item.sa_quotedprice_itemsid
+      })
+      console.log(this.clearData,"需要删除的产品明细")
+      this.productClear()
+    },
+    /*清空产品明细*/
+    async productClear(){
+      const res = await this.$api.requested({
+        "id": 20221021095603,
+        "content": {
+          "sa_quotedprice_itemsids":this.clearData     //sat_notice_classid<=0时 为新增
+        }
+      })
+      this.$refs.quoterPrice.productData()
+    },
+    /*客户选择信息*/
+    customerData(val){
+      this.form.sys_enterpriseid = val.sys_enterpriseid
+      this.form.enterprisename = val.enterprisename
+      this.form.contactsid = 0
+      this.form.contactsname = ''
+      this.form.contactsphonenumber = ''
+      this.form.fax = ''
+      this.form.telephone = ''
+      this.customerShow = false
+    },
+    /*联系人选择信息*/
+    contactsData(val){
+      this.form.contactsid = val.contactsid
+      this.form.contactsname = val.name
+      this.form.contactsphonenumber = val.phonenumber
+      this.form.fax = val.fax
+      this.form.telephone = val.telephone
+      this.contactsShow = false
+    },
+    /*项目翻页*/
+    handleSizeChangeProject(val) {
+      // console.log(`每页 ${val} 条`);
+      this.projectParam.content.pageSize = val
+      this.projectList()
+    },
+    handleCurrentChangeProject(val) {
+      // console.log(`当前页: ${val}`);
+      this.projectParam.content.pageNumber = val
+      this.projectList()
+    },
+    /*客户翻页*/
+    handleSizeChangeCustomer(val) {
+      // console.log(`每页 ${val} 条`);
+      this.projectParam.content.pageSize = val
+      this.customerList()
+    },
+    handleCurrentChangeCustomer(val) {
+      // console.log(`当前页: ${val}`);
+      this.projectParam.content.pageNumber = val
+      this.customerList()
+    },
+    /*联系人翻页*/
+    handleSizeChangeContacts(val) {
+      // console.log(`每页 ${val} 条`);
+      this.projectParam.content.pageSize = val
+      this.contactsList()
+    },
+    handleCurrentChangeContacts(val) {
+      // console.log(`当前页: ${val}`);
+      this.projectParam.content.pageNumber = val
+      this.contactsList()
+    },
+    /*查询产品系列*/
+    queryItemType(){
+      this.$store.dispatch('optiontypeselect','itemtype').then(res => {
+        this.itemtype = res.data
+      })
+    }
+  },
+  mounted() {
+    this.queryItemType()
+  },
+  created() {
+    this.onShow()
+    this.data = this.$route.query.data
+  }
+}
+</script>
+
+<style scoped>
+>>> .el-divider--horizontal {
+  height: 1px;
+  width: 100%;
+  margin: 0px;
+}
+/deep/.el-input__prefix {
+  display: flex;
+  align-items: center;
+}
+
+</style>

+ 15 - 15
src/Form/QuotedPrice/editCopy.vue

@@ -1,22 +1,22 @@
 <template>
-  <div class="normal-panel">
+  <div class="normal-panel" style="size: 600px">
     <p class="normal-title container">编辑报价单</p>
 <!--    <el-button size="mini" :disabled="data.status !== '新建'"  :type="btnType?btnType:'text'"  @click="onShow" >编 辑</el-button>-->
 <!--    <el-button size="mini" :disabled="data.status !== '新建'"  :type="data.status === '新建'?primary:text"  @click="onShow" >编 辑</el-button>-->
     <div class="drawer__panel" style="margin-bottom: 0px">
       <el-row style="margin-top: 10px">
         <el-form :model="form" :rules="rules" ref="form"  size="mini" label-position="right">
-          <el-col :span="8">
+          <el-col :span="24">
             <el-form-item label="报价类型:" label-width="100px" >
               <el-input v-model="form.quotedpricetype" autocomplete="off" placeholder="报价类型" disabled></el-input>
             </el-form-item>
           </el-col>
-          <el-col  :span="8">
+          <el-col  :span="24">
             <el-form-item label="是否特价:" label-width="100px" >
               <el-input  v-model="form.specialoffer === 0?'否':'是'" autocomplete="off" placeholder="是否特价" disabled></el-input>
             </el-form-item>
           </el-col>
-          <el-col  :span="8" v-if="isQuotedPrice">
+          <el-col  :span="24" v-if="isQuotedPrice">
             <el-form-item label="项目名称:" label-width="100px" prop="projectname">
               <el-popover
                   placement="bottom"
@@ -73,12 +73,12 @@
               </el-popover>
             </el-form-item>
           </el-col>
-          <el-col :span="8" v-if="isQuotedPrice">
+          <el-col :span="24" v-if="isQuotedPrice">
             <el-form-item label="项目编号:" label-width="100px" >
               <el-input  v-model="form.projectnum" autocomplete="off" placeholder="项目编号" disabled></el-input>
             </el-form-item>
           </el-col>
-          <el-col :span="8">
+          <el-col :span="24">
             <el-form-item label="客户名称:" label-width="100px" prop="enterprisename">
               <el-popover
                   placement="bottom"
@@ -135,12 +135,12 @@
               </el-popover>
             </el-form-item>
           </el-col>
-          <el-col  :span="8">
+          <el-col  :span="24">
             <el-form-item label="电话:" label-width="100px" >
               <el-input  v-model="form.telephone" autocomplete="off" placeholder="输入电话" disabled></el-input>
             </el-form-item>
           </el-col>
-          <el-col :span="8">
+          <el-col :span="24">
             <el-form-item label="联系人:" label-width="100px" prop="contactsname">
               <el-popover
                   placement="bottom"
@@ -204,12 +204,12 @@
               </el-popover>
             </el-form-item>
           </el-col>
-          <el-col  :span="8">
+          <el-col  :span="24">
             <el-form-item label="联系人手机号:" label-width="100px" >
               <el-input  v-model="form.contactsphonenumber" autocomplete="off" placeholder="手机号" disabled></el-input>
             </el-form-item>
           </el-col>
-          <el-col  :span="8">
+          <el-col  :span="24">
             <el-form-item label="报价日期:" label-width="90px">
               <el-date-picker
                   v-model="form.billdate"
@@ -221,7 +221,7 @@
               </el-date-picker>
             </el-form-item>
           </el-col>
-          <el-col :span="8">
+          <el-col :span="24">
             <el-form-item label="有效期:" label-width="100px" prop="date">
               <el-date-picker
                   v-model="form.data"
@@ -235,7 +235,7 @@
               </el-date-picker>
             </el-form-item>
           </el-col>
-          <el-col  :span="8" >
+          <el-col  :span="24" >
             <el-form-item label="产品系列:" label-width="100px" prop="itemtype">
               <el-select
                   ref="sle"
@@ -257,7 +257,7 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col  :span="8">
+          <el-col  :span="24">
             <el-form-item label="备注:" label-width="100px" prop="remarks">
               <el-input  v-model="form.remarks" autocomplete="off" placeholder="请输入备注信息" type="textarea" autosize></el-input>
             </el-form-item>
@@ -265,12 +265,12 @@
         </el-form>
       </el-row>
     </div>
-    <div >
+<!--    <div >
       <el-divider></el-divider>
     </div>
     <div style="margin:20px 20px 20px 20px">
       <quotedPriceProduct :sa_quotedpriceid="form.sa_quotedpriceid" :sa_projectid="form.sa_projectid" :quotedpricetype="form.quotedpricetype" ref="quoterPrice" @checkForm="onSubmit" @productData="productDataChange"></quotedPriceProduct>
-    </div>
+    </div>-->
     <div class="fixed__btn__panel">
       <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
       <el-button size="small" type="warning" @click="getSubmit" class="normal-btn-width">保 存</el-button>

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

@@ -83,7 +83,7 @@
             </el-col>
             <el-col :span="12">
               <el-form-item label="金额:" prop="amount">
-                <el-input v-model="form.amount" placeholder="请输入支出金额"></el-input>
+                <el-input v-model="form.amount" placeholder="请输入金额" type="number"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="12">

+ 1 - 1
src/Form/cashcoupon/edit.vue

@@ -83,7 +83,7 @@
             </el-col>
             <el-col :span="12">
               <el-form-item label="金额:" prop="amount">
-                <el-input v-model="form.amount" placeholder="请输入支出金额"></el-input>
+                <el-input v-model="form.amount" placeholder="请输入金额" type="number"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="12">

+ 73 - 26
src/Form/projectChange/add.vue

@@ -42,10 +42,10 @@
               </el-form-item>
             </el-col>
             <el-col :span="24">
-              <el-form-item label="省市县:" prop="province">
+              <el-form-item label="省市县:" prop="value">
                 <el-cascader
                     style="width:100%"
-                    v-model="value"
+                    v-model="form.value"
                     :options="basicData.data().areaData"
                     @change="cascaderChange" clearable>
                 </el-cascader>
@@ -120,7 +120,30 @@
               </el-form-item>
             </el-col>
 
-
+            <el-col :span="24">
+              <el-form-item label="领域:" prop="tradefields">
+                <el-select v-model="form.tradefields[0]" placeholder="请选择领域">
+                  <el-option
+                      v-for="item in tradefieldSelect"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="品牌:" prop="sa_brandid">
+                <el-select v-model="form.sa_brandid" placeholder="请选择品牌">
+                  <el-option
+                      v-for="item in brandSelect"
+                      :key="item.sa_brandid"
+                      :label="item.brandname"
+                      :value="item.sa_brandid">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
 
           </el-form>
         </el-row>
@@ -192,9 +215,14 @@ export default {
         totalinvestment:'', //总投资额
         costofconstruction:'', //造价
         begdate_due:'', //预计开工时间
-        enddate_due:''  //预计完工时间
+        enddate_due:'',  //预计完工时间
+        sa_brandid:"",
+        tradefields:[],
+        value:[],
       },
-      value:'',
+      brandSelect:[],
+      tradefieldSelect:[],
+      value:[],
       rules:{
         projectname:[
           { required: true, message: '输入项目名称', trigger: 'blur'},
@@ -203,7 +231,7 @@ export default {
           { required: true, message: '输入项目编号', trigger: 'blur'}
         ],*/
         projecttype:[
-          { required: true, message: '请选择项目类型', trigger: 'blur'}
+          { required: true, message: '请选择项目类型', trigger: 'change'}
         ],
         sys_enterpriseid:[
           { required: true, message: '请选择企业', trigger: 'blur'},
@@ -211,8 +239,14 @@ export default {
         /*sa_projstagetempid:[
           { required: true, message: '请选择当前项目模板', trigger: 'blur'}
         ],*/
-        province:[
-          { required: true, message: '请选择项目地址', trigger: 'blur'}
+        value:[
+          { required: true, message: '请选择省市县', trigger: 'change'}
+        ],
+        tradefields:[
+          { required: true, message: '请选择领域', trigger: 'change'}
+        ],
+        sa_brandid:[
+          { required: true, message: '请选择品牌', trigger: 'change'}
         ],
         begdate_due:[
           { required: false, validator: begdateTime, trigger: 'change' }
@@ -234,6 +268,7 @@ export default {
 
       this.form = Object.assign({},this.form,{province:val[0],city:val[1],county:val[2]})
 
+
     },
     /*自动查重判断*/
     duplicateCheck(){
@@ -344,6 +379,8 @@ export default {
               province:"",
               city:"",
               county:"",
+              sa_brandid:"",
+              tradefields:[]
             }
             this.dialogFormVisible = false
             this.checkResults = ''
@@ -383,6 +420,8 @@ export default {
         province:"",
         city:"",
         county:"",
+        sa_brandid:"",
+        tradefields:[]
       }
       this.dialogFormVisible = false
       this.checkResults = ''
@@ -403,26 +442,34 @@ export default {
     },
     onClose(){
       this.$refs['form'].resetFields()
-      this.value = ''
-      this.form={
-        sa_projectid:0,
-        projectname:"",
-        projectnum:"",
-        address:"",//可选
-        grade:"",//可选
-        budgetary:"",//可选
-        remarks:"",//可选
-        projecttype:"",//可选
-        sa_projstagetempid:"",//可选
-        signdate_due:"",//可选
-        scale:"",//可选
-        signamount_due:"",//可选
-        province:"",
-        city:"",
-        county:"",
-      }
       this.dialogFormVisible = false
+    },
+    /*获取品牌*/
+    async queryBrand(){
+      const res = await this.$api.requested({
+        content: {
+        isExport: 0,
+        pageNumber: 1,
+        pageSize: 20,
+        where: {
+            condition: "",
+            tablefilter: {}
+          }
+        },
+        id: 20220922085103
+      })
+      this.brandSelect = res.data
+    },
+    /*获取领域*/
+    queryTradefield(){
+      this.$store.dispatch('optiontypeselect','tradefield').then(res=>{
+        this.tradefieldSelect = res.data
+      })
     }
+  },
+  mounted() {
+    this.queryBrand()
+    this.queryTradefield()
   }
 }
 </script>

+ 86 - 22
src/Form/projectChange/edit.vue

@@ -119,7 +119,30 @@
                 <el-input v-model="form.signamount_due" placeholder="请输入预计签约金额" disabled></el-input>
               </el-form-item>
             </el-col>
-
+            <el-col :span="24">
+              <el-form-item label="领域:" prop="tradefields">
+                <el-select v-model="form.tradefields[0]" placeholder="请选择领域">
+                  <el-option
+                      v-for="item in tradefieldSelect"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="品牌:" prop="sa_brandid">
+                <el-select v-model="form.sa_brandid" placeholder="请选择品牌">
+                  <el-option
+                      v-for="item in brandSelect"
+                      :key="item.sa_brandid"
+                      :label="item.brandname"
+                      :value="item.sa_brandid">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
 
           </el-form>
         </el-row>
@@ -177,40 +200,55 @@ export default {
       addChange:false,
       checkResults:'',
       form:{
-        "sa_projectid":0,
-        "projectname":"",
-        "projectnum":"",
-        "address":"",//可选
-        "grade":"",//可选
-        "budgetary":"",//可选
-        "remarks":"",//可选
-        "projecttype":"",//可选
-        "sa_projstagetempid":"",//可选
-        "signdate_due":"",//可选
-        "scale":"",//可选
-        "signamount_due":"",//可选
-        "province":"",
-        "city":"",
-        "county":"",
+        sa_projectid:0,
+        projectname:"",
+        projectnum:"",
+        address:"",//可选
+        grade:"",//可选
+        budgetary:"",//可选
+        remarks:"",//可选
+        projecttype:"",//可选
+        sa_projstagetempid:"",//可选
+        signdate_due:"",//可选
+        scale:"",//可选
+        signamount_due:"",//可选
+        province:"",
+        city:"",
+        county:"",
+        totalinvestment:'', //总投资额
+        costofconstruction:'', //造价
+        begdate_due:'', //预计开工时间
+        enddate_due:'',  //预计完工时间
+        sa_brandid:"",
+        tradefields:[],
+        value:[],
       },
+      brandSelect:[],
+      tradefieldSelect:[],
       rules:{
         projectname:[
           { required: true, message: '输入项目名称', trigger: 'blur'},
         ],
-        projectnum:[
+        /*projectnum:[
           { required: true, message: '输入项目编号', trigger: 'blur'}
-        ],
+        ],*/
         projecttype:[
-          { required: true, message: '请选择项目类型', trigger: 'blur'}
+          { required: true, message: '请选择项目类型', trigger: 'change'}
         ],
         sys_enterpriseid:[
           { required: true, message: '请选择企业', trigger: 'blur'},
         ],
-        sa_projstagetempid:[
+        /*sa_projstagetempid:[
           { required: true, message: '请选择当前项目模板', trigger: 'blur'}
-        ],
+        ],*/
         province:[
-          { required: true, message: '请选择项目地址', trigger: 'blur'}
+          { required: true, message: '请选择省市县', trigger: 'change'}
+        ],
+        tradefields:[
+          { required: true, message: '请选择领域', trigger: 'change'}
+        ],
+        sa_brandid:[
+          { required: true, message: '请选择品牌', trigger: 'change'}
         ],
         begdate_due:[
           { required: false, validator: begdateTime, trigger: 'change' }
@@ -379,8 +417,34 @@ export default {
     },
     onClose(){
       this.dialogFormVisible = false
+    },
+    /*获取品牌*/
+    async queryBrand(){
+      const res = await this.$api.requested({
+        content: {
+          isExport: 0,
+          pageNumber: 1,
+          pageSize: 20,
+          where: {
+            condition: "",
+            tablefilter: {}
+          }
+        },
+        id: 20220922085103
+      })
+      this.brandSelect = res.data
+    },
+    /*获取领域*/
+    queryTradefield(){
+      this.$store.dispatch('optiontypeselect','tradefield').then(res=>{
+        this.tradefieldSelect = res.data
+      })
     }
   },
+  mounted() {
+    this.queryBrand()
+    this.queryTradefield()
+  }
 }
 </script>
 

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

@@ -33,7 +33,7 @@
           <span v-if="scope.data.column.data[scope.data.column.columnname] == 0" style="color:red">未上架</span>
           <span v-if="scope.data.column.data[scope.data.column.columnname] == 1" style="color:rgb(82, 196, 26)">已上架</span>
         </div>
-        <div v-if="scope.data.column.columnname == 'sequence'">
+        <div v-else-if="scope.data.column.columnname == 'sequence'">
           {{scope.data.column.data.sequence + 1}}
         </div>
         <div v-else>

+ 1 - 1
src/HDrpManagement/ProductMag/modules/priceLevelSetting.vue

@@ -46,7 +46,7 @@
             <el-option v-for="item in pricegrade" :key="item.index" :label="item.value" :value="item.value"></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="折扣率:" :label-width="formLabelWidth" prop="discountrate">
+        <el-form-item label="折扣率(%):" :label-width="formLabelWidth" prop="discountrate">
           <el-input v-model="form.discountrate" autocomplete="off" placeholder="请填写折扣" @change="discountrateChange"></el-input>
         </el-form-item>
       </el-form>

+ 4 - 2
src/HDrpManagement/contractManage/components/addContract.vue

@@ -463,7 +463,8 @@ export default {
         'ascription_contractid':'',
         'receiptName':'',
         "rec_contactsid":'',//收货联系人
-        'phonenumber':''
+        'phonenumber':'',
+        'paytype':'123'
 
       },
       rules: {
@@ -590,7 +591,8 @@ export default {
       'ascription_contractid':'',
       'receiptName':'',
       "rec_contactsid":'',//收货联系人
-      'phonenumber':''
+      'phonenumber':'',
+      'paytype':'123'
     }
   },
   methods: {

+ 54 - 1
src/HDrpManagement/projectChange/index.vue

@@ -65,6 +65,28 @@
             </el-option>
           </el-select>
         </div>
+        <div class="mt-10">
+          <label  class="search__label">领域:</label>
+          <el-select class="inline-24" v-model="selectParam.tradefields" placeholder="请选择领域" @change="selectChange" size="small" clearable>
+            <el-option
+                v-for="item in tradefieldSelect"
+                :key="item.value"
+                :label="item.value"
+                :value="item.value">
+            </el-option>
+          </el-select>
+        </div>
+        <div class="mt-10">
+          <label  class="search__label">品牌:</label>
+          <el-select class="inline-24" v-model="selectParam.sa_brandid" placeholder="请选择品牌" @change="selectChange" size="small" clearable>
+            <el-option
+                v-for="item in brandSelect"
+                :key="item.sa_brandid"
+                :label="item.brandname"
+                :value="item.sa_brandid">
+            </el-option>
+          </el-select>
+        </div>
         <div class="mt-10">
           <label  class="search__label">项目状态:</label>
           <el-select class="inline-24" v-model="selectParam.status" placeholder="请选择项目状态" @change="selectChange" size="small" clearable>
@@ -113,6 +135,9 @@
         <div v-else-if="scope.data.column.columnname === 'name'">
           {{scope.data.column.data.leader[0] && scope.data.column.data.leader[0].name}}
         </div>
+        <div v-else-if="scope.data.column.columnname === 'tradefields'">
+          {{scope.data.column.data.tradefields?scope.data.column.data.tradefields.split('""')[0]:'--'}}
+        </div>
         <div v-else>
           {{scope.data.column.data[[scope.data.column.columnname]]?scope.data.column.data[[scope.data.column.columnname]]:'--'}}
         </div>
@@ -165,6 +190,8 @@ export default {
 
         ]
       },
+      brandSelect:[],
+      tradefieldSelect:[],
       tabName:"1",
       tabIndex:"1",
       editableTabs: [
@@ -194,7 +221,9 @@ export default {
         grade:'',
         startdate:'',
         enddate:'',
-        stagename:''
+        stagename:'',
+        sa_brandid:"",
+        tradefields:"",
       },
     }
   },
@@ -320,6 +349,28 @@ export default {
         }
       })
       this.option.stageList = res.data
+    },
+    /*获取品牌*/
+    async queryBrand(){
+      const res = await this.$api.requested({
+        content: {
+          isExport: 0,
+          pageNumber: 1,
+          pageSize: 20,
+          where: {
+            condition: "",
+            tablefilter: {}
+          }
+        },
+        id: 20220922085103
+      })
+      this.brandSelect = res.data
+    },
+    /*获取领域*/
+    queryTradefield(){
+      this.$store.dispatch('optiontypeselect','tradefield').then(res=>{
+        this.tradefieldSelect = res.data
+      })
     }
     /*onChangeTab(val){
       console.log(val)
@@ -339,6 +390,8 @@ export default {
   },
   mounted () {
     this.queryData(1)
+    this.queryBrand()
+    this.queryTradefield()
   }
 }
 </script>

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

@@ -323,6 +323,8 @@ export default {
           {label:'预计签约时间',value:this.mainData.signdate_due ? this.mainData.signdate_due : '--'},
           {label:'预计签约金额(元)',value:this.mainData.signamount_due ? this.mainData.signamount_due : '--'},
           {label:'赢率',value:this.mainData.winrate ? this.mainData.winrate : '--'},
+          {label:'领域',value:this.mainData.tradefields ? this.mainData.tradefields : '--'},
+          {label:'品牌',value:this.mainData.brandname ? this.mainData.brandname : '--'},
           // {label:'项目等级',value:this.projectLead.find(item => item.rowindex == this.mainData.grade).value},
 
 

+ 4 - 4
src/HDrpManagement/projectChange/modules/modules/productSet/Select.vue

@@ -5,18 +5,18 @@
         <li style="color:#999;font-size: 13px;">领域:</li>
         <li :class="field_act === item.value?'act':''" class="brand-item" v-for="item in fields" :key="item.value" @click="clickField(item)">{{item.value}}</li>
       </ul>
-      <ul class="flex-align-center normal-margin">
+<!--      <ul class="flex-align-center normal-margin">
         <li style="color:#999;font-size: 13px;">标准:</li>
         <li :class="standard_act === item.value?'act':''" class="brand-item" v-for="item in itemstandards" :key="item.value" @click="clickStandard(item)">{{item.value}}</li>
-      </ul>
+      </ul>-->
       <ul class="flex-align-center normal-margin">
         <li style="color:#999;font-size: 13px;">品牌:</li>
         <li :class="brand_act === item.sa_brandid?'act':''" class="brand-item" v-for="item in brands" :key="item.sa_brandid" @click="clickBrand(item.sa_brandid)">{{item.brandname}}</li>
       </ul>
-      <ul class="flex-align-center normal-margin">
+<!--      <ul class="flex-align-center normal-margin">
         <li style="color:#999;font-size: 13px;">分类:</li>
         <li :class="class_act === item.itemclassnum?'act':''" class="brand-item" v-for="item in itemclass" :key="item.itemclassnum" @click="clickClass(item)">{{item.itemclassname}}</li>
-      </ul>
+      </ul>-->
       <classTree style="padding-left:31px" :data="activeClass.subdep" @onClassChange="change"></classTree>
     </div>
     <div>

+ 1 - 1
src/HDrpManagement/projectChange/modules/modules/productSet/add.vue

@@ -266,7 +266,7 @@ export default {
       this.dialogFormVisible = true
       setTimeout(()=>{
         this.params.content.where.tradefield = this.$refs.classShow.field_act
-        this.params.content.where.standards = this.$refs.classShow.standard_act
+        /*this.params.content.where.standards = this.$refs.classShow.standard_act*/
        /* this.params.content.where.itemclassid = this.$refs.classShow.class_act*/
         this.params.content.where.sa_brandid = this.$refs.classShow.brand_act
         this.listData()

+ 15 - 0
src/SDrpManagement/QuotedPrice/components/edit/itemClassAdd.vue

@@ -0,0 +1,15 @@
+<template>
+  <div>
+    <el-button size="small"  type="primary" icon="el-icon-plus" >添加</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "itemClassAdd"
+}
+</script>
+
+<style scoped>
+
+</style>

+ 316 - 0
src/SDrpManagement/QuotedPrice/components/edit/quotedPriceItemClass.vue

@@ -0,0 +1,316 @@
+<template>
+  <div>
+    <div style="padding-bottom: 35px">
+      <el-input
+          size="small"
+          style="width: 200px;float: left"
+          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>
+      <delProduct style="float: right;" ref="delProduct" :data="selectDel" @delSuccess="delSuccess"></delProduct>
+      <itemClassAdd style="float: right;margin-right: 10px;margin-bottom: 10px" :id="sa_projectid" :sa_quotedpriceid="sa_quotedpriceid" :quotedpricetype="quotedpricetype"  ref="quoterPrice" @productAdd="productData"></itemClassAdd>
+
+    </div>
+    <div class="produtMag-panel" >
+      <el-table
+          ref="multipleTable"
+          :data="list"
+          style="width: 100%"
+          :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="42"
+            fixed>
+        </el-table-column>
+        <el-table-column
+            prop="itemno"
+            label="产品类别名称"
+            width="0">
+        </el-table-column>
+        <el-table-column
+            prop="itemname"
+            label="品牌"
+            width="0">
+        </el-table-column>
+
+        <el-table-column
+            prop="discountrate"
+            label="折扣(%)"
+            fixed="right"
+            width="100">
+          <template slot-scope="scope">
+            <el-input  v-model="scope.row.discountrate" size="mini" placeholder="请输入折扣" @change="onChangeDiscountrate(scope.row.discountrate,scope.row,scope.$index)"></el-input>
+          </template>
+        </el-table-column>
+      </el-table>
+      <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>
+</template>
+
+<script>
+import uploadFile from "@/components/upload/hw_obs_upload";
+import previewImage from "@/components/previewImage";
+import productTable from './productTable'
+import importExcel from './importQuotedPrice'
+import delProduct from "@/SDrpManagement/QuotedPrice/components/delProduct";
+import productTableProject from "./productTableProject"
+
+import itemClassAdd from "@/SDrpManagement/QuotedPrice/components/edit/itemClassAdd";
+export default {
+  props:["sa_projectid","sa_quotedpriceid","quotedpricetype"],
+  name: "quotedPriceProduct",
+  components:{uploadFile, previewImage,productTable,delProduct,importExcel,productTableProject,itemClassAdd},
+  data(){
+    return {
+      selectDel:[],
+      totalPrice:0,
+      step:1,
+      tablecols:[],
+      list:[],
+      total:0,
+      currentPage:0,
+      changeList:[],
+      setTopColor:{
+        color:'#79da56'
+      },
+      setDownColor:{
+        color:'#ef230c'
+      },
+      param:{
+        "id": 20221021095503,
+        "version":1,
+        "content": {
+          "sa_quotedpriceid":'',
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where": {
+            "condition": ""
+          }
+
+        }
+      }
+    }
+  },
+  methods:{
+    /*产品配置信息*/
+    async productData(){
+      this.param.content.sa_quotedpriceid = this.sa_quotedpriceid
+      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].amount
+      }
+      this.totalPrice = Math.round(this.totalPrice * 100)/100
+      this.$emit('productData',this.list)
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.productData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.productData()
+    },
+    /*批量删除*/
+    delSuccess(){
+      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.selectDel = []
+      for (let i=0;i<val.length;i++){
+        this.selectDel[i] = val[i].sa_quotedprice_itemsid
+      }
+      this.$refs.delProduct.length = this.selectDel.length
+    },
+    checkForm(){
+      this.$emit('checkForm')
+    },
+    quoterPrice(sa_quotedpriceid,type){
+      this.sa_quotedpriceid = sa_quotedpriceid
+      this.$refs.quoterPrice.queryProduct(sa_quotedpriceid,type)
+      this.$refs.quoterPriceProject.queryProduct(sa_quotedpriceid,type)
+    },
+    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].amount
+      }
+      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].amount
+      }
+      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)
+    },
+    objSet(data){
+      let obj = data.map(e=>{
+        return {
+          sa_quotedprice_itemsid:e.sa_quotedprice_itemsid,
+          itemid:e.itemid,
+          oldprice:e.marketprice,
+          price:e.price,
+          discountrate:0,
+          qty:e.qty
+        }
+      })
+      this.changeDiscountrateData(obj)
+    },
+    async changeData(obj){
+      const res = await this.$api.requested({
+        "id": 20221021095403,
+        "version":1,
+        "content": {
+          "sa_quotedpriceid":this.list[0].sa_quotedpriceid,     //sat_notice_classid<=0时 为新增
+          "items":obj
+        }
+      })
+      this.productData(res.data[0].sa_quotedpriceid)
+    },
+    async changeDiscountrateData(obj){
+      const res = await this.$api.requested({
+        "id": 20221021095403,
+        "version":1,
+        "content": {
+          "sa_quotedpriceid":this.list[0].sa_quotedpriceid,     //sat_notice_classid<=0时 为新增
+          "items":obj
+        }
+      })
+      this.productDiscountrateData(res.data[0].sa_quotedpriceid)
+    },
+    async deleteProduct(val){
+      const res = await this.$api.requested({
+        "id": 20221021095603,
+        "version":1,
+        "content": {
+          "sa_quotedprice_itemsids":[val.sa_quotedprice_itemsid]     //sat_notice_classid<=0时 为新增
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.productData(val.sa_quotedpriceid)
+      })
+    },
+    async queryItemClass(){
+      const res = await this.$api.requested({
+        "id": "20230219162803",
+        "content": {
+          "sa_quotedpriceid":this.$route.query.id,
+          "where":{
+            "condition":"",
+            "istool":'',
+            "sa_brandid":''
+          }
+        }
+      })
+      console.log(res,"营销类别末级")
+    }
+  },
+  mounted() {
+    this.productData()
+    this.queryItemClass()
+  }
+}
+</script>
+
+<style scoped>
+.produtMag-panel{
+  margin-top: 15px;
+  background: #fff;
+  border-radius:5px;
+
+  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>

+ 22 - 14
src/SDrpManagement/QuotedPrice/components/productTable.vue

@@ -20,7 +20,7 @@
           </div>
         </div>
         <div class="container">
-          <selectClass @brandChange="brandChange" @onClassChange="onClassChange" @Search="Search" @clearSearch="clearSearch" @clickStandard="clickStandard" @clickField="clickField" :default="true"></selectClass>
+          <selectClass ref="classShow" @brandChange="brandChange" @onClassChange="onClassChange" @Search="Search" @clearSearch="clearSearch" @clickStandard="clickStandard" @clickField="clickField" :default="true"></selectClass>
         </div>
         <div class="produtMag-panel">
           <el-table
@@ -194,7 +194,16 @@ export default {
   methods:{
     onShow(){
      /* this.dialogProjectVisible = true*/
-      this.$emit('checkForm')
+     /* this.$emit('checkForm')*/
+      this.dialogProductVisible = true
+      setTimeout(()=>{
+        this.params.content.where.tradefield = this.$refs.classShow.field_act
+        this.params.content.where.standards = this.$refs.classShow.standard_act
+        /* this.params.content.where.itemclassid = this.$refs.classShow.class_act*/
+        this.params.content.where.sa_brandid = this.$refs.classShow.brand_act
+        this.productData()
+        this.selectListData()
+      },1000)
       /*this.productData()*/
 
     },
@@ -202,19 +211,17 @@ export default {
       this.dialogProductVisible = false
     },
     async onSubmit(){
-      console.log(this.id)
-      console.log(this.sa_quotedpriceid)
       const res = await this.$api.requested({
         "id": 20221021095403,
         "content": {
-          "sa_quotedpriceid":this.sa_quotedpriceid,     //sat_notice_classid<=0时 为新增
+          "sa_quotedpriceid":this.$route.query.id,     //sat_notice_classid<=0时 为新增
           "items":this.selectData
         }
       })
       this.tool.showMessage(res,()=>{
         /*this.dialogProductVisible = false*/
         this.$emit('productAdd')
-        this.queryProduct(this.sa_quotedpriceid,this.type)
+        this.productData()
         this.selectListData()
       })
     },
@@ -259,7 +266,8 @@ export default {
     },
     /*产品配置信息*/
     async productData(){
-      this.params.content.sa_quotedpriceid = this.sa_quotedpriceid
+      this.params.content.sa_quotedpriceid = this.$route.query.id
+      this.params.content.sa_projectid = 0
       const res = await this.$api.requested(this.params)
       this.list = res.data
       this.total = res.total
@@ -330,7 +338,7 @@ export default {
       const res = await this.$api.requested({
         "id": 20221021095503,
         "content": {
-          "sa_quotedpriceid":this.sa_quotedpriceid     //sat_notice_classid<=0时 为新增
+          "sa_quotedpriceid":this.$route.query.id     //sat_notice_classid<=0时 为新增
         }
       })
       console.log(res,"已选产品123456")
@@ -339,30 +347,30 @@ export default {
     },
     brandChange(id) {
       this.brandId = id
-      this.queryProduct(this.sa_quotedpriceid,this.type)
+      this.productData()
     },
     onClassChange (n) {
       this.params.content.where.itemclassid = n.itemclassid
-      this.queryProduct(this.sa_quotedpriceid,this.type)
+      this.productData()
     },
     Search(data) {
       this.params.content.where.condition = data
       this.params.content.pageNumber = 1
-      this.queryProduct(this.sa_quotedpriceid,this.type)
+      this.productData()
     },
     clearSearch() {
       this.params.content.where.condition = ''
       this.params.content.pageNumber = 1
-      this.queryProduct(this.sa_quotedpriceid,this.type)
+      this.productData()
     },
     clickField (item) {
       console.log(item,'clickField')
       this.params.content.where.tradefield = item.value
-      this.queryProduct(this.sa_quotedpriceid,this.type)
+      this.productData()
     },
     clickStandard (item){
       this.params.content.where.standards = item.value
-      this.queryProduct(this.sa_quotedpriceid,this.type)
+      this.productData()
     }
   },
   mounted() {

+ 377 - 0
src/SDrpManagement/QuotedPrice/components/productTableCopy.vue

@@ -0,0 +1,377 @@
+<template>
+  <div>
+    <el-button size="small"  type="primary" icon="el-icon-plus" @click="onShow">自产品档案添加</el-button>
+    <el-drawer
+        title="自产品档案添加"
+        :visible.sync="dialogProductVisible"
+        append-to-body
+        size="80%"
+        direction="rtl"
+        :show-close="false"
+        @close="onColes">
+      <div class="drawer__panel">
+        <div class="flex-align-center flex-between ">
+          <slot name="operation"></slot>
+          <div class="flex-align-center">
+            <el-input size="small"  suffix-icon="el-icon-search" v-model="params.content.where.condition" placeholder="产品名称,编号" @keyup.enter.native="productData(params.content.pageNumber = 1)" @clear="productData(params.content.pageNumber = 1)" clearable></el-input>&nbsp;
+          </div>
+          <div style="margin-top:-10px;margin-bottom: 10px;float: right">
+            <el-button style="float: right" type="primary" size="mini" @click="batchSelect" :disabled="tableSelectData.length === 0 ">批量添加</el-button>
+          </div>
+        </div>
+        <div class="container">
+          <selectClass @brandChange="brandChange" @onClassChange="onClassChange" @Search="Search" @clearSearch="clearSearch" @clickStandard="clickStandard" @clickField="clickField" :default="true"></selectClass>
+        </div>
+        <div class="produtMag-panel">
+          <el-table
+              ref="multipleTable"
+              :data="list"
+              style="width: 100%"
+              :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="42"
+                fixed>
+            </el-table-column>
+            <el-table-column
+                align="center"
+                label="产品图"
+                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>
+                </div>
+              </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
+                label="型号/规格"
+                width="180">
+              <template slot-scope="scope">
+                <p><span>{{scope.row.model}}</span>&nbsp;/&nbsp;<span>{{scope.row.spec}}</span></p>
+              </template>
+            </el-table-column>
+            <el-table-column
+                prop="caliber"
+                label="口径"
+                width="180">
+            </el-table-column>
+            <el-table-column
+                prop="pressure"
+                label="压力"
+                width="180">
+            </el-table-column>
+            <el-table-column
+                prop="material"
+                label="材质"
+                width="180">
+            </el-table-column>
+            <el-table-column
+                prop="brand"
+                label="品牌"
+                width="180">
+              <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="0">
+              <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="marketprice"
+                label="牌价(元)"
+                fixed="right"
+                width="100">
+              <template slot-scope="scope">
+                  <span >{{scope.row.marketprice?scope.row.marketprice:'--'}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column
+                prop="totalPrice"
+                fixed="right"
+                label="操作"
+                width="80">
+              <template slot-scope="scope">
+                <el-button type="text" @click="onSelect(scope.row)">添 加</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <div>
+            <div style="float: left">已选:{{selectTotal}}个商品</div>
+            <div style="margin-top:16px;text-align:right">
+              <el-pagination
+                  background
+                  small
+                  @size-change="handleSizeChange"
+                  @current-change="handleCurrentChange"
+                  :current-page="currentPage"
+                  :page-size="params.content.pageSize"
+                  layout="total, prev, pager, next, jumper"
+                  :total="total">
+              </el-pagination>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="onColes" class="normal-btn-width">取 消</el-button>
+<!--        <el-button size="small" type="primary" @click="onSubmit"  class="normal-btn-width">确 定</el-button>-->
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import uploadFile from "@/components/upload/hw_obs_upload";
+import previewImage from "@/components/previewImage";
+import selectClass from './Select'
+export default {
+  name: "productTable",
+  props:["id"],
+  components:{uploadFile, previewImage,selectClass},
+  data(){
+    return {
+      dialogProductVisible:false,
+      type:'',
+      tablecols:[],
+      list:[],
+      total:0,
+      currentPage:0,
+      tableSelectData:[],
+      selectData:[],
+      selectTotal:0,
+      sa_quotedpriceid:'',
+      params:{
+        "id": 20221020164903,
+        "content": {
+          "sa_projectid":0,
+          "sa_quotedpriceid":"",
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where": {
+            "condition": "",
+            "tradefield":"",
+            "itemclassid":"",
+            "sa_brandid":"",
+            "standards":""
+          }
+
+        }
+      },
+      timer:0
+    }
+  },
+  methods:{
+    onShow(){
+     /* this.dialogProjectVisible = true*/
+      this.$emit('checkForm')
+      /*this.productData()*/
+
+    },
+    onColes(){
+      this.dialogProductVisible = false
+    },
+    async onSubmit(){
+      console.log(this.id)
+      console.log(this.sa_quotedpriceid)
+      const res = await this.$api.requested({
+        "id": 20221021095403,
+        "content": {
+          "sa_quotedpriceid":this.sa_quotedpriceid,     //sat_notice_classid<=0时 为新增
+          "items":this.selectData
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        /*this.dialogProductVisible = false*/
+        this.$emit('productAdd')
+        this.queryProduct(this.sa_quotedpriceid,this.type)
+        this.selectListData()
+      })
+    },
+    onSelect(val){
+      console.log(val,"选择的商品")
+      this.tableSelectData = []
+      this.tableSelectData[0] = val
+      let obj = this.tableSelectData.map(e=>{
+        return {
+          sa_quotedprice_itemsid:'0',
+          itemid:e.itemid,
+          oldprice:e.marketprice,
+          /*price:(e.marketprice * 100)/100,*/
+          price:e.marketprice,
+          discountrate:1,
+          qty:1
+        }
+      })
+      this.selectData = obj
+      /*this.$nextTick(()=>{
+        this.onSubmit()
+      })*/
+      this.debounce(this.onSubmit,300)()
+    },
+    batchSelect(){
+      this.debounce(this.onSubmit,300)()
+    },
+    debounce (fn, wait) {
+      let that = this
+      return function () {
+        if (that.timer !== null) clearTimeout(that.timer)
+        that.timer = setTimeout(fn, wait)
+      }
+    },
+    /*获取产品信息*/
+    queryProduct(id,type){
+      this.dialogProductVisible = true
+      this.params.content.sa_projectid = 0
+      this.type = type
+      this.sa_quotedpriceid = id
+      this.productData()
+    },
+    /*产品配置信息*/
+    async productData(){
+      this.params.content.sa_quotedpriceid = this.sa_quotedpriceid
+      const res = await this.$api.requested(this.params)
+      this.list = res.data
+      this.total = res.total
+      /*this.$nextTick(()=>{
+        if (this.type === '项目报价'){
+          for (let i=0;i<this.list.length;i++){
+            this.$refs.multipleTable.toggleRowSelection(this.list[i],true)
+          }
+        }
+      })*/
+
+    },
+    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.tableSelectData = []
+      this.tableSelectData = val
+      if (this.type === '项目报价'){
+        let obj = this.tableSelectData.map(e=>{
+          return {
+            sa_quotedprice_itemsid:'0',
+            itemid:e.itemid,
+            oldprice:e.marketprice,
+            /*price:(e.marketprice * 100)/100,*/
+            price:e.marketprice,
+            discountrate:1,
+            qty:1
+          }
+        })
+        this.selectData = obj
+      }else {
+        let obj = this.tableSelectData.map(e=>{
+          return {
+            sa_quotedprice_itemsid:'0',
+            itemid:e.itemid,
+            oldprice:e.marketprice,
+            /*price:(e.marketprice * 100)/100,*/
+            price:e.marketprice,
+            discountrate:1,
+            qty:1
+          }
+        })
+        this.selectData = obj
+      }
+    },
+    /*已选产品数据*/
+    async selectListData(){
+      const res = await this.$api.requested({
+        "id": 20221021095503,
+        "content": {
+          "sa_quotedpriceid":this.sa_quotedpriceid     //sat_notice_classid<=0时 为新增
+        }
+      })
+      console.log(res,"已选产品123456")
+      this.selectTotal = res.total
+      console.log(res.total,"已选产品数量")
+    },
+    brandChange(id) {
+      this.brandId = id
+      this.queryProduct(this.sa_quotedpriceid,this.type)
+    },
+    onClassChange (n) {
+      this.params.content.where.itemclassid = n.itemclassid
+      this.queryProduct(this.sa_quotedpriceid,this.type)
+    },
+    Search(data) {
+      this.params.content.where.condition = data
+      this.params.content.pageNumber = 1
+      this.queryProduct(this.sa_quotedpriceid,this.type)
+    },
+    clearSearch() {
+      this.params.content.where.condition = ''
+      this.params.content.pageNumber = 1
+      this.queryProduct(this.sa_quotedpriceid,this.type)
+    },
+    clickField (item) {
+      console.log(item,'clickField')
+      this.params.content.where.tradefield = item.value
+      this.queryProduct(this.sa_quotedpriceid,this.type)
+    },
+    clickStandard (item){
+      this.params.content.where.standards = item.value
+      this.queryProduct(this.sa_quotedpriceid,this.type)
+    }
+  },
+  mounted() {
+  }
+}
+</script>
+
+<style scoped>
+.image {
+  width:38px;height:38px;margin:0px auto;
+}
+</style>

+ 25 - 15
src/SDrpManagement/QuotedPrice/components/productTableProject.vue

@@ -20,7 +20,7 @@
           </div>
         </div>
         <div class="container">
-          <selectClass @brandChange="brandChange" @onClassChange="onClassChange" @Search="Search" @clearSearch="clearSearch" @clickStandard="clickStandard" @clickField="clickField" :default="true"></selectClass>
+          <selectClass ref="classShow" @brandChange="brandChange" @onClassChange="onClassChange" @Search="Search" @clearSearch="clearSearch" @clickStandard="clickStandard" @clickField="clickField" :default="true"></selectClass>
         </div>
         <div class="produtMag-panel">
           <el-table
@@ -157,12 +157,11 @@ import previewImage from "@/components/previewImage";
 import selectClass from './Select'
 export default {
   name: "productTable",
-  props:["id"],
+  props:["sa_projectid",'type'],
   components:{uploadFile, previewImage,selectClass},
   data(){
     return {
       dialogProductVisible:false,
-      type:'',
       tablecols:[],
       list:[],
       total:0,
@@ -170,7 +169,6 @@ export default {
       tableSelectData:[],
       selectData:[],
       selectTotal:0,
-      sa_quotedpriceid:'',
       params:{
         "id": 20221020164903,
         "version":1,
@@ -195,8 +193,18 @@ export default {
   methods:{
     onShow(){
      /* this.dialogProjectVisible = true*/
-      this.$emit('checkFormProject','project')
+      /*this.$emit('checkFormProject','project')*/
       /*this.productData()*/
+      this.dialogProductVisible = true
+      setTimeout(()=>{
+        this.params.content.where.tradefield = this.$refs.classShow.field_act
+        this.params.content.where.standards = this.$refs.classShow.standard_act
+        /* this.params.content.where.itemclassid = this.$refs.classShow.class_act*/
+        this.params.content.where.sa_brandid = this.$refs.classShow.brand_act
+        this.productData()
+        this.selectListData()
+      },1000)
+
 
     },
     onColes(){
@@ -207,14 +215,15 @@ export default {
       const res = await this.$api.requested({
         "id": 20221021095403,
         "content": {
-          "sa_quotedpriceid":this.sa_quotedpriceid,     //sat_notice_classid<=0时 为新增
+          "sa_quotedpriceid":this.$route.query.id,     //sat_notice_classid<=0时 为新增
           "items":this.selectData
         }
       })
       this.tool.showMessage(res,()=>{
         /*this.dialogProductVisible = false*/
         this.$emit('productAdd')
-        this.queryProduct(this.sa_quotedpriceid,this.type)
+      /*  this.queryProduct(this.sa_quotedpriceid,this.type)*/
+        this.productData()
         this.selectListData()
       })
     },
@@ -259,7 +268,8 @@ export default {
     },
     /*产品配置信息*/
     async productData(){
-      this.params.content.sa_quotedpriceid = this.sa_quotedpriceid
+      this.params.content.sa_quotedpriceid = this.$route.query.id
+      this.params.content.sa_projectid = this.sa_projectid
       const res = await this.$api.requested(this.params)
       this.list = res.data
       this.total = res.total
@@ -329,7 +339,7 @@ export default {
       const res = await this.$api.requested({
         "id": 20221021095503,
         "content": {
-          "sa_quotedpriceid":this.sa_quotedpriceid     //sat_notice_classid<=0时 为新增
+          "sa_quotedpriceid":this.$route.query.id     //sat_notice_classid<=0时 为新增
         }
       })
       console.log(res,"已选产品123456")
@@ -339,30 +349,30 @@ export default {
 
     brandChange(id) {
       this.brandId = id
-      this.queryProduct(this.sa_quotedpriceid,this.type)
+      this.productData()
     },
     onClassChange (n) {
       this.params.content.where.itemclassid = n.itemclassid
-      this.queryProduct(this.sa_quotedpriceid,this.type)
+      this.productData()
     },
     Search(data) {
       this.params.content.where.condition = data
       this.params.content.pageNumber = 1
-      this.queryProduct(this.sa_quotedpriceid,this.type)
+      this.productData()
     },
     clearSearch() {
       this.params.content.where.condition = ''
       this.params.content.pageNumber = 1
-      this.queryProduct(this.sa_quotedpriceid,this.type)
+      this.productData()
     },
     clickField (item) {
       console.log(item,'clickField')
       this.params.content.where.tradefield = item.value
-      this.queryProduct(this.sa_quotedpriceid,this.type)
+      this.productData()
     },
     clickStandard (item){
       this.params.content.where.standards = item.value
-      this.queryProduct(this.sa_quotedpriceid,this.type)
+      this.productData()
     }
   },
   mounted() {

+ 377 - 0
src/SDrpManagement/QuotedPrice/components/productTableProjectCopy.vue

@@ -0,0 +1,377 @@
+<template>
+  <div>
+    <el-button size="small"  type="primary" icon="el-icon-plus" @click="onShow">自项目产品添加</el-button>
+    <el-drawer
+        title="自项目产品添加"
+        :visible.sync="dialogProductVisible"
+        append-to-body
+        size="80%"
+        :show-close="false"
+        direction="rtl"
+        @close="onColes">
+      <div class="drawer__panel">
+        <div class="flex-align-center flex-between ">
+          <slot name="operation"></slot>
+          <div class="flex-align-center">
+            <el-input size="small"  suffix-icon="el-icon-search" v-model="params.content.where.condition" placeholder="产品名称,编号" @keyup.enter.native="productData(params.content.pageNumber = 1)" @clear="productData(params.content.pageNumber = 1)" clearable></el-input>&nbsp;
+          </div>
+          <div style="margin-top:-10px;margin-bottom: 10px;float: right">
+            <el-button style="float: right" type="primary" size="mini" @click="batchSelect" :disabled="tableSelectData.length === 0 ">批量添加</el-button>
+          </div>
+        </div>
+        <div class="container">
+          <selectClass @brandChange="brandChange" @onClassChange="onClassChange" @Search="Search" @clearSearch="clearSearch" @clickStandard="clickStandard" @clickField="clickField" :default="true"></selectClass>
+        </div>
+        <div class="produtMag-panel">
+          <el-table
+              ref="multipleTable"
+              :data="list"
+              style="width: 100%"
+              :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="42"
+                fixed>
+            </el-table-column>
+            <el-table-column
+                align="center"
+                label="产品图"
+                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>
+                </div>
+              </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
+                label="型号/规格"
+                width="180">
+              <template slot-scope="scope">
+                <p><span>{{scope.row.model}}</span>&nbsp;/&nbsp;<span>{{scope.row.spec}}</span></p>
+              </template>
+            </el-table-column>
+            <el-table-column
+                prop="caliber"
+                label="口径"
+                width="180">
+            </el-table-column>
+            <el-table-column
+                prop="pressure"
+                label="压力"
+                width="180">
+            </el-table-column>
+            <el-table-column
+                prop="material"
+                label="材质"
+                width="180">
+            </el-table-column>
+            <el-table-column
+                prop="brand"
+                label="品牌"
+                width="180">
+              <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="0">
+              <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="marketprice"
+                label="牌价(元)"
+                fixed="right"
+                width="100">
+              <template slot-scope="scope">
+                  <span >{{scope.row.marketprice?scope.row.marketprice:'--'}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column
+                prop="totalPrice"
+                fixed="right"
+                label="操作"
+                width="80">
+              <template slot-scope="scope">
+                <el-button type="text" @click="onSelect(scope.row)">添 加</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <div>
+            <div style="float: left">已选:{{selectTotal}}个商品</div>
+            <div style="margin-top:16px;text-align:right">
+              <el-pagination
+                  background
+                  small
+                  @size-change="handleSizeChange"
+                  @current-change="handleCurrentChange"
+                  :current-page="currentPage"
+                  :page-size="params.content.pageSize"
+                  layout="total, prev, pager, next, jumper"
+                  :total="total">
+              </el-pagination>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="onColes" class="normal-btn-width">取 消</el-button>
+<!--        <el-button size="small" type="primary" @click="onSubmit"  class="normal-btn-width">确 定</el-button>-->
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import uploadFile from "@/components/upload/hw_obs_upload";
+import previewImage from "@/components/previewImage";
+import selectClass from './Select'
+export default {
+  name: "productTable",
+  props:["id"],
+  components:{uploadFile, previewImage,selectClass},
+  data(){
+    return {
+      dialogProductVisible:false,
+      type:'',
+      tablecols:[],
+      list:[],
+      total:0,
+      currentPage:0,
+      tableSelectData:[],
+      selectData:[],
+      selectTotal:0,
+      sa_quotedpriceid:'',
+      params:{
+        "id": 20221020164903,
+        "version":1,
+        "content": {
+          "sa_projectid":'',
+          "sa_quotedpriceid":"",
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where": {
+            "condition": "",
+            "tradefield":"",
+            "itemclassid":"",
+            "sa_brandid":"",
+            "standards":""
+          }
+
+        }
+      },
+      timer:0
+    }
+  },
+  methods:{
+    onShow(){
+     /* this.dialogProjectVisible = true*/
+      this.$emit('checkFormProject','project')
+      /*this.productData()*/
+
+    },
+    onColes(){
+      this.dialogProductVisible = false
+    },
+    async onSubmit(){
+      console.log(this.selectData,"添加选择的商品")
+      const res = await this.$api.requested({
+        "id": 20221021095403,
+        "content": {
+          "sa_quotedpriceid":this.sa_quotedpriceid,     //sat_notice_classid<=0时 为新增
+          "items":this.selectData
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        /*this.dialogProductVisible = false*/
+        this.$emit('productAdd')
+        this.queryProduct(this.sa_quotedpriceid,this.type)
+        this.selectListData()
+      })
+    },
+    batchSelect(){
+      this.debounce(this.onSubmit,300)()
+    },
+    onSelect(val){
+      console.log(val,"选择的商品")
+      this.tableSelectData = []
+      this.tableSelectData[0] = val
+      let obj = this.tableSelectData.map(e=>{
+        return {
+          sa_quotedprice_itemsid:'0',
+          itemid:e.itemid,
+          oldprice:e.marketprice,
+          /*price:(e.marketprice * 100)/100,*/
+          price:e.price,
+          discountrate:e.discountrate,
+          qty:e.qty
+        }
+      })
+      this.selectData = obj
+      /*this.$nextTick(()=>{
+        this.onSubmit()
+      })*/
+      this.debounce(this.onSubmit,300)()
+    },
+    debounce (fn, wait) {
+      let that = this
+      return function () {
+        if (that.timer !== null) clearTimeout(that.timer)
+        that.timer = setTimeout(fn, wait)
+      }
+    },
+    /*获取产品信息*/
+    queryProduct(id,type){
+      this.dialogProductVisible = true
+      this.params.content.sa_projectid = this.id
+      this.type = type
+      this.sa_quotedpriceid = id
+      this.productData()
+    },
+    /*产品配置信息*/
+    async productData(){
+      this.params.content.sa_quotedpriceid = this.sa_quotedpriceid
+      const res = await this.$api.requested(this.params)
+      this.list = res.data
+      this.total = res.total
+      this.$nextTick(()=>{
+        if (this.type === '项目报价'){
+          for (let i=0;i<this.list.length;i++){
+            this.$refs.multipleTable.toggleRowSelection(this.list[i],true)
+          }
+        }
+      })
+    },
+    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.tableSelectData = []
+      this.tableSelectData = val
+      if (this.type === '项目报价'){
+        let obj = this.tableSelectData.map(e=>{
+          return {
+            sa_quotedprice_itemsid:'0',
+            itemid:e.itemid,
+            oldprice:e.marketprice,
+            /*price:(e.marketprice * 100)/100,*/
+            price:e.price,
+            discountrate:e.discountrate,
+            qty:e.qty
+          }
+        })
+        this.selectData = obj
+      }else {
+        let obj = this.tableSelectData.map(e=>{
+          return {
+            sa_quotedprice_itemsid:'0',
+            itemid:e.itemid,
+            oldprice:e.marketprice,
+            /*price:(e.marketprice * 100)/100,*/
+            price:e.price,
+            discountrate:e.discountrate,
+            qty:e.qty
+          }
+        })
+        this.selectData = obj
+      }
+    },
+    /*已选产品数据*/
+    async selectListData(){
+      const res = await this.$api.requested({
+        "id": 20221021095503,
+        "content": {
+          "sa_quotedpriceid":this.sa_quotedpriceid     //sat_notice_classid<=0时 为新增
+        }
+      })
+      console.log(res,"已选产品123456")
+      this.selectTotal = res.total
+      console.log(res.total,"已选产品数量")
+    },
+
+    brandChange(id) {
+      this.brandId = id
+      this.queryProduct(this.sa_quotedpriceid,this.type)
+    },
+    onClassChange (n) {
+      this.params.content.where.itemclassid = n.itemclassid
+      this.queryProduct(this.sa_quotedpriceid,this.type)
+    },
+    Search(data) {
+      this.params.content.where.condition = data
+      this.params.content.pageNumber = 1
+      this.queryProduct(this.sa_quotedpriceid,this.type)
+    },
+    clearSearch() {
+      this.params.content.where.condition = ''
+      this.params.content.pageNumber = 1
+      this.queryProduct(this.sa_quotedpriceid,this.type)
+    },
+    clickField (item) {
+      console.log(item,'clickField')
+      this.params.content.where.tradefield = item.value
+      this.queryProduct(this.sa_quotedpriceid,this.type)
+    },
+    clickStandard (item){
+      this.params.content.where.standards = item.value
+      this.queryProduct(this.sa_quotedpriceid,this.type)
+    }
+  },
+  mounted() {
+  }
+}
+</script>
+
+<style scoped>
+.image {
+  width:38px;height:38px;margin:0px auto;
+}
+</style>

+ 3 - 3
src/SDrpManagement/QuotedPrice/detail/components/copyTo.vue

@@ -37,7 +37,7 @@ export default {
     async copyData(){
       const res = await this.$api.requested({
         "content": {
-          "sa_quotedpriceid":this.data
+          "sa_quotedpriceid":this.$route.query.id
         },
         "id": 20221209094103,
       })
@@ -48,9 +48,9 @@ export default {
       this.$store.dispatch('changeDetailDrawer',false)
       setTimeout(()=>{
         this.$router.replace({
-          path:'/quotedPriceCopy',
+          path:'/quotedPriceDetail',
           query:{
-            data:this.saQuotedPriceData
+            id:this.saQuotedPriceData.sa_quotedpriceid
           }
         })
         this.$store.dispatch('changeDetailDrawer',true)

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

@@ -12,7 +12,7 @@
         ownertable="sa_quotedprice"
         :statusCheck="[{key:'status',value:'审核'},{key:'status',value:'提交'}]"
         :tags="[]"
-        :tabs="['产品清单','详细信息','其他费用','历史报价']"
+        :tabs="['产品明细折扣','详细信息','其他费用','历史报价']"
         @pageChange="pageChange"
         @onEditSuccess="queryMainData($route.query.id)">
       <div slot="tags">

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

@@ -4,6 +4,7 @@
       <el-input
           size="small"
           style="width: 200px;"
+          class="inline-16"
           suffix-icon="el-icon-search"
           v-model="param.content.where.condition"
           placeholder="产品名称,编号"
@@ -12,6 +13,8 @@
           clearable>
       </el-input>&nbsp;
 <!--      <product_table style="float: right" :data="data"  ref="quoterPrice" @productAdd="productInitialization" ></product_table>-->
+      <productTableProject :sa_projectid="data.sa_projectid" :type="data.quotedpricetype" class="inline-16" @productAdd="productData"></productTableProject>
+      <productTable class="inline-16" @productAdd="productData"></productTable>
     </div>
     <div class="produtMag-panel">
       <el-table
@@ -110,10 +113,12 @@
         <el-table-column
             prop="num"
             label="数量"
-            width="80"
+            width="150"
             fixed="right">
           <template slot-scope="scope">
-            <p><span>{{scope.row.qty}}</span></p>
+            <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
@@ -131,13 +136,15 @@
             width="80"
             fixed="right">
           <template slot-scope="scope">
-            <div v-if="scope.row.discountDifferenceAmount > 0">
+            <div v-if="scope.row.discountDifferenceAmount > 0 && !saveShow && index !== scope.row.rowIndex">
               <p><span :style="[setTopColor]">{{scope.row.discountrate}}</span></p>
             </div>
-            <div v-else-if="scope.row.discountDifferenceAmount < 0" >
+            <div v-else-if="scope.row.discountDifferenceAmount < 0 && !saveShow && index !== scope.row.rowIndex">
               <p><span :style="[setDownColor]">{{scope.row.discountrate}}</span></p>
             </div>
-
+            <span v-else>
+              <el-input v-model="scope.row.discountrate" size="mini" placeholder="请输入折扣" @change="onChangeDiscountrate(scope.row.discountrate,scope.row,scope.$index)"></el-input>
+            </span>
           </template>
         </el-table-column>
         <el-table-column
@@ -155,12 +162,15 @@
             width="80"
             fixed="right">
           <template slot-scope="scope">
-            <div v-if="scope.row.discountDifferenceAmount > 0">
+            <div v-if="scope.row.discountDifferenceAmount > 0 && !saveShow && index !== scope.row.rowIndex">
               <p><span :style="[setTopColor]">{{scope.row.price}}</span></p>
             </div>
-            <div v-else-if="scope.row.discountDifferenceAmount < 0" >
+            <div v-else-if="scope.row.discountDifferenceAmount < 0 && !saveShow && index !== scope.row.rowIndex" >
               <p><span :style="[setDownColor]">{{scope.row.price}}</span></p>
             </div>
+            <span v-else>
+              <el-input v-model="scope.row.price" size="mini" placeholder="请输入单价" @change="onChangePrice(scope.row.price,scope.row,scope.$index)"></el-input>
+            </span>
           </template>
         </el-table-column>
         <el-table-column
@@ -191,15 +201,23 @@
             <p v-else>--</p>
           </template>
         </el-table-column>
-<!--        <el-table-column
+        <el-table-column
             prop="operation"
             fixed="right"
             label="操作"
-            width="100">
+            width="120">
           <template slot-scope="scope">
-            <el-button size="mini" type="text" @click="deleteProduct(scope.row)">删除</el-button>
+            <el-button  size="mini" type="text" class="inline-16" @click="onEdit(scope.row)" v-if="!saveShow">编 辑</el-button>
+            <el-popconfirm
+                title="确定删除该产品嘛?"
+                @confirm="deleteProduct(scope.row)"
+            >
+              <el-button class="inline-16" slot="reference" size="mini" type="text" v-if="!saveShow">删 除</el-button>
+            </el-popconfirm>
+            <el-button  size="mini" type="text" class="inline-16" @click="onSave(scope.row)" v-if="saveShow">保 存</el-button>
+            <el-button  size="mini" type="text" class="inline-16" @click="saveShow = false;index = ''" v-if="saveShow">取 消</el-button>
           </template>
-        </el-table-column>-->
+        </el-table-column>
       </el-table>
       <div style="height: 35px;margin-top: 20px">
         <div style="float: left">总金额(元):{{ totalPrice }}</div>
@@ -226,11 +244,12 @@
 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";
 export default {
   props:["data"],
   name: "productInventory",
-  components:{uploadFile, previewImage,product_table},
+  components:{uploadFile, previewImage,product_table,productTableProject,productTable},
   data(){
     return {
       tablecols:[],
@@ -239,6 +258,8 @@ export default {
       currentPage:0,
       changeList:[],
       totalPrice:0,
+      saveShow:false,
+      index:'',
       setTopColor:{
         color:'#79da56'
       },
@@ -263,7 +284,7 @@ export default {
   methods:{
     /*产品配置信息*/
     async productData(){
-      this.param.content.sa_quotedpriceid = this.data.sa_quotedpriceid
+      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
@@ -275,7 +296,10 @@ export default {
         this.list[i].discountDifferenceAmount = Math.round(res.data[i].discountDifferenceAmount * 100)/100
        /* this.totalPrice = this.totalPrice + res.data[i].qty * res.data[i].price*/
       }
-      this.totalPrice = Math.round(res.data[0].rowstotal[0].sumamount * 100)/100
+      if (this.total !== 0){
+        this.totalPrice = Math.round(res.data[0].rowstotal[0].sumamount * 100)/100
+      }
+
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
@@ -309,13 +333,91 @@ export default {
     async deleteProduct(val){
       const res = await this.$api.requested({
         "id": 20221021095603,
-        "version":1,
         "content": {
           "sa_quotedprice_itemsids":[val.sa_quotedprice_itemsid]     //sat_notice_classid<=0时 为新增
         }
       })
       this.tool.showMessage(res,()=>{
-        this.productData(val.sa_quotedpriceid)
+        this.productData()
+      })
+    },
+    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){
+      console.log(row,'进行编辑')
+      this.saveShow = true
+      this.index = row.rowIndex
+    },
+    async onSave(row){
+      console.log(row,'进行保存')
+      row.discountrate = row.discountrate / 100
+      const res = await this.$api.requested({
+        "id": 20221021095403,
+        "content": {
+          "sa_quotedpriceid":459,     //sat_notice_classid<=0时 为新增
+          "items":[row]
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.saveShow = false
+        this.index = ''
+        this.productData()
       })
     }
   },

+ 37 - 20
src/SDrpManagement/QuotedPrice/modules/ProjectQuotationAdd.vue

@@ -3,7 +3,7 @@
     <el-drawer
         :title="title"
         :visible.sync="drawer"
-        size="93%"
+        size="600px"
         direction="rtl"
         append-to-body
         :show-close="false"
@@ -11,17 +11,17 @@
       <div class="drawer__panel" style="margin-bottom: 0px">
         <el-row style="margin-top: 10px" :gutter="10">
           <el-form :model="form" :rules="rules" ref="form"  size="mini" label-position="right">
-            <el-col :span="8">
+            <el-col :span="24">
               <el-form-item label="报价类型:" label-width="100px" >
                 <el-input v-model="form.type" autocomplete="off" placeholder="报价类型" disabled></el-input>
               </el-form-item>
             </el-col>
-            <el-col  :span="8">
+<!--            <el-col  :span="24">
               <el-form-item label="是否特价:" label-width="100px" >
                 <el-input  v-model="form.specialOffer" autocomplete="off" placeholder="是否特价" disabled></el-input>
               </el-form-item>
-            </el-col>
-            <el-col  :span="8" v-if="isQuotedPrice">
+            </el-col>-->
+            <el-col  :span="24" v-if="isQuotedPrice">
               <el-form-item label="项目名称:" label-width="100px" prop="projectname">
                 <el-popover
                     placement="bottom"
@@ -79,12 +79,12 @@
 
               </el-form-item>
             </el-col>
-            <el-col  :span="8" v-if="isQuotedPrice">
+            <el-col  :span="24" v-if="isQuotedPrice">
               <el-form-item label="项目编号:" label-width="100px" >
                 <el-input  v-model="form.projectnum" autocomplete="off" placeholder="项目编号" disabled></el-input>
               </el-form-item>
             </el-col>
-            <el-col  :span="8">
+            <el-col  :span="24">
               <el-form-item label="客户名称:" label-width="100px" prop="enterprisename">
                 <el-popover
                     placement="bottom"
@@ -141,12 +141,12 @@
                 </el-popover>
               </el-form-item>
             </el-col>
-            <el-col  :span="8">
+            <el-col  :span="24">
               <el-form-item label="电话:" label-width="100px" >
                 <el-input  v-model="form.telephone" autocomplete="off" placeholder="输入电话" disabled></el-input>
               </el-form-item>
             </el-col>
-            <el-col  :span="8">
+            <el-col  :span="24">
               <el-form-item label="联系人:" label-width="100px" prop="name">
                 <el-popover
                     placement="bottom"
@@ -210,12 +210,12 @@
                 </el-popover>
               </el-form-item>
             </el-col>
-            <el-col  :span="8">
+            <el-col  :span="24">
               <el-form-item label="联系人手机号:" label-width="100px" >
                 <el-input  v-model="form.phonenumber" autocomplete="off" placeholder="手机号" disabled></el-input>
               </el-form-item>
             </el-col>
-            <el-col   :span="8">
+            <el-col   :span="24">
               <el-form-item label="报价日期:" label-width="100px">
                 <el-date-picker
                     v-model="form.billdate"
@@ -227,7 +227,7 @@
                 </el-date-picker>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+            <el-col :span="24">
               <el-form-item label="有效期:" label-width="100px" prop="date">
                 <el-date-picker
                     v-model="form.date"
@@ -241,7 +241,7 @@
                 </el-date-picker>
               </el-form-item>
             </el-col>
-            <el-col  :span="8" >
+            <el-col  :span="24" >
               <el-form-item label="产品系列:" label-width="100px" prop="itemtype">
                 <el-select
                     ref="sle"
@@ -263,7 +263,12 @@
                 </el-select>
               </el-form-item>
             </el-col>
-            <el-col  :span="8">
+            <el-col  :span="24">
+              <el-form-item label="折扣:" label-width="100px" prop="discountrate">
+                <el-input  v-model="form.discountrate" autocomplete="off" placeholder="请输入折扣" type="textarea" autosize></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col  :span="24">
               <el-form-item label="备注:" label-width="100px" prop="remarks">
                 <el-input  v-model="form.remarks" autocomplete="off" placeholder="请输入备注信息" type="textarea" autosize></el-input>
               </el-form-item>
@@ -271,15 +276,15 @@
           </el-form>
         </el-row>
       </div>
-      <div >
+<!--      <div >
         <el-divider></el-divider>
       </div>
       <div style="margin:20px 20px 20px 20px">
         <quoted_price_product :sa_projectid="form.sa_projectid" :type="form.type" ref="quoterPrice" @checkFormImport="onCheckFormImport" @checkForm="onSubmit" @checkFormProject="onSubmit" @productData="productDataChange"></quoted_price_product>
-      </div>
+      </div>-->
       <div class="fixed__btn__panel">
         <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
-        <el-button :disabled="form.sa_quotedpriceid === 0" size="small" type="primary" @click="getSubmit" class="normal-btn-width">确 定</el-button>
+        <el-button  size="small" type="primary" @click="getSubmit" class="normal-btn-width">确 定</el-button>
       </div>
     </el-drawer>
   </div>
@@ -292,6 +297,13 @@ export default {
   props:["drawerShow","typeData"],
   components:{quoted_price_product},
   data(){
+    var discountrate = (rule,value,callback) =>{
+      if (this.form.discountrate < 0 || this.form.discountrate > 100){
+        callback(new Error('请输入0-100%'))
+      } else {
+        callback();
+      }
+    }
     return {
       search:'',
       title:'',
@@ -379,7 +391,7 @@ export default {
         sys_enterpriseid: "",
         contactsid:0,
         sa_projectid: "0",
-        discountrate: 0,
+        discountrate: '',
         remarks: "",
         invaliddate: "",
         projectname: "",
@@ -406,6 +418,9 @@ export default {
         itemtype:[
           { required: true, message: '请选择产品系列', trigger: 'change'},
         ],
+        discountrate:[
+          { required: false, validator: discountrate, trigger: 'change'},
+        ],
         /*name:[
           { required: true, message: '请选择联系人', trigger: 'change'},
         ]*/
@@ -467,7 +482,6 @@ export default {
     },
     /*提交*/
     getSubmit(){
-      this.drawer = false
       if (this.form.date.length === 0){
         this.form.begdate = ''
         this.form.enddate = ''
@@ -476,14 +490,17 @@ export default {
         this.form.enddate = this.form.date[1]
         this.form.quotedpricenotes[1] = "2、报价有限期" + this.form.begdate + "至" + this.form.enddate
       }
+
       this.$refs.form.validate(async (valid) => {
         if (!valid) return false
+        this.form.discountrate = this.form.discountrate / 100
         const res = await this.$api.requested({
           "id": 20221020164803,
           "content": this.form
         })
         this.tool.showMessage(res,() => {
-          this.changeData(this.productObj)
+          this.drawer = false
+          this.$emit('addSuccess')
         })
       })
     },

+ 3 - 0
src/template/selectSaler/index.vue

@@ -111,6 +111,9 @@ export default {
       this.listData()
     }
   },
+  mounted() {
+    this.listData()
+  },
   created () {
     this.listData()
   },