Sfoglia il codice sorgente

Merge branch 'redUrgent' into allTestUrgent

qymljy 6 mesi fa
parent
commit
18e4f273ae

+ 110 - 0
src/HDrpManagement/productInspectionMag/detail/index.vue

@@ -0,0 +1,110 @@
+<template>
+  <basicDetails
+      ref="details"
+      :titleText="mainData.itemname"
+      :editData="mainData"
+      :mainAreaData="mainAreaData"
+      turnPageId="2025101415105002"
+      idname="itemid"
+      ownertable="plm_item"
+      :tabs="['检验明细']"
+      @pageChange="pageChange"
+  >
+    <template slot="customOperation">
+      <edit v-if="tool.checkAuth($route.name,'update')" class="inline-16" @onSuccess="queryMainData" :data="mainData"></edit>
+      <confirmBtn class="inline-16" :id="$route.query.id" message="确定审核该产品吗?" btn_title="审核" param-id="2025101415115502" @onSuccess="queryMainData" v-if="mainData.jystatus == '新建'"></confirmBtn>
+      <confirmBtn class="inline-16" :id="$route.query.id" message="确定反审核该产品吗?" btn_title="反审核" param-id="2025101415122902" @onSuccess="queryMainData" v-if="mainData.jystatus == '审核'"></confirmBtn>
+    </template>
+    <div slot="slot0" class="normal-panel" >
+      <checkInfo :disabled="mainData.jystatus == '审核'"></checkInfo>
+    </div>
+  </basicDetails>
+</template>
+
+<script>
+import checkInfo from '../modules/checkInfo'
+import edit from '../modules/edit'
+import confirmBtn from '@/components/confirmBtn/index'
+export default {
+  name: "index",
+  data(){
+    return {
+      mainData:{},
+      mainAreaData:{}
+    }
+  },
+  components:{checkInfo,edit,confirmBtn},
+  methods:{
+    async queryMainData(id){
+      const res = await this.$api.requested({
+        "content": {
+          "itemid": id?id:this.$route.query.id
+        },
+        "id": 2025101415231302,
+      })
+      this.mainData = Object.assign({},this.mainData,res.data)
+      this.changeDataStructure()
+    },
+    changeDataStructure(){
+      let that = this
+      this.mainAreaData = [
+        {
+          label:'产品编码',
+          value:this.mainData.itemno
+        },
+        {
+          label:'erp品号',
+          value:this.mainData.erpitemno
+        },
+        {
+          label:'erp品名',
+          value:this.mainData.erpitemname
+        },
+        {
+          label:'型号',
+          value:this.mainData.model
+        },
+        {
+          label:'规格',
+          value:this.mainData.spec
+        },
+        {
+          label:'公称通径',
+          value:this.mainData.caliber
+        },
+        {
+          label:'公称压力',
+          value:this.mainData.nominalpressurestr
+        },
+        {
+          label:'适用温度',
+          value:this.mainData.temperature
+        },
+        {
+          label:'适用介质',
+          value:this.mainData.medium
+        },
+        {
+          label:'状态',
+          value:this.mainData.jystatus,
+          style:function () {
+            let style = that.tool.getStatusColor(that.mainData.jystatus)
+            return style
+          }
+        },
+      ]
+    },
+    // 监听切换数据,上一页,下一页
+    pageChange (id,rowindex) {
+      this.queryMainData(id)
+    },
+  },
+  mounted() {
+    this.queryMainData()
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 115 - 0
src/HDrpManagement/productInspectionMag/index.vue

@@ -0,0 +1,115 @@
+<template>
+  <div>
+    <basicLayout
+        style="padding-top:0 !important"
+        ref="basicLayout"
+        table-name="productInspectionTable"
+        id-name="itemid"
+        :apiId="{query:2025101415105002,del:''}"
+        :detailPath="{path:'/productInspectionMagDetail'}">
+      <template #titleRight>
+        <importFile title="导入明细" paramID="2025101509114902" @onSuccess="importSuccess"
+                    :bindData="{ownertable:'plm_item',ownerid:$route.query.id,usetype:'default'}"
+                    :errorUrl="errorUrl"
+                    @clearUrl="errorUrl = null"></importFile>
+      </template>
+      <template #custom>
+        <div class="mt-10">
+          <label  class="search__label" >{{$t(`状态`)}}:</label>
+          <el-select class="inline-24" v-model="selectParam.status" :placeholder="$t(`请选择状态`)" @change="selectChange" size="small" clearable>
+            <el-option
+                v-for="item in statusData"
+                :key="item.value"
+                :label="$t(item.value)"
+                :value="item.value">
+            </el-option>
+          </el-select>
+        </div>
+        <div class="mt-10">
+          <label class="search__label" >{{$t(`审核时间`)}}:</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="$t(`至`)"
+              :start-placeholder="$t(`开始日期`)"
+              :end-placeholder="$t(`结束日期`)"
+              clearable>
+          </el-date-picker>
+        </div>
+      </template>
+      <template v-slot:tbList="scope">
+        <div v-if="scope.data.column.columnname === 'jystatus'">
+          <span :style="tool.getStatusColor(scope.data.column.data[[scope.data.column.columnname]])">{{$t(scope.data.column.data[[scope.data.column.columnname]])}}</span>
+        </div>
+        <div v-else>{{scope.data.column.data[[scope.data.column.columnname]]?$t(scope.data.column.data[[scope.data.column.columnname]]):'--'}}</div>
+      </template>
+    </basicLayout>
+  </div>
+</template>
+
+<script>
+import importFile from '@/components/import/importNoIcon'
+export default {
+  name: "index",
+  components:{importFile},
+  data() {
+    return {
+      statusData:[
+        {
+          value:'新建',
+          label:'新建'
+        },
+        {
+          value:'审核',
+          label:'审核'
+        }
+      ],
+      dateSelect:'',
+      selectParam:{
+        begindate: "",
+        enddate: "",
+        status: ""
+      },
+      errorUrl:null,
+    }
+  },
+  methods:{
+    selectChange(){
+      if (this.dateSelect !== '' && this.dateSelect !== null){
+        this.selectParam.begindate = this.dateSelect[0]
+        this.selectParam.enddate = this.dateSelect[1]
+      }else {
+        this.selectParam.begindate = ''
+        this.selectParam.enddate = ''
+      }
+      this.$refs.basicLayout.param.content.pageNumber = 1
+      this.$refs.basicLayout.param.content.where = this.selectParam
+      this.$refs.basicLayout.listData()
+    },
+    async importSuccess(id){
+      const res = await this.$api.requested({
+        "id": 2025101509132002,
+        "content": {
+          "attachmentid":id
+        }
+      })
+      if (res.data !== '成功') {
+        this.errorUrl = res.msg
+        res.msg = this.$t('失败')
+      }
+      /*res.msg = '失败'*/
+      this.tool.showMessage(res,() => {
+        this.$refs.basicLayout.listData()
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 228 - 0
src/HDrpManagement/productInspectionMag/modules/checkInfo.vue

@@ -0,0 +1,228 @@
+<template>
+  <div>
+    <div>
+      <el-input  style="width:200px;" :placeholder="$t('搜索')" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
+      </el-input>
+      <el-button type="primary" size="small" @click="addClick"  :disabled="isAdd || disabled">{{$t(`添加`)}}</el-button>
+    </div>
+    <table-detail :layout="tablecols" :data="list" :opwidth="200" :custom="true" style="margin-top: 10px">
+      <template v-slot:customcol="scope">
+        <div v-if="scope.column.columnname == 'sequence'">
+          <div v-if="isAdd && nowIndex == scope.column.data.rowindex">
+            <el-input
+                v-model="scope.column.data.sequence"
+            ></el-input>
+          </div>
+          <div v-else>
+            {{tool.qtyShow(scope.column.data[scope.column.columnname])}}
+          </div>
+        </div>
+        <div v-else-if="scope.column.columnname == 'optionname'">
+          <div v-if="isAdd && nowIndex == scope.column.data.rowindex">
+            <el-select
+                v-model="scope.column.data[scope.column.columnname]"
+                size="small"
+                :placeholder="$t('请选择检验项目')"
+                style="width: 100%"
+            >
+              <el-option
+                  v-for="item in optionnameList"
+                  :key="item.value"
+                  :label="$t(item.value)"
+                  :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </div>
+          <div v-else>
+            {{scope.column.data[scope.column.columnname]}}
+          </div>
+        </div>
+        <div v-else-if="scope.column.columnname == 'ask'">
+          <div v-if="isAdd && nowIndex == scope.column.data.rowindex">
+            <el-select
+                v-model="scope.column.data[scope.column.columnname]"
+                size="small"
+                :placeholder="$t('请选择技术要求')"
+                style="width: 100%"
+            >
+              <el-option
+                  v-for="item in askList"
+                  :key="item.value"
+                  :label="$t(item.value)"
+                  :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </div>
+          <div v-else>
+            {{scope.column.data[scope.column.columnname]}}
+          </div>
+        </div>
+        <div v-else-if="scope.column.columnname == 'answer'">
+          <div v-if="isAdd && nowIndex == scope.column.data.rowindex">
+            <el-select
+                v-model="scope.column.data[scope.column.columnname]"
+                size="small"
+                :placeholder="$t('请选择结论')"
+                style="width: 100%"
+            >
+              <el-option
+                  v-for="item in answerList"
+                  :key="item"
+                  :label="$t(item)"
+                  :value="item"
+              >
+              </el-option>
+            </el-select>
+          </div>
+          <div v-else>
+            {{scope.column.data[scope.column.columnname]}}
+          </div>
+        </div>
+        <div v-else-if="scope.column.columnname == 'operation'">
+          <el-button type="text" size="small" v-if="isAdd && nowIndex == scope.column.data.rowindex" @click="onSave(scope.column.data)" style="color: #e6a23c" :disabled="disabled">{{$t(`保存`)}}</el-button>
+          <el-button type="text" size="small" class="inline-16" v-else @click="onEdit(scope.column.data)" :disabled="disabled">{{$t(`编辑`)}}</el-button>
+          <el-popconfirm
+              :title="$t(`确定删除该明细吗?`)"
+              @confirm="delInfo(scope.column.data)"
+          >
+            <el-button slot="reference" size="small" type="text" v-if="nowIndex != scope.column.data.rowindex" style="color: #f56c6c" :disabled="disabled">{{$t(`删除`)}}</el-button>
+          </el-popconfirm>
+        </div>
+        <div v-else>{{scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname] : '--'}}</div>
+      </template>
+    </table-detail>
+    <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]"
+          :page-size="20"
+          layout="total,sizes, prev, pager, next, jumper"
+          :total="total">
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "checkInfo",
+  props:['disabled'],
+  data() {
+    return {
+      param:{
+        content: {
+          itemid: this.$route.query.id,
+          pageNumber: 1,
+          pageSize: 20,
+          where:{
+            condition:''
+          }
+        },
+        id: 2025101415222702,
+      },
+      tablecols:[],
+      list:[],
+      total:0,
+      currentPage:0,
+      isAdd:false,
+      optionnameList:[],
+      askList:[],
+      answerList:['合格','不合格'],
+      nowIndex:0
+    }
+  },
+  methods:{
+    addClick(){
+      this.queryType()
+      this.isAdd = true
+      this.list.push({
+        "plm_item_jymxid": 0,
+        "itemid": this.$route.query.id,
+        "optionname": "",
+        "ask": "",
+        "answer": "",
+        "sequence": this.list.length + 1,
+        "rowindex":this.list.length + 1
+      })
+      this.nowIndex = this.list[this.list.length -1].rowindex
+      console.log(this.nowIndex)
+    },
+    async queryType(){
+      const res = await this.$store.dispatch("optiontypeselect", "inspectionitems")
+      const res1 = await this.$store.dispatch("optiontypeselect", "technicalrequirements")
+      this.optionnameList = res.data
+      this.askList = res1.data
+    },
+    async delInfo(data){
+      const res = await this.$api.requested({
+        "content": {
+          "plm_item_jymxid": data.plm_item_jymxid
+        },
+        "id": 2025101415212502,
+      })
+      if (res.code == 0){
+        this.tool.showMessage(res,()=>{})
+      }else {
+        this.param.content.pageNUmber = 1
+        this.listData()
+      }
+    },
+    async listData(){
+      const res = await this.$api.requested(this.param)
+      this.list = res.data
+      this.currentPage = res.pageNumber
+      this.total = res.total
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
+    async onSave(data){
+      const res = await this.$api.requested({
+        "content": {
+          "plm_item_jymxid": data.plm_item_jymxid,
+          "itemid": this.$route.query.id,
+          "optionname": data.optionname,
+          "ask": data.ask,
+          "answer": data.answer,
+          "sequence": data.sequence
+        },
+        "id": 2025101415205302,
+      })
+      if (res.code == 0){
+        this.tool.showMessage(res,()=>{})
+      }else {
+        this.param.content.pageNUmber = 1
+        this.isAdd = false
+        this.nowIndex = ''
+        this.listData()
+      }
+    },
+    onEdit(data){
+      this.nowIndex = data.rowindex
+      this.isAdd = true
+    }
+  },
+  mounted() {
+    this.listData()
+  },
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).checkInfoTable.tablecols
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 141 - 0
src/HDrpManagement/productInspectionMag/modules/edit.vue

@@ -0,0 +1,141 @@
+<template>
+  <div>
+    <el-button type="primary" size="mini" @click="onShow">{{$t(`编辑`)}}</el-button>
+    <el-drawer
+        :title="$t('编辑')"
+        :visible.sync="dialogFormVisible"
+        :wrapperClosable="false"
+        size="700px"
+        direction="rtl"
+        append-to-body
+        :show-close="false"
+        @close="onClose"
+    >
+      <div class="drawer__panel">
+        <el-row :gutter="10">
+          <el-form
+              :model="form"
+              :rules="rules"
+              ref="form"
+              :label-width="tool.onlyZh('125px')"
+              label-position="right"
+              size="mini"
+          >
+            <el-col :span="24">
+              <el-form-item :label="$t('适用温度') + ':'" prop="temperature">
+                <el-input
+                    v-model="form.temperature"
+                    :placeholder="$t('请填写适用温度')"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t('适用介质') + ':'" prop="medium">
+                <el-select
+                    v-model="form.medium"
+                    :placeholder="$t('请选择领域')"
+                    style="width: 100%"
+                >
+                  <el-option
+                      v-for="item in mediumOption"
+                      :key="item.value"
+                      :label="$t(item.value)"
+                      :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button
+            size="small"
+            @click="onClose"
+            class="normal-btn-width inline-16"
+        >{{ $t("取消") }}</el-button
+        >
+        <el-button
+            size="small"
+            type="warning"
+            :loading="loading"
+            @click="onSave"
+            class="normal-btn-width"
+        >{{ $t("保存") }}</el-button
+        >
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "edit",
+  props:['data'],
+  data(){
+    return {
+      dialogFormVisible:false,
+      form:{
+        "itemid": '',
+        "temperature":"10℃-50℃",
+        "medium":"油"
+      },
+      rules:{
+        temperature: [
+          {
+            required: true,
+            message: this.$t("请填写适用温度"),
+            trigger: "blur",
+          },
+        ],
+        medium: [
+          {
+            required: true,
+            message: this.$t("请填写适用介质"),
+            trigger: "blur",
+          },
+        ],
+      },
+      loading:false,
+      mediumOption:[]
+    }
+  },
+  methods:{
+    onClose(){
+      this.dialogFormVisible = false
+    },
+    onShow(){
+      this.dialogFormVisible = true
+      this.mediumList()
+      this.form.medium = this.data.medium
+      this.form.temperature = this.data.temperature
+    },
+    onSave(){
+      this.form.itemid = this.$route.query.id
+      this.$refs.form.validate(async(valid)=>{
+        if (!valid) return false
+        this.loading = true
+        const res = await this.$api.requested({
+          id:2025101415125402,
+          content:this.form
+        })
+        this.tool.showMessage(res,()=>{
+          this.loading = false
+          this.dialogFormVisible = false
+          this.$emit('onSuccess')
+        })
+      })
+    },
+    async mediumList(){
+      const res = await this.$store.dispatch("optiontypeselect", "medium")
+      this.mediumOption = res.data
+
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 40 - 0
src/components/confirmBtn/index.vue

@@ -0,0 +1,40 @@
+<template>
+  <div>
+    <el-button type="primary" size="mini" @click="open">{{btn_title}}</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "index",
+  props:['btn_title','confirmButtonText','cancelButtonText','id','paramId','message'],
+  methods:{
+    open() {
+      this.$confirm(this.$t(this.message), this.$t('提示'), {
+        confirmButtonText: this.confirmButtonText?this.$t(this.confirmButtonText):this.$t('确定'),
+        cancelButtonText: this.cancelButtonText?cancelButtonText:this.$t('取消'),
+        type: 'warning'
+      }).then(async() => {
+        const res = await this.$api.requested({
+          "content": {
+            "itemid": this.id
+          },
+          "id": this.paramId,
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('onSuccess')
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: this.$t('已取消')
+        });
+      });
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 214 - 0
src/components/import/importNoIcon.vue

@@ -0,0 +1,214 @@
+<template>
+  <div>
+    <!-- 按钮类型 -->
+    <el-button type="success" size="small" @click="onShow(0)" >{{$t(title)}}</el-button>
+    <el-dialog :title="$t('文件上传')" 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="$t('导入经销商线索')" name="first"></el-tab-pane> -->
+          <el-tab-pane :label="$t(`导入`)" 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">{{$t('将文件拖到此处,或') + ' '}}<em>{{$t('点击上传')}}</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>{{$t('上传成功')}}</p>
+            <p>{{file.raw?file.raw.name:$t('暂无上传文件')}}</p>
+            <el-progress :percentage="file.progress" :show-text="false"></el-progress>
+          </div>
+        </div>
+        <slot name="errorFile"></slot>
+        <p class="tips">• + {{$t('为保证数据导入顺利,推荐您下载并使用' + ' ')}}<a :href="modelurl">《{{$t('Excel标准模板')}}》</a></p>
+        <p class="tips">• {{$t('文件中数据不能超过5000行')}}</p>
+        <a :href="errorUrl" class="tips" style="color:red" v-if="errorUrl">•{{$t(`下载错误数据`)}}</a>
+        <div class="dialog-footer">
+          <el-button size="small" @click="cancel" class="normal-btn-width">{{$t('取 消')}}</el-button>
+          <el-button size="small" type="warning" @click="dialogUploadVisible = false" class="normal-btn-width btn-warning">{{$t('确 定')}}</el-button>
+        </div>
+      </div>
+
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  /*
+   folderid:文件夹id; 必填
+   btntype:展示上传按钮的类型;
+   accept:限制上传文件类型;
+   bindData:附件上传成功后对应需要绑定的数据信息
+ */
+  name: "importFileNew",
+  props:['btntype','accept','bindData','errorUrl','title','paramID'],
+  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({
+        "id":this.paramID,
+        "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>

+ 21 - 0
src/router/HDrpManagement.js

@@ -191,6 +191,27 @@ const HDrpManagement = [
         component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/ProductMag/detail/index')
       }
     ]
+  },{
+    path: '/productInspectionMag',
+    name: 'productInspectionMag',
+    meta: {
+      title: '产品检验管理',
+      ast_nav: true,
+      keeproute: true,
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/productInspectionMag/index'),
+    children: [
+      {
+        path: '/productInspectionMagDetail',
+        name: 'productInspectionMag',
+        meta: {
+          title: '商品管理详情',
+          ast_nav: true,
+          keeproute: true,
+        },
+        component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/productInspectionMag/detail/index')
+      }
+    ]
   }, {
     path: '/valveSelection',
     name: 'valveSelection',