Browse Source

2023-4-12

codeMan 2 years ago
parent
commit
634edfe0e5

+ 2 - 2
src/HDrpManagement/ProductMag/detail/modules/detailedData.vue

@@ -27,7 +27,7 @@
         <el-descriptions-item  label="重量">毛重:{{ basic.grossweight}};净重:{{basic.weight}}</el-descriptions-item>
         <el-descriptions-item  label="条形码">{{ basic.barcode}}</el-descriptions-item>
         <el-descriptions-item  label="是否序列号管理">{{ basic.skucontrol ? '是' : '否'}}</el-descriptions-item>
-        <el-descriptions-item  label="是否批次管理">{{ basic.batchcontrol ? '是' : '否'}}</el-descriptions-item>
+        <el-descriptions-item  label="交期信息">{{ basic.delivery ? basic.delivery + '天' : '不限制'}}</el-descriptions-item>
 <!--        <el-descriptions-item  label="建议零售价">{{ tool.formatAmount(basic.price,2)}}</el-descriptions-item>-->
         <el-descriptions-item  label="压力等级">{{ basic.pressure}}</el-descriptions-item>
         <el-descriptions-item  label="蝶板驱动">{{ basic.butterflyplatedrive}}</el-descriptions-item>
@@ -43,7 +43,7 @@
         <el-descriptions-item  label="是否中线蝶阀">{{ basic.isbutterfly ? '是':'否'}}</el-descriptions-item>
         <el-descriptions-item  label="库存充足标准">{{ basic.stockstatus1}}</el-descriptions-item>
         <el-descriptions-item  label="库存缺货标准">{{ basic.stockstatus2}}</el-descriptions-item>
-        <el-descriptions-item  label="质保期">{{ basic.warrantyday}}</el-descriptions-item>
+        <el-descriptions-item  label="质保期(年)">{{ basic.warrantyday}}</el-descriptions-item>
 
         
       </el-descriptions>

+ 31 - 3
src/HDrpManagement/ProductMag/index.vue

@@ -42,6 +42,15 @@
           @clearUrl="errorUrl = null" 
           @onSuccess="bindImportImage"
         ></importImage>
+        <importInfo
+          v-if="tool.checkAuth($route.name,'exportInfo')"
+          ref="importImage" 
+          class="inline-16" 
+          :bindData="{ownertable:'plm_item',ownerid:$route.query.id,usetype:'default'}" 
+          :errorUrl="errorUrl" 
+          @clearUrl="errorUrl = null" 
+          @onSuccess="bindImportInfo"
+        ></importInfo>
       </template>
       <template #custom>
         <div class="mt-10">
@@ -169,6 +178,7 @@ import counter_examine from './modules/counterExamine'
 import priceLevelSetting from './modules/priceLevelSetting'
 import importFile from './modules/importFile.vue'
 import importImage from './modules/importImage.vue'
+import importInfo from './modules/importInfo.vue'
 import { Loading } from 'element-ui';
 
 export default {
@@ -215,7 +225,8 @@ export default {
     counter_examine,
     priceLevelSetting,
     importFile,
-    importImage
+    importImage,
+    importInfo
   },
   methods:{
     async isOnSaleChange(val){
@@ -258,8 +269,9 @@ export default {
         }
       })
       if (res.data !== '成功') {
-        this.errorUrl = res.data
+        this.errorUrl = res.msg
       }
+      res.msg = '失败'
       this.tool.showMessage(res,() => {
         this.$refs.basicLayout.listData()
       })
@@ -271,9 +283,25 @@ export default {
           "attachmentid": id
         }
       })
