Procházet zdrojové kódy

凭证、业务员管理、报价单、项目商机调整

qymljy před 2 roky
rodič
revize
74bfa51f89

+ 12 - 2
src/Form/marketing2/saler/add.vue

@@ -11,7 +11,7 @@
         @close="dialogVisible = false">
       <div class="drawer__panel">
         <el-row>
-          <el-form :model="form"  :rules="rules" ref="form" label-position="right" label-width="110px" size="small">
+          <el-form :model="form"  :rules="rules" ref="form" label-position="right" label-width="125px" size="small">
             <el-col :span="24">
               <el-form-item label="业务员:" prop="hrid">
                 <selectMenber  @selectMenber="selectMenber"></selectMenber>
@@ -48,7 +48,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="24">
-              <el-form-item  label="最低授权折扣:" prop="discountrate">
+              <el-form-item  label="最低授权折扣:" prop="discountrate">
                 <el-input  v-model="form.discountrate" placeholder="最低授权折扣" ></el-input>
               </el-form-item>
             </el-col>
@@ -56,6 +56,7 @@
         </el-row>
       </div>
       <div class="fixed__btn__panel">
+<!--        <el-button size="small"  @click="onClose" class="normal-btn-width">取 消</el-button>-->
         <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
       </div>
     </el-drawer>
