Browse Source

Merge remote-tracking branch 'origin/mergeBranch' into mergeBranch

# Conflicts:
#	src/SDrpManagement/ProductGroup/modules/GroupDetail/groupDetail.vue
qymljy 2 years ago
parent
commit
aec7256ea9

+ 0 - 72
src/HDrpManagement/orderManage/details/export_excelCopy.vue

@@ -1,72 +0,0 @@
-<template>
-  <div>
-    <el-button type="primary" size="small" @click="submit()" plain style="margin-bottom: 10px;margin-top: -10px">导 出</el-button>
-  </div>
-</template>
-
-<script>
-export default {
-  props:['tablecols','param','excelTitle','total'],
-  data () {
-    return {}
-  },
-  methods:{
-    async submit () {
-      let data = {}
-      // 如果传入了total,需要赋值保证数量准确性
-      if (this.total) {
-        this.param.content.pageSize = this.total
-      }
-      data = JSON.parse(JSON.stringify(this.param))
-
-      data.content.isAll = true
-      const res = await this.$api.requested(data)
-      console.log(res,"res111")
-      let table = JSON.parse(JSON.stringify(this.tablecols))
-      table.forEach((e,index) => {
-        // 由于表格数据结构问题这里需要判断一下
-       /* console.log(res)*/
-        console.log(index)
-        if (e.title === '省市县') {
-          table[index].title = '省'
-          table.splice(index + 1,0,{title:'市',columnname:'city'},{title:'县',columnname:'county'})
-        }else if(e.title === '型号/规格'){
-          res.data.forEach(e => {
-            e.model = e.model + '/' + e.spec
-          })
-        }else if(e.title === '需求日期'){
-          res.data.forEach(e => {
-            if (e.delivery === 0){
-              e.needdate = '不管控交期'
-            }else {
-              e.needdate = e.needdate
-            }
-          })
-        }else if(e.title === '回复交期'){
-          res.data.forEach(e => {
-            if (e.delivery === 0){
-              e.deliverydate = '不管控交期'
-            }else {
-              e.deliverydate = e.deliverydate
-            }
-          })
-        }else if(e.title === '小计'){
-          res.data.forEach(e => {
-            e.totalprice = e.price * e.qty
-          })
-        }
-      });
-      let hd = table.map(e=>{
-        return e.title
-      })
-      let ft = table.map(e=>{
-        return e.columnname
-      })
-      this.tool.exportExcel(hd,ft,res.data,this.excelTitle)
-    }
-  }
-}
-
-</script>
-<style>
-</style>

+ 211 - 0
src/HDrpManagement/orderManage/details/importFile.vue

@@ -0,0 +1,211 @@
+<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>
+        <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'],
+  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>
+

+ 18 - 2
src/HDrpManagement/orderManage/details/index.vue

@@ -54,6 +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> -->
             <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>
@@ -113,7 +114,7 @@ import changeOrderMx from './tabs/changeOrderMx.vue'
 import writeOff from './tabs/writeoff.vue'
 import erpHistory from './tabs/erpHistory.vue'
 import changeHistory from './tabs/changeHistory.vue'