-      if (res.data !== '成功') {
+      if (res.msg !== '成功') {
         this.errorUrl = res.data
+        console.log(this.errorUrl)
+      }
+      this.tool.showMessage(res,() => {
+        this.$refs.basicLayout.listData()
+      })
+    },
+    async bindImportInfo (id) {
+      const res = await this.$api.requested({
+        "id": "20230411155104",
+        "content": {
+          "attachmentid": id
+        }
+      })
+      if (res.data !== '成功') {
+        this.errorUrl = res.msg
       }
+      res.msg = '失败'
       this.tool.showMessage(res,() => {
         this.$refs.basicLayout.listData()
       })

+ 218 - 0
src/HDrpManagement/ProductMag/modules/importInfo.vue

@@ -0,0 +1,218 @@
+<template>
+  <div>
+    <!-- 按钮类型 -->
+    <el-button type="success" size="small" @click="onShow(0)" 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" @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.listData()
+  },
+  methods: {
+    onShow () {
+      this.dialogUploadVisible = true
+       this.getModelUrl()
+    },
+    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({
+        "accesstoken": "c710101a764ec0b1cab13be4d88212a9",
+        "id": "20230311102404",
+        "content": {
+            "isInsert":0
+        }
+      })
+      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
+      this.$emit('clearUrl')
+    },
+  }
+}
+
+</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/HDrpManagement/productMoneyOdd/modules/productOddDetail.vue

@@ -66,8 +66,8 @@
         @size-change="handleSizeChange"
         @current-change="handleCurrentChange"
         :current-page="params.content.pageNumber"
-        :page-size="params.content.pageSize"
-        layout="total, prev, pager, next, jumper"
+        :page-sizes="[20,50,100,200]"
+        layout="total, sizes, prev, pager, next, jumper"
         :total="total">
       </el-pagination>
     </div>
