Browse Source

2023-4-10

codeMan 2 years ago
parent
commit
8e3df03ab5

+ 26 - 1
src/HDrpManagement/ProductMag/index.vue

@@ -33,6 +33,15 @@
           @clearUrl="errorUrl = null" 
           @onSuccess="bindImportOrder"
         ></importFile>
+        <importImage 
+          v-if="tool.checkAuth($route.name,'exportImage')"
+          ref="importImage" 
+          class="inline-16" 
+          :bindData="{ownertable:'plm_item',ownerid:$route.query.id,usetype:'default'}" 
+          :errorUrl="errorUrl" 
+          @clearUrl="errorUrl = null" 
+          @onSuccess="bindImportImage"
+        ></importImage>
       </template>
       <template #custom>
         <div class="mt-10">
@@ -159,6 +168,7 @@ import to_examine from './modules/toExamine'
 import counter_examine from './modules/counterExamine'
 import priceLevelSetting from './modules/priceLevelSetting'
 import importFile from './modules/importFile.vue'
+import importImage from './modules/importImage.vue'
 import { Loading } from 'element-ui';
 
 export default {
@@ -204,7 +214,8 @@ export default {
     to_examine,
     counter_examine,
     priceLevelSetting,
-    importFile
+    importFile,
+    importImage
   },
   methods:{
     async isOnSaleChange(val){
@@ -253,6 +264,20 @@ export default {
         this.$refs.basicLayout.listData()
       })
     },
+    async bindImportImage (id) {
+      const res = await this.$api.requested({
+        "id": "20230407164104",
+        "content": {
+          "attachmentid": id
+        }
+      })
+      if (res.data !== '成功') {
+        this.errorUrl = res.data
+      }
+      this.tool.showMessage(res,() => {
+        this.$refs.basicLayout.listData()
+      })
+    },
     selectChange(){
       if (this.dateSelect !== '' && this.dateSelect !== null){
         this.selectParam.begindate = this.dateSelect[0]

+ 4 - 2
src/HDrpManagement/ProductMag/modules/editPrice.vue

@@ -7,7 +7,7 @@
           <el-form :model="form" :rules="rules" ref="form" label-width="100px" label-position="right" size="mini">
             <el-col :span="24">
               <el-form-item label="一级价格" prop="price">
-                <el-input size="mini" placeholder="请输入价格" v-model="form.itempriceadjust[0].price"></el-input>
+                <el-input size="mini" placeholder="请输入价格" v-model="form.price"></el-input>
               </el-form-item>
             </el-col>
           </el-form>
@@ -31,6 +31,7 @@ export default {
       dialogFormVisible:false,
       projectAddress:[],
       form:{
+        "price":'',
         "itemid": '',
         "itempriceadjust": [
           {
@@ -52,12 +53,13 @@ export default {
     editBtn () {
       this.dialogFormVisible = true
       console.log(this.data[0].price);
-      this.form.itempriceadjust[0].price = this.data[0].price
+      this.form.price = this.data[0].price
     },
     onSubmit(){
       this.$refs['form'].validate(async (valid) => {
         if (!valid) return false
         this.form.itemid = this.$route.query.id
+        this.form.itempriceadjust[0].price = this.form.price
         const res = await this.$api.requested({
             "id": "20230404104604",
             "content": this.form

+ 217 - 0
src/HDrpManagement/ProductMag/modules/importImage.vue

@@ -0,0 +1,217 @@
+<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": "7023086e7fe38389a359dc05ba950b33",
+        "id": 20230407164004,
+        "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
+      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>
+

+ 1 - 1
src/HDrpManagement/recvoucher/details/index.vue

@@ -205,7 +205,7 @@ export default {
     // 监听切换数据,上一页,下一页
     pageChange (id,rowindex) {
       this.flag = false
-      this.$router.replace({path:'/payvoucherDetails',query:{id:id,rowindex:rowindex}})
+      this.$router.replace({path:'/recvoucherDetails',query:{id:id,rowindex:rowindex}})
       this.queryMainData(id)
     },
     onSuccess(){

+ 1 - 0
src/HDrpManagement/serveBill/components/edit.vue

@@ -161,6 +161,7 @@ export default {
         "begdate":"",
         "enddate":""
       },
+      accountInfo: sessionStorage.getItem('accountinfo'),
       rules:{
         servicetype:[
           { required: true, message: '请选择服务类型', trigger: 'change'},

+ 5 - 6
src/HDrpManagement/serveBill/modules/detail.vue

@@ -11,7 +11,7 @@
         :delApiId="20230206091803"
         :statusCheck="[{key:'status',value:'待处理'},{key:'status',value:'进行中'},{key:'status',value:'提交'},{key:'status',value:'待指派'},{key:'status',value:'已完成'}]"
         tags=""
-        :tabs="['详细信息','关联工单','服务商品']"
+        :tabs="['详细信息','服务商品','关联工单']"
         @pageChange="pageChange"
         @onEditSuccess="queryMainData($route.query.id)">
       <div slot="tags">
@@ -48,14 +48,14 @@
       <div slot="slot0" >
         <detailInfo :more="true" :data="detailInfo"></detailInfo>
       </div>
-      <div slot="slot1" >
+      <div slot="slot2" >
         <workBill ref="workBill">
           <!-- <template v-slot:delProduct="scope">
             <delete-btn nameId="20230206162003" nameKey="sa_serviceorderitemsids" :id="scope.data.sa_serviceorderid" @deleteSuccess="$refs.workBill.listData()"></delete-btn>
           </template> -->
         </workBill>
       </div>
-      <div slot="slot2">
+      <div slot="slot1">
         <productTable ref="product">
           <addProduct v-if="tool.checkAuth($route.name,'serveProduct') && mainData.status == '新建'" slot="addProduct" :data="mainData" @onSuccess="$refs.product.listData()" />
           <template v-slot:editProduct="scope">
@@ -104,7 +104,6 @@ export default {
         }
       })
       this.mainData = res.data
-      console.log(this.mainData);
       
       this.changeDataStructure()
     },
@@ -146,8 +145,8 @@ export default {
         {label:'客户',value:this.mainData.enterprisename ? this.mainData.enterprisename : ''},
         {label:'省市县',value:`${this.mainData.province}-${this.mainData.city}-${this.mainData.county}`},
         {label:'地址',value:this.mainData.address ? this.mainData.address : ''},
-        {label:'需求服务开始日期',value:this.mainData.begdate ? this.mainData.begdate : ''},
-        {label:'需求服务结束日期',value:this.mainData.enddate ? this.mainData.enddate : ''},
+        {label:'需求服务开始日期',value:this.mainData.begdate ? this.mainData.begdate.slice(0,this.mainData.begdate.indexOf(' ')) : ''},
+        {label:'需求服务结束日期',value:this.mainData.enddate ? this.mainData.enddate.slice(0,this.mainData.enddate.indexOf(' ')) : ''},
         {label:'服务分类',value:this.mainData.servicetype ? this.mainData.servicetype : ''},
         {label:'应用系统',value:this.mainData.class1 ? this.mainData.class1 : ''},
         {label:'客诉大类',value:this.mainData.class2 ? this.mainData.class2 : ''},

+ 3 - 3
src/HDrpManagement/serveBillMag/modules/detail.vue

@@ -11,7 +11,7 @@
         :delApiId="20230206091803"
         :statusCheck="[{key:'status',value:'待处理'},{key:'status',value:'进行中'},{key:'status',value:'提交'},{key:'status',value:'待指派'},{key:'status',value:'已完成'}]"
         tags=""
-        :tabs="['详细信息','关联工单','服务商品']"
+        :tabs="['详细信息','服务商品','关联工单']"
         @pageChange="pageChange"
         @onEditSuccess="queryMainData($route.query.id)">
       <div slot="tags">
@@ -48,14 +48,14 @@
       <div slot="slot0" >
         <detailInfo :more="true" :data="detailInfo"></detailInfo>
       </div>
-      <div slot="slot1" >
+      <div slot="slot2" >
         <workBill ref="workBill">
           <!-- <template v-slot:delProduct="scope">
             <delete-btn nameId="20230206162003" nameKey="sa_serviceorderitemsids" :id="scope.data.sa_serviceorderid" @deleteSuccess="$refs.workBill.listData()"></delete-btn>
           </template> -->
         </workBill>
       </div>
-      <div slot="slot2">
+      <div slot="slot1">
         <productTable ref="product">
           <addProduct v-if="tool.checkAuth($route.name,'serveProduct') && mainData.status == '新建'" slot="addProduct" :data="mainData" @onSuccess="$refs.product.listData()" />
           <template v-slot:editProduct="scope">

+ 8 - 2
src/HDrpManagement/toolBorrowingMag/detail/index.vue

@@ -10,7 +10,7 @@
       ownertable="sa_order"
       delApiId="20230116100002"
       :statusCheck="[{key:'status',value:'审核'},{key:'status',value:'交期待确认'},{key:'status',value:'提交'},{key:'status',value:'交期确认'}]"
-      :tabs="['借用单明细','发货单','物流单','收支明细']"
+      :tabs="['借用单明细','发货单','物流单','收支明细','erp对接记录']"
       @pageChange="pageChange"
       @onEditSuccess="onEditSuccess">
       <div slot="customOperation" class="inline-16">
@@ -56,6 +56,9 @@
       <div slot="slot3">
         <revenue :data="mainData"></revenue>
       </div>
+      <div slot="slot4">
+        <erpHistory :data="mainData"></erpHistory>
+      </div>
     </basicDetails>
     <el-dialog append-to-body title="退回原因" :visible.sync="dialogVisible" width="400px">
       <el-input v-model="backreason" type="textarea" placeholder="请输入退回原因"></el-input>
@@ -74,6 +77,8 @@ import dispatch from './tabs/dispatch.vue'
 import logistics from './tabs/logistics.vue'
 import revenue from './tabs/revenueAndExp.vue'
 import Edit from '../modules/edit'
+import erpHistory from './tabs/erpHistory.vue'
+
 
 export default {
   name: "detail",
@@ -99,7 +104,8 @@ export default {
     dispatch,
     logistics,
     revenue,
-    Edit
+    Edit,
+    erpHistory
   },
   methods:{
     async orderreviewtype () {

+ 101 - 0
src/HDrpManagement/toolBorrowingMag/detail/tabs/erpHistory.vue

@@ -0,0 +1,101 @@
+<template>
+  <div>
+    <el-table
+      :data="tableData"
+      style="width: 100%"
+      size="small"
+      border>
+      <el-table-column
+        prop="request"
+        label="推送人"
+        width="180">
+      </el-table-column>
+      <el-table-column
+        prop="createdate"
+        label="推送时间"
+        width="90">
+      </el-table-column>
+      <el-table-column
+        prop="status"
+        label="返回状态">
+      </el-table-column>
+      <el-table-column
+        prop="erpbillno"
+        label="erp单据号">
+      </el-table-column>
+      <el-table-column
+        prop="errmsg"
+        label="错误信息">
+      </el-table-column>
+      <el-table-column
+        prop="type"
+        label="类型"> 
+      </el-table-column>
+    </el-table>
+    <div class="container normal-panel" style="text-align:right">
+      <el-pagination
+        background
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="currentPage"
+        :page-sizes="[20, 50, 100, 200]"
+        layout="total,sizes, prev, pager, next, jumper"
+        :total="total">
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+      tableData:[],
+      param:{
+        "id": 20230225141904,
+        "content": {
+          "sa_orderid": '',
+          "pageNumber": 1,
+          "pageSize": 17,
+          "where": {
+            "condition": ""
+          }
+        },
+      },
+      total:0,
+      currentPage:0,
+    }
+  },
+  methods:{
+    async listData() {
+      this.param.content.sa_orderid = this.$route.query.id
+      const res = await this.$api.requested(this.param)
+      this.tableData = res.data
+      this.total = res.total
+      this.currentPage = res.pageNumber
+    },
+    handleSizeChange(val) {
+      this.param.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      this.param.pageNumber = val
+      this.listData()
+    },
+    linkDetail (item) {
+        let route = this.$route
+        if (route.path !== '/taskDetails') {
+          this.oldRoute = {path:route.path,query:route.query}
+          this.$store.dispatch('setHistoryRouter',this.oldRoute)
+        }
+        this.$router.replace({path:'/dispatchdetail',query:{id:item.sa_dispatchid,rowindex:item.rowindex}})
+      }
+  },
+  mounted () {
+    this.listData()
+  }
+}
+
+</script>
+<style>
+</style>