-
+import importFile from './importFile.vue'
 export default {
   name: "detail",
   data() {
@@ -148,7 +149,8 @@ export default {
     changeOrderMx,
     writeOff,
     erpHistory,
-    changeHistory
+    changeHistory,
+    importFile
   },
   methods:{
     async orderreviewtype () {
@@ -479,6 +481,20 @@ export default {
 
         this.$router.replace({path:'/dispatchdetail',query:{id:res.data.sa_dispatchid,rowindex:res.data.rowindex}})
       })
+    },
+    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) {
+        console.log(res.data)
+      }
     }
   },
   mounted () {

+ 35 - 31
src/HDrpManagement/orderManage/details/tabs/productlist.vue

@@ -239,13 +239,15 @@
           label="仓库"
           width="150">
           <template slot-scope="scope">
-            <el-select v-model="scope.row.stockid" size="mini" placeholder="请选择">
+            <el-select v-model="scope.row.stockid" size="mini" @visible-change="queryStock(scope.row)" placeholder="请选择">
               <el-option
                 v-for="item in stockOptions"
-                :key="item.stockid"
-                :label="item.stockname"
-                :value="item.stockid"
-                @click.native="rowChange(scope.row,scope.$index)">
+                :key="item.stockno"
+                :label="item.WAREHOUSE"
+                :value="item.stockno"
+                @click.native="stockChange(item,scope.row,scope.$index)">
+                <span>{{ item.WAREHOUSE }}</span>
+                <div style="float: right; color: #8492a6; font-size: 13px">数量:{{item.qty}}仓位:{{ item.LOCATION }}/批号:{{ item.LOT }}</div>
               </el-option>
             </el-select>
           </template>
@@ -256,7 +258,7 @@
           label="仓位"
           width="150">
           <template slot-scope="scope">
-            <el-input size="mini" v-model="scope.row.position" @input="rowChange(scope.row,scope.$index)" placeholder="输入仓位"></el-input>
+            <el-input size="mini" readonly v-model="scope.row.position" @input="rowChange(scope.row,scope.$index)" placeholder="输入仓位"></el-input>
           </template>
         </el-table-column>
         <el-table-column
@@ -265,7 +267,7 @@
           label="批号"
           width="150">
           <template slot-scope="scope">
-            <el-input size="mini" v-model="scope.row.batchno" @input="rowChange(scope.row,scope.$index)" placeholder="输入批号"></el-input>
+            <el-input size="mini" readonly v-model="scope.row.batchno" @input="rowChange(scope.row,scope.$index)" placeholder="输入批号"></el-input>
           </template>
         </el-table-column>
         <el-table-column
@@ -398,31 +400,31 @@ export default {
         this.$emit('onSuccess')
       })
     },
+    stockChange (item,row,index) {
+      row.position = item.LOCATION
+      row.batchno = item.LOT
+      this.$set(this.tableData,index,row)
+      that.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
+      })
+    },
     rowChange (val,index) {
       let that = this
       if(this.time !== null){
         clearTimeout(this.time);
       }
       this.time = setTimeout(() => {
+        this.$set(this.tableData,index,val)
         that.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": [{
-            "sa_orderitemsid": val.sa_orderitemsid,//0表示新增
-            "itemid": val.itemid, //商品ID
-            "qty": val.qty, //数量
-            "needdate": val.needdate,//可以不传,修改交期
-            "price":val.price,
-            "remarks":val.remarks,
-            "defaultprice":val.defaultprice,
-            "stockid":val.stockid,
-            "position":val.position,
-            "batchno":val.batchno
-          }]
-        },()=>{
-          this.$set(this.tableData,index,val)
+          "items": this.tableData
         })
       },500)
     },
@@ -433,12 +435,7 @@ export default {
         "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
         "sa_contractid": this.data.contacts.contactsid, //合同ID
         "type": this.data.type, //订单类型
-        "items": [{
-          "sa_orderitemsid": val.sa_orderitemsid,//0表示新增
-          "itemid": val.itemid, //商品ID
-          "qty": val.qty, //数量
-          "deliverydate": val.deliverydate//可以不传,修改交期
-        }]
+        "items": this.tableData
       })
     },
     async updateOrder (val,fn) {
@@ -448,7 +445,6 @@ export default {
       })
       this.$emit('onSuccess')
       this.listData()
