zhangqiOMG před 3 roky
rodič
revize
20370e1a33

+ 6 - 0
src/Form/marketing2/saler/add.vue

@@ -52,6 +52,12 @@
                 <el-input  v-model="form.discountrate" placeholder="请输入最低授权折扣" @change="discountrateChange(form.discountrate)"></el-input>
               </el-form-item>
             </el-col>
+            <el-col :span="24">
+              <el-form-item  prop="discountrate" label-width="132px">
+                <!-- <el-input  v-model="form.discountrate" placeholder="请输入最低授权折扣" @change="discountrateChange(form.discountrate)"></el-input> -->
+                <el-checkbox :true-label="1" :false-label="0" v-model="form.iseditprice">是否可编辑订单价格</el-checkbox>
+              </el-form-item>
+            </el-col>
           </el-form>
         </el-row>
       </div>

+ 6 - 1
src/Form/marketing2/saler/edit.vue

@@ -48,12 +48,17 @@
               </el-form-item>
             </el-col>
           </el-form>
-          <el-form :model="form"  :rules="rules" ref="form" label-position="right" label-width="132px" size="small">
+          <el-form :model="form"   :rules="rules" ref="form" label-position="right" label-width="132px" size="small">
             <el-col :span="15">
               <el-form-item  label="最低授权折扣(%):" prop="discountrate">
                 <el-input  v-model="form.discountrate" placeholder="请输入最低授权折扣" @change="discountrateChange(form.discountrate)"></el-input>
               </el-form-item>
             </el-col>
+            <el-col :span="24">
+              <el-form-item  prop="discountrate" label-width="132px">
+                <el-checkbox :true-label="1" :false-label="0" v-model="form.iseditprice">是否可编辑订单价格</el-checkbox>
+              </el-form-item>
+            </el-col>
           </el-form>
         </el-row>
       </div>

+ 5 - 4
src/HDrpManagement/dispatch/modules/productlist.vue

@@ -74,7 +74,7 @@
           label="数量"
           width="180">
         <template slot-scope="scope">
-          <el-input-number :controls="true" controls-position='right' :step-strictly="true" v-if="data.STATUS === '新建'" size="mini" v-model="scope.row.qty" :min="0" :max="scope.row.undeliqty" :step="scope.row.orderaddqty" label="输入数量" @change="rowChange(scope.row,scope.$index)"></el-input-number>
+          <el-input-number :controls="true" controls-position='right' :step-strictly="true" v-if="data.STATUS === '新建'" size="mini" v-model="scope.row.qty" :min="1" :max="scope.row.undeliqty" label="输入数量" @change="rowChange(scope.row,scope.$index)"></el-input-number>
           <span v-else>{{scope.row.qty}}</span>
         </template>
       </el-table-column>
@@ -248,7 +248,7 @@ export default {
     },
     rowChange(val,index){
       let that = this
-
+      this.$set(this.tableData,index,val)
       // // 防抖
       if(this.time !== null){
         clearTimeout(this.time);
@@ -262,9 +262,9 @@ export default {
             "remarks":val.remarks
           }]
         },()=>{
-          this.$set(this.tableData,index,val)
+          this.listData()
         })