@@ -111,6 +112,7 @@ export default {
     onSubmit () {
       console.log(this.dataToForm)
       this.form.sa_saleareaid = this.dataToForm.sa_saleareaid
+      this.form.discountrate = (this.form.discountrate /100).toFixed(4)
       console.log(this.form)
       this.$refs['form'].validate((valid) => {
         if (!valid) return false
@@ -145,6 +147,14 @@ export default {
     selectMenber (data) {
       console.log(data)
       this.form = Object.assign({},this.form,data)
+    },
+    onClose(){
+      this.dialogVisible = false
+      this.form = {
+        "sa_saleareaid":'',
+        "hrid":'',
+        "discountrate":''
+      }
     }
   },
   created () {

+ 18 - 5
src/Form/marketing2/saler/edit.vue

@@ -11,7 +11,7 @@
         @close="dialogVisible = false">
       <div class="drawer__panel">
         <el-row>
-          <el-form :model="form"  :rules="rules" ref="form" label-position="right" label-width="110px" size="small" disabled>
+          <el-form :model="form"  :rules="rules" ref="form" label-position="right" label-width="125px" size="small" disabled>
             <el-col :span="24" >
               <el-form-item label="业务员:" prop="hrid" >
                 <selectMenber ref="salerName"  @selectMenber="selectMenbers" ></selectMenber>
@@ -48,10 +48,10 @@
               </el-form-item>
             </el-col>
           </el-form>
-          <el-form :model="form"  :rules="rules" ref="form" label-position="right" label-width="110px" size="small">
+          <el-form :model="form"  :rules="rules" ref="form" label-position="right" label-width="125px" size="small">
             <el-col :span="24">
-              <el-form-item  label="最低授权折扣:" prop="discountrate">
-                <el-input  v-model="form.discountrate" placeholder="最低授权折扣" ></el-input>
+              <el-form-item  label="最低授权折扣:" prop="discountrate">
+                <el-input  v-model="form.discountrate" placeholder="最低授权折扣" ></el-input>
               </el-form-item>
             </el-col>
           </el-form>
@@ -89,7 +89,8 @@ export default {
   },
   methods:{
     onShow(){
-      this.form = this.data
+      this.form = Object.assign({},this.form,this.data)
+      this.form.discountrate = this.form.discountrate * 100
       this.$nextTick(() => {
         console.log(this.$refs)
         this.$refs.salerName.value.name = this.data.name
@@ -101,7 +102,19 @@ export default {
       this.form = Object.assign({},this.form,data)
     },
     onSubmit(){
+      this.form.discountrate = (this.form.discountrate/100).toFixed(4)
       console.log(this.form)
+      this.$refs.form.validate(async(valid) =>{
+        if (!valid) return false
+        const res = await this.$api.requested({
+          "id": 20221011144703,
+          "content": this.form
+        })
+        this.tool.showMessage(res,()=>{
+          this.dialogVisible = false
+          this.$emit('onSuccess')
+        })
+      })
     }
   }
 }

+ 6 - 0
src/Form/projectChange/add.vue

@@ -79,6 +79,7 @@
                     v-model="form.signdate_due"
                     type="month"
                     placeholder="选择月"
+                    :picker-options="pickerOptions"
                 >
                 </el-date-picker>
               </el-form-item>
@@ -101,6 +102,11 @@ export default {
   components:{},
   data(){
     return {
+      pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() < Date.now();
+        }
+      },
       dialogFormVisible:false,
       projectAddress:[],
       form:{

+ 31 - 28
src/HDrpManagement/payvoucher/index.vue

@@ -10,29 +10,38 @@
         :detailPath="{
         path:'/payvoucherDetails'
         }">
-      <div slot="custom" style="display:flex">
-        <label class="search__label " style="margin: auto;width: 70px;">账户类型:</label>
-        <el-select style="margin-right: 24px !important;" class="inline-16" @change="selectChange" v-model="selectParam.accountname" placeholder="请选择账户类型" size="small" clearable>
-          <el-option v-for="(item,index) in accountNameList" :key="index" :value="item.accountname" :label="item.accountname"></el-option>
-        </el-select>
-        <label class="search__label " style="margin: auto;width: 35px;">状态:</label>
-        <el-select  class="inline-24" @change="selectChange" v-model="selectParam.status" placeholder="请选择状态" size="small" clearable>
-          <el-option v-for="(item,index) in statusData" :key="item.value" :value="item.value" :label="item.label"></el-option>
-        </el-select>
-        <label class="search__label" style="margin: auto;width: 65px;">单据日期:</label>
-        <el-date-picker
-            style="margin-right: 24px !important;"
-            size="small"
-            @change="selectChange"
-            value-format="yyyy-MM-dd"
-            v-model="dateSelect"
-            type="daterange"
-            range-separator="至"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
-            clearable>
-        </el-date-picker>
+      <div slot="titleRight">
+        <!--        <importExcel style="margin-left:10px" @onSuccess="onSuccess"></importExcel>-->
       </div>
+      <template #custom >
+        <div class="mt-10">
+          <label class="search__label" >账户类型:</label>
+          <el-select  class="inline-24" @change="selectChange" v-model="selectParam.accountname" placeholder="请选择账户类型" size="small" clearable>
+            <el-option v-for="(item,index) in accountNameList" :key="index" :value="item.accountname" :label="item.accountname"></el-option>
+          </el-select>
+        </div>
+        <div class="mt-10">
+          <label class="search__label" >状态:</label>
+          <el-select  class="inline-24" @change="selectChange" v-model="selectParam.status" placeholder="请选择状态" size="small" clearable>
+            <el-option v-for="(item,index) in statusData" :key="item.value" :value="item.value" :label="item.label"></el-option>
+          </el-select>
+        </div>
+        <div class="mt-10">
+          <label class="search__label" >单据日期:</label>
+          <el-date-picker
+              style="margin-right: 24px !important;"
+              size="small"
+              @change="selectChange"
+              value-format="yyyy-MM-dd"
+              v-model="dateSelect"
+              type="daterange"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              clearable>
+          </el-date-picker>
+        </div>
+      </template>
       <template v-slot:tbList="scope">
         <div>
           {{scope.data.column.data[[scope.data.column.columnname]]}}
@@ -117,10 +126,4 @@ export default {
 </script>
 
 <style scoped>
-.search__label{
-  display: inline-block;
-  width: 80px;
-  font-size: 14px;
-  color:rgb(163, 163, 163) !important;
-}
 </style>

+ 65 - 4
src/HDrpManagement/projectChange/modules/detail.vue

@@ -43,6 +43,22 @@
         />
       </div>
     </div>
+    <template #customBefore>
+      <div class="container normal-panel sticky" style="margin-bottom: 10px;border-radius: 5px;height: 32px">
+        <div v-for="item in stageList" :key="item.stagename" >
+          <div class="stage__panel normal-panel"  v-if="item.rowindex === selectRowindex" :style="selectColor">
+            <div style="transform: skewX(20deg);!important;color: #ffffff">{{item.stagename}}</div>
+          </div>
+          <div class="stage__panel normal-panel"  v-else :style="unselectColor">
+            <div style="transform: skewX(20deg);!important;color: #000000" @click="changeSelect(item)">{{item.stagename}}</div>
+          </div>
+        </div>
+        <div style="float: right;margin-right:15px;">
+          <el-button size="mini" type="primary" plain>进入阶段</el-button>
+        </div>
+      </div>
+
+    </template>
     <div slot="slot0" class=" normal-panel">
       <BaseInfo v-if="detailInfo" :detailInfo="detailInfo"/>
     </div>
@@ -55,8 +71,8 @@
     <div slot="slot3" class=" normal-panel" >
       <product_set :data="mainData"  v-if="flag === 1"  />
     </div>
-    <div slot="slot4" class=" normal-panel">
-      <quotation />
+    <div slot="slot4" class="normal-panel" >
+      <quotation :data="mainData" v-if="flag === 1" />
     </div>
     <div slot="slot5" class=" normal-panel">
       <Rival v-if="mainData" :data="mainData" />
@@ -98,7 +114,15 @@ export default {
       detailInfo:'',
       tagObj:'',
       putPeople:'',
-      userInfo:''
+      userInfo:'',
+      stageList:[],
+      selectRowindex:'',
+      selectColor:{
+        background: '#3874F6'
+      },
+      unselectColor:{
+        background: '#EEEEEE'
+      },
     }
   },
   provide () {
@@ -130,6 +154,7 @@ export default {
       this.tagObj = await this.$store.dispatch('queryTagList',{table:'sa_project',id:this.mainData.sa_projectid})
       this.flag = 1
       this.getProjectAddres()
+      this.projectStage()
     },
     // 监听切换数据,上一页,下一页
     pageChange (id,rowindex) {
@@ -338,6 +363,27 @@ export default {
           value: this.mainData.name
         },
       ]
+    },
+    /*获取项目阶段*/
+    async projectStage(){
+      const res = await this.$api.requested({
+        "id": 20221024102402,
+        "content": {
+          "sa_projectid":this.mainData.sa_projectid
+        }
+      })
+      console.log(res,"当前项目阶段")
+      this.stageList = res.data
+      res.data.forEach((e)=>{
+        if (e.active === 1){
+          this.selectRowindex = e.rowindex
+        }
+      })
+    },
+    /*切换阶段*/
+    changeSelect(val){
+      console.log(val)
+      this.selectRowindex = val.rowindex
     }
   },
   mounted () {
@@ -355,5 +401,20 @@ export default {
 }
 
 </script>
-<style>
+<style scoped>
+.stage__panel{
+  height: 32px;
+  line-height: 32px;
+  width:85px;
+  border-radius: 2px;
+  transform: skewX(-20deg);
+  margin-left:15px;
+  text-align: center;
+  cursor: pointer;
+  float: left;
+  background: #EEEEEE;
+}
+.stage__panel > div {
+  transform: skewX(45deg);
+}
 </style>

+ 10 - 6
src/HDrpManagement/projectChange/modules/modules/quotation/index.vue

@@ -54,11 +54,13 @@ export default {
       currentPage:0,
       search:'',
       params:{
-        "id": 20221020165103,
-        "version":1,
+        "id": 20221124190702,
         "content": {
-          "where":{
-            "status":""
+          "sa_projectid": 1,
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where": {
+            "condition": ""
           }
         }
       },
@@ -125,11 +127,12 @@ export default {
       this.productList = res.data
     },
     async listData(){
+      console.log(this.data,'项目商机')
       this.params.content.sa_projectid = this.data.sa_projectid
       const res = await this.$api.requested(this.params)
       this.list = res.data
       this.total = res.total
-      console.log(this.list)
+      console.log(this.list,"报价单")
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
@@ -153,7 +156,8 @@ export default {
     }
   },
   created() {
-    this.getProductList()
+    /*this.getProductList()*/
+    this.listData()
     this.tablecols = this.tool.tabelCol(this.$route.name).quotationTable.tablecols
   }
 }

+ 1 - 1
src/HManagement/marketing2/saler/area/detail/index.vue

@@ -87,7 +87,7 @@ export default {
         },
         {
           label:'最低权限折扣率',
-          value:this.mainData.discountrate
+          value:this.mainData.discountrate*100
         }
       ]
     },

+ 4 - 1
src/HManagement/marketing2/saler/index.vue

@@ -17,7 +17,10 @@
         }">
         <div slot="custom"></div>
         <template v-slot:tbList="scope">
-          <div>
+          <div v-if="scope.data.column.columnname === 'discountrate'">
+            {{scope.data.column.data.discountrate*100}}
+          </div>
+          <div v-else>
             {{scope.data.column.data[[scope.data.column.columnname]]?scope.data.column.data[[scope.data.column.columnname]]:'--'}}
           </div>
         </template>

+ 205 - 0
src/SDrpManagement/QuotedPrice/components/edit/importQuotedPrice.vue

@@ -0,0 +1,205 @@
+<template>
+  <div>
+    <!-- 按钮类型 -->
+    <el-button type="success" size="small" @click="dialogUploadVisible = true" icon="el-icon-upload">导 入</el-button>
+    <el-dialog class="import-panel" :visible.sync="dialogUploadVisible" width="500px" append-to-body :close-on-click-modal="false" :show-close="false" :before-close="clearFiles">
+      <div style="padding:20px">
+        <el-upload
+          style="width:100%"
+          ref="my-upload"
+          class="upload-demo normal-margin"
+          accept=".xls,.xlsx"
+          action="#"
+          :auto-upload="false"
+          :show-file-list="false"
+          :on-change="handleChange"
+          drag
+          multiple>
+          <i class="el-icon-upload"></i>
+          <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        </el-upload>
+        <div class="progress_panel" v-for="file in filelist" :key="file.uid">
+          <img v-if="file.type === 'DOC' || file.type === 'DOCX'" width="30" src="@/assets/file_icons/word.png"
+            alt="">
+          <img v-else-if="file.type === 'PDF'" width="30" src="@/assets/file_icons/PDF.png" alt="">
+          <img v-else-if="file.type === 'MP4' || file.type === 'AVI'" width="30" src="@/assets/file_icons/video.png"
+            alt="">
+          <img v-else-if="file.type === 'XLS' || file.type === 'XLSX'" width="30" src="@/assets/file_icons/excel.png"
+            alt="">
+          <img v-else-if="file.type === 'PNG' || file.type === 'JPG'|| file.type === 'JPEG'" width="30"
+            src="@/assets/file_icons/image.png" alt="">
+          <img v-else-if="file.type === 'PPT' || file.type === 'PPTX'" width="30" src="@/assets/file_icons/PPT.png"
+            alt="">
+          <img v-else width="30" src="@/assets/file_icons/unknow.png" alt="">
+          <div>
+            <p v-if="file.progress === 100" style="float:right"><span style="color:#67C23A">●</span>上传成功</p>
+            <p>{{file.raw?file.raw.name:'暂无上传文件'}}</p>
+            <el-progress :percentage="file.progress" :show-text="false"></el-progress>
+          </div>
+        </div>
+        <slot name="errorFile"></slot>
+        <p class="tips">• 为保证数据导入顺利,推荐您下载并使用<a :href="modelurl">《Excel标准模板》</a></p>
+        <p class="tips">• 文件中数据不能超过5000行</p>
+        <div class="dialog-footer">
+          <el-button size="small" @click="dialogUploadVisible = false" class="normal-btn-width">取 消</el-button>
+          <el-button size="small" type="warning" @click="dialogUploadVisible = false" class="normal-btn-width btn-warning">确 定</el-button>
+        </div>
+      </div>
+      
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  /*
+    folderid:文件夹id; 必填
+    btntype:展示上传按钮的类型;
+    accept:限制上传文件类型;
+    bindData:附件上传成功后对应需要绑定的数据信息
+  */
+  props:["sa_quotedpriceid"],
+  data () {
+    return {
+      folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
+      dialogUploadVisible: false,
+      params: {
+        "classname": "system.attachment.huawei.OBS",
+        "method": "getFileName",
+        "content": {
+          "filename": '',
+          "filetype": '',
+          "parentid": ""//归属文件夹ID
+        }
+      },
+      file: {},
+      filelist: [],
+      CampaignList:[],
+      activeName:'first',
+      modelurl:'',
+      campaignid:''
+
+    }
+  },
+  mounted () {
+    this.getModelUrl()
+  },
+  methods: {
+    handleChange (file, filelist) {
+      this.filelist = filelist
+      var index = file.raw.name.lastIndexOf(".");
+      var ext = file.name.substr(index + 1);
+      this.params.content.filename = file.raw.name
+      this.params.content.filetype = ext
+      this.getUploadUrl(file, ext)
+    },
+    handleClick () {
+      this.getModelUrl()
+    },
+    // 获取导入模板
+    async getModelUrl () {
+      const res = await this.$api.requested({
+        "id": "20221024141403",
+        "content":{}
+      })
+      this.modelurl = res.msg
+    },
+    // 获取华为云上传地址
+    async getUploadUrl (file, ext) {
+      this.params.content.parentid = this.folderid
+      const res = await this.$api.requested(this.params)
+      let url = res.data.uploadurl
+      let obsfilename = res.data.serialfilename
+
+      this.upoladFileToServer(url, file, ext, obsfilename)
+    },
+    // 上传到华为云
+    async upoladFileToServer (url, file, ext, obsfilename) {      
+      let THIS = this
+      let config = {
+        headers: ext === 'pdf' ? { 'Content-Type': 'application/pdf' } : { 'Content-Type': 'application/octet-stream' },
+        onUploadProgress: function (progressEvent) {
+          let percent = progressEvent.loaded / progressEvent.total * 100
+          THIS.filelist.forEach(e => {
+            if (e.uid === file.uid) {
+              THIS.$set(e, 'type', ext.toUpperCase());
+              THIS.$set(e, 'progress', percent);
+            }
+          })
+        },
+      }
+      const res = await this.$upload.hw_upload(url, file.raw, config)
+      this.createFileRecord(obsfilename)
+    },
+
+    // 上传成功以后生成附件记录
+    async createFileRecord (obsfilename) {
+      let obj = {
+         "serialfilename": obsfilename
+      }
+      obj = Object.assign({},obj)
+      let param = {
+        "classname": "system.attachment.huawei.OBS",
+        "method": "uploadSuccess",
+        "content":obj
+      }
+      const res = await this.$api.requested(param)
+      this.importData(res.data.attachmentids[0])
+    },
+    async importData (id) {
+      const res = await this.$api.requested({
+        "id": "20221024141503",
+        "content": {
+          "sa_quotedpriceid":this.sa_quotedpriceid,
+          "attachmentid": id
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.$emit('onSuccess')
+        this.clearFiles()
+      })
+    },
+    clearFiles () {
+      this.$refs['my-upload'].clearFiles()
+      this.filelist = []
+      this.dialogUploadVisible = false
+    }
+  }
+}
+
+</script>
+<style>
+.import-panel .el-dialog__header,.import-panel .el-dialog__body{
+  padding: 0 !important;
+}
+.upload-demo > div {
+  width: 100% !important;
+}
+.upload-demo .el-upload-dragger {
+  width: 100% !important;
+}
+</style>
+<style scoped>
+.progress_panel {
+  display: flex;
+  align-items: center;
+  padding: 10px;
+  margin: 10px 0;
+  border-radius: 5px;
+  transition: linear 0.2s all;
+}
+.progress_panel:hover {
+  box-shadow: 0px 0px 5px #ccc;
+}
+.progress_panel > div {
+  flex: 1;
+  padding: 0 10px;
+}
+.progress_panel > div > p {
+  line-height: 30px;
+}
+.tips{
+  line-height: 30px;
+}
+</style>
+

+ 5 - 33
src/SDrpManagement/QuotedPrice/components/edit/quotedPriceProduct.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <div >
+    <div style="padding-bottom: 40px">
       <el-input
           size="small"
           style="width: 200px;float: left"
@@ -12,7 +12,7 @@
           clearable>
       </el-input>
 
-<!--      <importExcel style="float: right" @onSuccess="onSuccess"></importExcel>-->
+      <importExcel style="float: right" v-if="quotedpricetype === '普通报价'" :sa_quotedpriceid="sa_quotedpriceid" @onSuccess="onSuccess"></importExcel>
       <productTable style="float: right;margin-right: 10px;margin-bottom: 10px" :id="sa_projectid" :sa_quotedpriceid="sa_quotedpriceid" :quotedpricetype="quotedpricetype"  ref="quoterPrice" @productAdd="productData"></productTable>
       <delProduct style="float: right;margin-right: 10px" :data="selectDel" @delSuccess="delSuccess"></delProduct>
     </div>
@@ -191,13 +191,13 @@
 import uploadFile from "@/components/upload/hw_obs_upload";
 import previewImage from "@/components/previewImage";
 import productTable from './productTable'
-/*import importExcel from '../modules/importQuotedPrice'*/
+import importExcel from './importQuotedPrice'
 import delProduct from "@/SDrpManagement/QuotedPrice/components/delProduct";
 
 export default {
   props:["sa_projectid","sa_quotedpriceid","quotedpricetype"],
   name: "quotedPriceProduct",
-  components:{uploadFile, previewImage,productTable,delProduct},
+  components:{uploadFile, previewImage,productTable,delProduct,importExcel},
   data(){
     return {
       selectDel:[],
@@ -224,21 +224,6 @@ export default {
     }
   },
   methods:{
-    /*/!*产品配置信息新增初始化*!/
-    async productInitialization(id){
-      this.param.content.sa_quotedpriceid = id
-      const res = await this.$api.requested(this.param)
-      this.list = res.data
-      this.total = res.total
-      this.totalPrice = 0
-
-      for (var i=0 ;i<this.list.length;i++){
-        this.list[i].discountrate = this.list[i].discountrate * 100
-        this.totalPrice = this.totalPrice + this.list[i].qty * this.list[i].price
-      }
-      this.$emit("queryTotalPrice",totalPrice)
-      console.log(this.list,totalPrice,'产品配置信息')
-    },*/
     /*产品配置信息*/
     async productData(){
       console.log(this.id,"配置信息")
@@ -255,19 +240,6 @@ export default {
       console.log(this.list,'产品配置信息')
       this.$emit('productData',this.list)
     },
-   /* /!*修改折扣或单价的时候刷新*!/
-    async productDiscountrateData(id){
-      this.param.content.sa_quotedpriceid = id
-      const res = await this.$api.requested(this.param)
-      this.list = res.data
-      this.total = res.total
-      this.totalPrice = 0
-      for (var i=0 ;i<this.list.length;i++){
-        this.list[i].discountrate = this.list[i].discountrate * 100
-        this.totalPrice = this.totalPrice + this.list[i].qty * this.list[i].price
-      }
-      console.log(this.list,'产品配置信息')
-    },*/
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
       this.param.content.pageSize = val
@@ -429,7 +401,7 @@ export default {
 
 <style scoped>
 .produtMag-panel{
-   margin-top: 15px;
+  margin-top: 15px;
   background: #fff;
   border-radius:5px;
 

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

@@ -12,7 +12,7 @@
           clearable>
       </el-input>
 
-<!--      <importExcel style="float: right" @onSuccess="onSuccess"></importExcel>-->
+      <importExcel style="float: right" @onSuccess="onSuccess" v-if="type === '普通报价'" ref="quoterImport" @checkForm="checkFormImport"></importExcel>
       <productTable style="float: right;margin-right: 10px;margin-bottom: 10px" :id="sa_projectid" @checkForm="checkForm" ref="quoterPrice" @productAdd="productData"></productTable>
       <delProduct style="float: right;margin-right: 10px" :data="selectDel" @delSuccess="delSuccess"></delProduct>
     </div>
@@ -195,7 +195,7 @@ import importExcel from '../modules/importQuotedPrice'
 import delProduct from "@/SDrpManagement/QuotedPrice/components/delProduct";
 
 export default {
-  props:["sa_projectid"],
+  props:["sa_projectid","type"],
   name: "quotedPriceProduct",
   components:{uploadFile, previewImage,productTable,importExcel,delProduct},
   data(){
@@ -304,6 +304,13 @@ export default {
     checkForm(){
       this.$emit('checkForm')
     },
+    checkFormImport(){
+      this.$emit('checkFormImport')
+    },
+    quoterImport(sa_quotedpriceid){
+      this.sa_quotedpriceid = sa_quotedpriceid
+      this.$refs.quoterImport.onImport(sa_quotedpriceid)
+    },
     quoterPrice(sa_quotedpriceid,type){
       this.sa_quotedpriceid = sa_quotedpriceid
       console.log(sa_quotedpriceid,"报价单id")

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

@@ -236,7 +236,7 @@
         <el-divider></el-divider>
       </div>
       <div style="margin:30px 20px 20px 20px">
-        <quoted_price_product :sa_projectid="form.sa_projectid" ref="quoterPrice" @checkForm="onSubmit" @productData="productDataChange"></quoted_price_product>
+        <quoted_price_product :sa_projectid="form.sa_projectid" :type="form.type" ref="quoterPrice" @checkFormImport="onCheckFormImport" @checkForm="onSubmit" @productData="productDataChange"></quoted_price_product>
       </div>
       <div class="fixed__btn__panel">
         <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
@@ -384,6 +384,28 @@ export default {
         this.form.sa_quotedpriceid = res.data.sa_quotedpriceid
       })
     },
+    /*导入创建报价单校验*/
+    onCheckFormImport(){
+      console.log(this.date)
+      if (this.date.length === 0){
+        this.form.begdate = ''
+        this.form.enddate = ''
+      }else {
+        this.form.begdate = this.date[0]
+        this.form.enddate = this.date[1]
+      }
+      console.log(this.form,"表单")
+      this.$refs.form.validate(async (valid) => {
+        if (!valid) return false
+        const res = await this.$api.requested({
+          "id": 20221020164803,
+          "version":1,
+          "content": this.form
+        })
+        this.$refs.quoterPrice.quoterImport(res.data.sa_quotedpriceid,this.form.type)
+        this.form.sa_quotedpriceid = res.data.sa_quotedpriceid
+      })
+    },
    /*提交*/
     getSubmit(){
       this.drawer = false

+ 11 - 3
src/SDrpManagement/QuotedPrice/modules/importQuotedPrice.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <!-- 按钮类型 -->
-    <el-button type="success" size="small" @click="dialogUploadVisible = true" icon="el-icon-upload">导 入</el-button>
+    <el-button type="success" size="small" @click="onshow" icon="el-icon-upload">导 入</el-button>
     <el-dialog class="import-panel" :visible.sync="dialogUploadVisible" width="500px" append-to-body :close-on-click-modal="false" :show-close="false" :before-close="clearFiles">
       <div style="padding:20px">
         <el-upload
@@ -77,7 +77,8 @@ export default {
       CampaignList:[],
       activeName:'first',
       modelurl:'',
-      campaignid:''
+      campaignid:'',
+      sa_quotedpriceid:''
 
     }
   },
@@ -150,7 +151,7 @@ export default {
       const res = await this.$api.requested({
         "id": "20221024141503",
         "content": {
-          "sa_quotedpriceid":"1",
+          "sa_quotedpriceid":this.sa_quotedpriceid,
           "attachmentid": id
         }
       })
@@ -163,6 +164,13 @@ export default {
       this.$refs['my-upload'].clearFiles()
       this.filelist = []
       this.dialogUploadVisible = false
+    },
+    onshow(){
+      this.$emit('checkForm')
+    },
+    onImport(sa_quotedpriceid){
+      this.sa_quotedpriceid = sa_quotedpriceid
+      this.dialogUploadVisible = true
     }
   }
 }