-      res.code === 1?fn():""
     },
     async dateChangeNeed(val){
       const res = await this.$api.requested({
@@ -523,14 +519,22 @@ export default {
         this.$emit('onSuccess')
       })
     },
-    async queryStock () {
-      const res = await this.$store.dispatch('optiontypeselect','stockselect')
+    async queryStock (val) {
+      console.log(val)
+      const res = await this.$api.requested({
+        "id": 20230228193201,
+        "content": {
+          "itemid": val.itemid,
+          "qty": val.qty
+        }
+
+      })
       this.stockOptions = res.data
     }
   },
   mounted () {
     this.listData()
-    this.queryStock()
+    // this.queryStock()
     this.columnTitle  = []
     this.$refs.multipleTable.$children.forEach(obj => {
 

+ 1 - 1
src/HManagement/clueManage/clue_import/modules/importClue.vue

@@ -8,7 +8,7 @@
 </template>
 
 <script>
-import importFile from './importFile'
+import importFile from './importFile.vue'
 export default {
   components:{
     importFile

+ 2 - 12
src/SDrpManagement/agentOrder/modules/productlist.vue

@@ -302,12 +302,7 @@ export default {
           "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
           "sa_contractid": this.data.contacts.contactsid, //合同ID
           "type": this.data.type, //订单类型
-          "items": [{
-            "sa_orderitemsid": val.sa_orderitemsid,//0表示新增
-            "itemid": val.itemid, //商品ID
-            "qty": val.qty, //数量
-            "needdate": val.needdate//可以不传,修改交期
-          }]
+          "items": this.tableData
         })
         this.$emit("qtyChange")
       },500)
@@ -320,12 +315,7 @@ export default {
         "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
         "sa_contractid": this.data.contacts.contactsid, //合同ID
         "type": this.data.type, //订单类型
-        "items": [{
-          "sa_orderitemsid": val.sa_orderitemsid,//0表示新增
-          "itemid": val.itemid, //商品ID
-          "qty": val.qty, //数量
-          "needdate": val.needdate//可以不传,修改交期
-        }]
+        "items": this.tableData
       })
       
     },

+ 2 - 12
src/SDrpManagement/salerOrder/modules/productlist.vue

@@ -315,12 +315,7 @@ export default {
           "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
           "sa_contractid": this.data.contacts.contactsid, //合同ID
           "type": this.data.type, //订单类型
-          "items": [{
-            "sa_orderitemsid": val.sa_orderitemsid,//0表示新增
-            "itemid": val.itemid, //商品ID
-            "qty": val.qty, //数量
-            "needdate": val.needdate//可以不传,修改交期
-          }]
+          "items":  this.tableData
         })
       },500)
     },
@@ -332,12 +327,7 @@ export default {
         "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
         "sa_contractid": this.data.contacts.contactsid, //合同ID
         "type": this.data.type, //订单类型
-        "items": [{
-          "sa_orderitemsid": val.sa_orderitemsid,//0表示新增
-          "itemid": val.itemid, //商品ID
-          "qty": val.qty, //数量
-          "needdate": val.needdate//可以不传,修改交期
-        }]
+        "items": this.tableData
       })
       
     },

+ 14 - 6
src/SDrpManagement/shopCart/modules/list.vue

@@ -15,7 +15,8 @@
     <el-table
       ref="multipleTable"
       :data="tableData"
-      style="width: 100%;height:calc(100vh - 346px)"
+      style="width: 100%;"
+      height="calc(100vh - 400px)"
       :header-cell-style="{height:'50px',color:'#768093',fontWeight:'400'}"
       :cell-style="{height:'50px',color:'#768093',fontWeight:'400'}"
       @selection-change="selectionChange">
@@ -74,7 +75,7 @@
         label="数量"
         width="150">
         <template slot-scope="scope">
-        <el-input-number size="mini" v-model="scope.row.qty" :min="scope.row.orderminqty" :step="scope.row.orderaddqty" label="输入数量" @change="qtyChange"></el-input-number>
+        <el-input-number size="mini" v-model="scope.row.qty" :min="scope.row.orderminqty" @change="changeQty(scope.row)" :step="scope.row.orderaddqty" label="输入数量"></el-input-number>
         </template>
       </el-table-column>
       <el-table-column
@@ -124,7 +125,7 @@ export default {
         "id": 20220924095302,
         "content": {
           "pageNumber": 1,
-          "pageSize": 20,
+          "pageSize": 9999,
           "istool":0,
           "where": {
             "condition": ''
@@ -176,13 +177,20 @@ export default {
     clearSelection () {
       this.$refs.multipleTable.clearSelection();
     },
-    qtyChange () {
-      this.$emit('qtyChange')
-    },
     onRadioChange () {
       this.params.content.pageNumber = 1
       this.listData()
       this.$emit('onRadioChange',this.params.content.istool)
+    },
+    async changeQty (row) {
+      const res = await this.$api.requested({
+        "id": 20220924104302,
+        "content": {
+          "sa_shoppingcartid": row.sa_shoppingcartid, 
+          "qty": row.qty //数量
+        },
+      })
+      this.$emit('qtyChange')
     }
   },
   mounted () {

+ 0 - 1
src/SDrpManagement/sinvoiceapp/modules/add.vue

@@ -116,7 +116,6 @@ export default {
       visible:false,
       visible1:false,
       form:{
-        enterprisename:'',
         taxno:'',
         sa_invoiceapplyid:0,
         remarks:'',