-      },1000)
+      },500)
     },
     async updateOrder (val,fn) {
       const res  = await this.$api.requested({
@@ -273,6 +273,7 @@ export default {
       })
       this.$emit('onSuccess')
       res.code === 1?fn():""
+      
     },
   },
   mounted () {

+ 1 - 1
src/HDrpManagement/invoiceapp/detail/detail.vue

@@ -19,7 +19,7 @@
       <div slot="customOperation" >
         <el-button v-if="tool.checkAuth($route.name,'submit')" type="primary" size="mini" @click="submitInvoice" :disabled="mainData.status !== '新建' && mainData.status !== '提交'">{{mainData.status ==='新建'?'提交':'撤回'}}</el-button>
         <el-button v-if="tool.checkAuth($route.name,'check')" type="primary" size="mini" @click="checkInvoice" :disabled="mainData.status !== '提交' && mainData.status !== '审核'">{{mainData.status === '审核'?'反审核':'审核'}}</el-button>
-        <el-button v-if="tool.checkAuth($route.name,'toManual')" type="primary" size="mini" class="inline-16" :disabled="mainData.byhand === 1 || mainData.status !== '新建'" @click="toManual">转手工</el-button>
+        <el-button v-if="tool.checkAuth($route.name,'toManual')" type="primary" size="mini" class="inline-16" :disabled="mainData.byhand === 1 || mainData.status !== '新建' && mainData.status !== '提交'" @click="toManual">转手工</el-button>
       </div>
       <div slot="slot0" >
         <invoiceOrder :status="mainData.status" :sys_enterpriseid="mainData.sys_enterpriseid"></invoiceOrder>

+ 2 - 1
src/HDrpManagement/orderManage/details/importFile.vue

@@ -47,6 +47,7 @@
         <slot name="errorFile"></slot>
         <p class="tips">• 为保证数据导入顺利,推荐您下载并使用<a :href="modelurl">《Excel标准模板》</a></p>
         <p class="tips">• 文件中数据不能超过5000行</p>
+        <a :href="errorUrl" class="tips" style="color:red" v-if="errorUrl">•下载错误数据</a>
         <div class="dialog-footer">
           <el-button size="small" @click="cancel" class="normal-btn-width">取 消</el-button>
           <el-button size="small" type="warning" @click="dialogUploadVisible = false" class="normal-btn-width btn-warning">确 定</el-button>
@@ -66,7 +67,7 @@ export default {
     accept:限制上传文件类型;
     bindData:附件上传成功后对应需要绑定的数据信息
   */
-  props:['btntype','accept','bindData'],
+  props:['btntype','accept','bindData','errorUrl'],
   data () {
     return {
       dialogUploadVisible: false,

+ 7 - 6
src/HDrpManagement/orderManage/details/index.vue

@@ -45,7 +45,7 @@
           <el-button v-if="tool.checkAuth($route.name,'examine') && mainData.status === '审核'"  type="primary" size="mini" @click="onReturnCheck">反审核</el-button>
           <el-button v-if="tool.checkAuth($route.name,'reback') && mainData.status === '提交'"  type="primary" size="mini" @click="dialogVisible = true">退 回</el-button>
           <el-button v-if="tool.checkAuth($route.name,'submit') && mainData.status === '新建'" type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
-          <el-button v-if="tool.checkAuth($route.name,'close') && mainData.status === '审核'"  type="primary" size="mini" @click="closeOrder">关 闭</el-button>
+          <el-button v-if="tool.checkAuth($route.name,'finishOrder') && mainData.status === '审核'"  type="primary" size="mini" @click="closeOrder">结 案</el-button>
           <el-button v-if="tool.checkAuth($route.name,'insert')"  type="primary" size="mini" @click="onCopy">复 制</el-button>
       </div>
       <div slot="slot1">
@@ -54,7 +54,7 @@
       <div slot="slot0">
         <product-list @select="select" @onSuccess="queryMainData()" :data="mainData" ref="prod">
           <div slot="operation">
-            <!-- <importFile class="inline-16" :bindData="{ownertable:'sa_order',ownerid:$route.query.id,usetype:'default'}" @onSuccess="bindImportOrder"></importFile> -->
+            <!-- <importFile class="inline-16" :bindData="{ownertable:'sa_order',ownerid:$route.query.id,usetype:'default'}" :errorUrl="errorUrl" @onSuccess="bindImportOrder"></importFile> -->
             <changeOrderMx v-if="mainData.status === '审核'" class="inline-16" :data="selection" @onSuccess="$refs['prod'].listData()"></changeOrderMx>
             <el-button :disabled="mainData.status !== '审核' || selection.length === 0"  size="small" type="primary" style="margin-bottom:12px" @click="adddispatch">一键发货</el-button>
           </div>
@@ -126,7 +126,8 @@ export default {
       dialogVisible:false,
       visible:false,
       value:'',
-      selection:[]
+      selection:[],
+      errorUrl:null
     }
   },
   provide () {
@@ -299,7 +300,7 @@ export default {
         },
         {
           label:'erp单号',
-          value:this.mainData.erperpbillno
+          value:this.mainData.erpbillno
         },
         {
           label:'项目备注',
@@ -492,8 +493,8 @@ export default {
         }
       })
       this.$refs['prod'].listData()
-      if (res.data) {
-        console.log(res.data)
+      if (res.data !== '成功') {
+        this.errorUrl = res.data
       }
     }
   },

+ 1 - 1
src/HDrpManagement/orderManage/details/tabs/productlist.vue

@@ -326,7 +326,7 @@ export default {
     checkNB () {
       let siteid = JSON.parse(sessionStorage.getItem('active_account')).siteid
       if (siteid === 'NB' && this.data.type === '特殊订单' && this.data.typemx === '样品') {
-        return true
+        return false
       } else {
         return false
       }

+ 1 - 0
src/HDrpManagement/orderManage/modules/edit.vue

@@ -6,6 +6,7 @@
     :visible.sync="drawer"
     direction="rtl"
     append-to-body
+    @close="onEditSuccess"
     size="80%">
     <div slot="title">
       <div class="flex-align-center">

+ 24 - 3
src/SDrpManagement/agentOrder/details/index.vue

@@ -24,7 +24,11 @@
         <default-info :mainData="mainData"></default-info>
       </div>
       <div slot="slot0">
-        <product-list :data="mainData" ref="prod" @qtyChange="queryMainData" @onSuccess="queryMainData"></product-list>
+        <product-list :data="mainData" ref="prod" @qtyChange="queryMainData" @onSuccess="queryMainData">
+          <div slot="operation">
+            <!-- <importFile class="inline-16" :bindData="{ownertable:'sa_order',ownerid:$route.query.id,usetype:'default'}" @onSuccess="bindImportOrder"></importFile> -->
+          </div>
+        </product-list>
       </div>
       <div slot="slot2">
         <orderprogress></orderprogress>
@@ -65,6 +69,7 @@ import logistics from './tabs/logistics.vue'
 import dispatch from './tabs/dispatch.vue'
 import invoiceTable from './tabs/invoiceTable.vue'
 import revenue from './tabs/revenueAndExp.vue'
+import importFile from '../modules/importFile.vue'
 
 export default {
   name: "detail",
@@ -73,7 +78,8 @@ export default {
       mainData:{},
       mainAreaData:{},
       backreason:'',
-      dialogVisible:false
+      dialogVisible:false,
+      errorUrl:null
     }
   },
   provide() {
@@ -90,7 +96,8 @@ export default {
     dispatch,
     logistics,
     invoiceTable,
-    revenue
+    revenue,
+    importFile
   },
   methods:{
     async queryMainData(id) {
@@ -311,6 +318,20 @@ export default {
         this.queryMainData(this.$route.query.id)
         })
     },
+    async bindImportOrder (id) {
+      console.log(id)
+      const res = await this.$api.requested({
+        "id": 20230227194803,
+        "content": {
+        "sa_orderid":this.$route.query.id,
+        "attachmentid":id
+        }
+      })
+      this.$refs['prod'].listData()
+      if (res.data !== '成功') {
+        this.errorUrl = res.data
+      }
+    }
   },
   mounted () {
     this.queryMainData(this.$route.query.id)

+ 212 - 0
src/SDrpManagement/agentOrder/modules/importFile.vue

@@ -0,0 +1,212 @@
+<template>
+  <div>
+    <!-- 按钮类型 -->
+    <el-button type="success" size="small" @click="dialogUploadVisible = true" icon="el-icon-upload">导 入</el-button>
+    <el-dialog title="文件上传" class="import-panel" :visible.sync="dialogUploadVisible" width="500px" append-to-body :close-on-click-modal="false" :show-close="false" :before-close="clearFiles">
+      <div slot="title"></div>
+      <div style="background:#f1f2f3" class="my-tabs" >
+        <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+          <!-- <el-tab-pane label="导入经销商线索" name="first"></el-tab-pane> -->
+          <el-tab-pane label="导入业务员线索" name="second"></el-tab-pane>
+        </el-tabs>
+      </div>
+      <div style="padding:20px">
+        <el-upload
+          style="width:100%"
+          ref="my-upload"
+          class="upload-demo normal-margin"
+          :accept="accept"
+          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>
+        <a :href="errorUrl" class="tips" style="color:red" v-if="errorUrl">•下载错误数据</a>
+        <div class="dialog-footer">
+          <el-button size="small" @click="cancel" 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:['btntype','accept','bindData','errorUrl'],
+  data () {
+    return {
+      dialogUploadVisible: false,
+      params: {
+        "classname": "system.attachment.huawei.OBS",
+        "method": "getFileName",
+        "content": {
+          "filename": '',
+          "filetype": '',
+          "parentid": ""//归属文件夹ID
+        }
+      },
+      file: {},
+      filelist: [],
+      CampaignList:[],
+      activeName:'last',
+      modelurl:'',
+      campaignid:'',
+      folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid
+
+    }
+  },
+  mounted () {
+    this.getModelUrl()
+    // this.listData()
+  },
+  methods: {
+    cancel () {
+      this.dialogUploadVisible = false
+      this.campaignid = ''
+      this.$refs['my-upload'].clearFiles()
+      this.filelist = []
+    },
+    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": 20230227194703,
+        "content": {
+        }
+      })
+      this.modelurl = res.data
+      
+    },
+    // 获取华为云上传地址
+    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,this.bindData)
+      let param = {
+        "classname": "system.attachment.huawei.OBS",
+        "method": "uploadSuccess",
+        "content":obj
+      }
+      
+      const res = await this.$api.requested(param)
+      this.$emit('onSuccess',res.data.attachmentids[0])
+    },
+
+    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 - 2
src/SDrpManagement/agentOrder/modules/productlist.vue

@@ -1,8 +1,11 @@
 <template>
 <el-row :gutter="10">
   <el-col :span="setcol">
-    <el-button v-if="data.status === '新建'" class="inline-16" style="margin:0 0 10px 0px" size="small" type="primary"  @click="drawer = true">{{setcol === 24?'添 加':'取 消'}}</el-button>
-    <excel class="inline-16" :tablecols="columnTitle" :param="param" :total="total" :excelTitle="excelTitle"></excel>
+    <div  class="flex-align-center normal-margin">
+      <slot name="operation"></slot>
+      <el-button v-if="data.status === '新建'" class="inline-16" size="small" type="primary"  @click="drawer = true">{{setcol === 24?'添 加':'取 消'}}</el-button>
+      <excel class="inline-16" :tablecols="columnTitle" :param="param" :total="total" :excelTitle="excelTitle"></excel>
+    </div>
     <el-table
       ref="multipleTable"
       :data="tableData"

+ 23 - 3
src/SDrpManagement/salerOrder/details/index.vue

@@ -24,7 +24,11 @@
         <default-info :mainData="mainData"></default-info>
       </div>
       <div slot="slot0">
-        <product-list :data="mainData" @onSuccess="queryMainData($route.query.id)" ref="prod"></product-list>
+        <product-list :data="mainData" @onSuccess="queryMainData($route.query.id)" ref="prod">
+          <div slot="operation">
+            <!-- <importFile class="inline-16" :bindData="{ownertable:'sa_order',ownerid:$route.query.id,usetype:'default'}" :errorUrl="errorUrl" @onSuccess="bindImportOrder"></importFile> -->
+          </div>
+        </product-list>
       </div>
       <div slot="slot2">
         <orderprogress ref="prod"></orderprogress>
@@ -65,6 +69,7 @@ import logistics from './tabs/logistics.vue'
 import dispatch from './tabs/dispatch.vue'
 import invoiceTable from './tabs/invoiceTable.vue'
 import revenue from './tabs/revenueAndExp.vue'
+import importFile from '../modules/importFile.vue'
 
 export default {
   name: "detail",
@@ -73,7 +78,8 @@ export default {
       mainData:{},
       mainAreaData:{},
       backreason:'',
-      dialogVisible:false
+      dialogVisible:false,
+      errorUrl:null
     }
   },
   provide () {
@@ -90,7 +96,8 @@ export default {
     dispatch,
     logistics,
     invoiceTable,
-    revenue
+    revenue,
+    importFile
   },
   methods:{
     async queryMainData(id) {
@@ -366,6 +373,19 @@ export default {
         this.tool.showMessage(res)
       })
     },
+    async bindImportOrder (id) {
+      const res = await this.$api.requested({
+        "id": 20230227194803,
+        "content": {
+        "sa_orderid":this.$route.query.id,
+        "attachmentid":id
+        }
+      })
+      this.$refs['prod'].listData()
+      if (res.data !== '成功') {
+        this.errorUrl = res.data
+      }
+    }
   },
   mounted () {
     this.queryMainData(this.$route.query.id)

+ 212 - 0
src/SDrpManagement/salerOrder/modules/importFile.vue

@@ -0,0 +1,212 @@
+<template>
+  <div>
+    <!-- 按钮类型 -->
+    <el-button type="success" size="small" @click="dialogUploadVisible = true" icon="el-icon-upload">导 入</el-button>
+    <el-dialog title="文件上传" class="import-panel" :visible.sync="dialogUploadVisible" width="500px" append-to-body :close-on-click-modal="false" :show-close="false" :before-close="clearFiles">
+      <div slot="title"></div>
+      <div style="background:#f1f2f3" class="my-tabs" >
+        <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+          <!-- <el-tab-pane label="导入经销商线索" name="first"></el-tab-pane> -->
+          <el-tab-pane label="导入业务员线索" name="second"></el-tab-pane>
+        </el-tabs>
+      </div>
+      <div style="padding:20px">
+        <el-upload
+          style="width:100%"
+          ref="my-upload"
+          class="upload-demo normal-margin"
+          :accept="accept"
+          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>
+        <a :href="errorUrl" class="tips" style="color:red" v-if="errorUrl">•下载错误数据</a>
+        <div class="dialog-footer">
+          <el-button size="small" @click="cancel" 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:['btntype','accept','bindData','errorUrl'],
+  data () {
+    return {
+      dialogUploadVisible: false,
+      params: {
+        "classname": "system.attachment.huawei.OBS",
+        "method": "getFileName",
+        "content": {
+          "filename": '',
+          "filetype": '',
+          "parentid": ""//归属文件夹ID
+        }
+      },
+      file: {},
+      filelist: [],
+      CampaignList:[],
+      activeName:'last',
+      modelurl:'',
+      campaignid:'',
+      folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid
+
+    }
+  },
+  mounted () {
+    this.getModelUrl()
+    // this.listData()
+  },
+  methods: {
+    cancel () {
+      this.dialogUploadVisible = false
+      this.campaignid = ''
+      this.$refs['my-upload'].clearFiles()
+      this.filelist = []
+    },
+    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": 20230227194703,
+        "content": {
+        }
+      })
+      this.modelurl = res.data
+      
+    },
+    // 获取华为云上传地址
+    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,this.bindData)
+      let param = {
+        "classname": "system.attachment.huawei.OBS",
+        "method": "uploadSuccess",
+        "content":obj
+      }
+      
+      const res = await this.$api.requested(param)
+      this.$emit('onSuccess',res.data.attachmentids[0])
+    },
+
+    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>
+