@@ -128,10 +128,13 @@ export default {
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
       this.params.content.pageSize = val
+      this.getDetailList()
     },
     handleCurrentChange(val) {
       // console.log(`当前页: ${val}`);
       this.params.content.pageNumber = val
+      this.getDetailList()
+
     },
     /* 获取可添加的商品 */
     async getProductList () {

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

@@ -77,7 +77,7 @@ export default {
   },
   methods:{
     list (data) {
-      console.log(data);
+      if (!data[0].servicebillno) this.$refs.list.list = []
       
     },
     listCreate (param) {

+ 3 - 3
src/HDrpManagement/toolBorrowingMag/modules/edit.vue

@@ -90,7 +90,7 @@
             </el-popover>
           </div>
           <div class="reveive__panel">
-            <p><span class="inline-16"><b>{{defaultData.re_info.enterprisename}}</b></span><small>{{defaultData.re_info.phonenumber}}</small></p>
+            <p><span class="inline-16"><b>{{defaultData.re_info.name}}</b></span><small>{{defaultData.re_info.phonenumber}}</small></p>
             <small>{{defaultData.re_info.province}}{{defaultData.re_info.city}}{{defaultData.re_info.county}}{{defaultData.re_info.address?defaultData.re_info.address:'--'}}</small>
           </div>
         </div>
@@ -185,7 +185,7 @@
         <p><small>开户行:&nbsp;</small> {{defaultData.fin_info.bank}} &emsp;<small>开户账号:&nbsp;</small> {{defaultData.fin_info.bankcardno}}</p>
       </div>
       <div v-if="!data.sa_contractid" class="mt-10">
-        <p class="normal-title inline-16">领域明细</p>
+        <!-- <p class="normal-title inline-16">领域明细</p> -->
       </div>
       <div v-if="!data.sa_contractid" class="mt-10 flex-align-center">
         <div v-for="item in data.subvalues" :key="item.index" :style="defaultData.tradefieldmx === item?{background:'#d9ecff'}:{background:'#fff'}" class="reveive__panel normal-margin inline-16" @click="defaultData.tradefieldmx = item">
@@ -280,7 +280,7 @@ export default {
       this.defaultData.billdate = this.data.billdate
       this.defaultData.toolcount = this.data.toolcount
 
-      this.defaultData.re_info = this.data.pay_finance[0]
+      this.defaultData.re_info = this.data.contacts
 
     },
     async queryAgentiInfo () {

+ 3 - 3
src/SDrpManagement/ProductGroup/modules/GroupDetail/groupDetail.vue

@@ -16,7 +16,7 @@
         </el-tag>
         {{selectProduct.itemname}}
       </p>
-      <p class="normal-margin" style="color:#888;">编码:&emsp;{{selectProduct.itemno}}</p>
+      <p style="color:#888;margin-bottom:10px">编码:&emsp;{{selectProduct.itemno}}</p>
       <p class="normal-margin">价格:&emsp;<span class="product-price">¥{{selectProduct.gradeprice}}</span>&nbsp;<span class="text-throughline">¥{{selectProduct.marketprice}}</span></p>
       <div class="line normal-margin"></div>
       <p class="normal-margin">型号:&emsp;{{selectProduct.model || '--'}}</p>
@@ -29,7 +29,7 @@
       <div v-if="selectProduct.itemextend">
         <p class="normal-margin">材质:&emsp;{{selectProduct.itemextend.length? selectProduct.itemextend[0].material?selectProduct.itemextend[0].material:'--' :'--'}}</p>
       </div>
-      <div class="flex-align-center" style="margin-bottom:30px">
+      <div class="flex-align-center" style="margin-bottom:15px">
         <p>数量:&emsp;</p>
         <el-input-number v-model="count" :min="selectProduct.orderminqty" :step="selectProduct.orderaddqty" @change="changeQty" size="small" label="描述文字"></el-input-number>
         <span style="color:#888;font-size: 14px;margin-left: 10px">起订量:{{selectProduct.orderminqty}}</span>
@@ -48,7 +48,7 @@
       </div>
 
       <div class="type">
-        <div class="content normal-margin" style="max-height:300px;width:850px;overflow-y:scroll;">
+        <div class="content" style="max-height:300px;width:850px;overflow-y:scroll;margin-bottom: 10px;">
 <!--          <p class="inline-16">更多:</p>-->
           <el-tag class="inline-16" style="margin-top: 5px;margin-bottom: 5px;width: 120px" @click="typeClick(item)" v-for="(item,index) in detail" :key="index" size="small" :effect="selectProduct.itemno == item.itemno ? 'dark' : 'plain'">
             {{item.spec?item.spec.length >14?item.spec.substring(0,13)+'...':item.spec:item.spec}}

+ 2 - 2
src/SDrpManagement/salerToolBorrowing/modules/edit.vue

@@ -90,7 +90,7 @@
             </el-popover>
           </div>
           <div class="reveive__panel normal-margin">
-            <p><span class="inline-16"><b>{{defaultData.re_info.enterprisename}}</b></span><small>{{defaultData.re_info.phonenumber}}</small></p>
+            <p><span class="inline-16"><b>{{defaultData.re_info.name}}</b></span><small>{{defaultData.re_info.phonenumber}}</small></p>
             <small>{{defaultData.re_info.province}}{{defaultData.re_info.city}}{{defaultData.re_info.county}}{{defaultData.re_info.address?defaultData.re_info.address:'--'}}</small>
           </div>
         </div>
@@ -279,7 +279,7 @@ export default {
       this.defaultData.billdate = this.data.billdate
       this.defaultData.toolcount = this.data.toolcount
 
-      this.defaultData.re_info = this.data.pay_finance[0]
+      this.defaultData.re_info = this.data.contacts
 
     },
     async queryAgentiInfo () {

+ 2 - 2
src/SDrpManagement/toolBorrowing/modules/edit.vue

@@ -99,7 +99,7 @@
             </el-popover>
           </div>
           <div class="reveive__panel normal-margin">
-            <p><span class="inline-16"><b>{{defaultData.re_info.enterprisename}}</b></span><small>{{defaultData.re_info.phonenumber}}</small></p>
+            <p><span class="inline-16"><b>{{defaultData.re_info.name}}</b></span><small>{{defaultData.re_info.phonenumber}}</small></p>
             <small>{{defaultData.re_info.province}}{{defaultData.re_info.city}}{{defaultData.re_info.county}}{{defaultData.re_info.address?defaultData.re_info.address:'--'}}</small>
           </div>
         </div>
@@ -305,7 +305,7 @@ export default {
       this.defaultData.billdate = this.data.billdate
       this.defaultData.toolcount = this.data.toolcount
 
-      this.defaultData.re_info = this.data.pay_finance[0]
+      this.defaultData.re_info = this.data.contacts
     },
     async queryAgentiInfo () {
       const res = await this.$api.requested({