+ 27 - 3
src/SDrpManagement/salerOrder/modules/productlist.vue

@@ -1,8 +1,11 @@
 <template>
 <el-row :gutter="10">
   <el-col :span="setcol">
-    <el-button class="inline-16" style="margin:0 0 10px 0px" size="small" type="primary" @click="drawer = true">{{setcol === 24?'添 加':'取 消'}}</el-button>
-    <excel class="inline-16" :tablecols="columnTitle" :param="param" :total="total" :excelTitle="excelTitle"></excel>
+    <div  class="flex-align-center normal-margin">
+      <slot name="operation"></slot>
+      <el-button class="inline-16" size="small" type="primary" @click="drawer = true">{{setcol === 24?'添 加':'取 消'}}</el-button>
+      <excel class="inline-16" :tablecols="columnTitle" :param="param" :total="total" :excelTitle="excelTitle"></excel>
+    </div>
     <el-table
       ref="multipleTable"
       :data="tableData"
@@ -141,7 +144,8 @@
         label="折前价格"
         width="100">
         <template slot-scope="scope">
-          <p>¥&nbsp;{{tool.formatAmount(scope.row.defaultprice,2)}}</p>
+          <el-input v-if="data.status === '新建'" v-model="scope.row.defaultprice" @change="inputChange(scope.row,scope.$index)" placeholder="输入单价" size="mini"></el-input>
+          <!-- <p>¥&nbsp;{{tool.formatAmount(scope.row.defaultprice,2)}}</p> -->
         </template>
       </el-table-column>
       <el-table-column
@@ -388,6 +392,26 @@ export default {
         this.$emit('onSuccess')
       })
     },
+    inputChange (row,index) {
+      if (row.defaultprice < row.contractprice) {
+        this.$message({
+          message:'价格不能低于原价!',
+          type:'error'
+        }) 
+      } else {
+        // row.defaultprice = row.contractprice
+        this.$set(this.tableData,index,row)
+        this.updateOrder({
+          "sa_orderid": this.data.sa_orderid, //订单ID
+          "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
+          "sa_contractid": this.data.contacts.contactsid, //合同ID
+          "type": this.data.type, //订单类型
+          "items": this.tableData
+        })
+        
+      }
+      
+    }
   },
   mounted () {
     this.listData()

+ 2 - 2
vue.config.js

@@ -14,8 +14,8 @@ module.exports = {
       port: 8000,
       proxy: {
         '/apis': {
-          target: 'http://61.164.207.46:8000',  // target host*/
-          // target: 'https://oms.idcgroup.com.cn:8079/',  // target host
+          // target: 'http://61.164.207.46:8000',  // target host*/
+          target: 'https://oms.idcgroup.com.cn:8079/',  // target host
           // target: 'localhost:8080',  // target host
           ws: true,  // proxy websockets 
           changeOrigin: true,  // needed for virtual hosted sites