licp
2024-08-21 06206329d0c2a7d806d70f3b8c9f7840d82200e2
修改下单逻辑
已修改5个文件
149 ■■■■■ 文件已修改
src/assets/api/controller.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-ins-order/add.vue 111 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/Inspection.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b2-standard.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js
@@ -234,6 +234,7 @@
  inExcelOfTree: "/standardTree/inExcelOfTree", //导入标准库
  resetTreeOfPrice: "/standardTree/resetTreeOfPrice", //重置标准库单价
  resetTreeOfHour: "/standardTree/resetTreeOfHour", //重置标准库工时系数
  exportStandTree: "/standardTree/exportStandTree", //重置标准库工时系数
}
const standardMethod = {
@@ -289,6 +290,7 @@
  addDepartmentLims: "/department/addDepartmentLims", //添加部门
  delDepartmentLims: "/department/delDepartmentLims", //删除部门
  selectDepartmentEnum: "/department/selectDepartmentEnum", //获取组织架构枚举
  selectDepartmentLimsEnum: "/department/selectDepartmentLimsEnum", //获取组织架构枚举
}
const report = {
src/components/do/b1-ins-order/add.vue
@@ -207,6 +207,14 @@
              <el-input size="small" placeholder="选择委托客户" clearable :readonly="active>1" v-model="addObj.phone"></el-input>
            </div>
          </el-col>
          <el-col class="search_thing" :span="6" v-if="addObj.orderType=='C'">
            <div class="search_label"><span class="required-span">* </span>下单至:</div>
            <div class="search_input">
              <el-select size="small" style="width: 100%;" clearable v-model="addObj.departmentLimsId" :disabled="active>1" placeholder="部门">
                <el-option v-for="(a, ai) in deaprtEnum" :key="ai" :value="a.id" :label="a.name"></el-option>
              </el-select>
            </div>
          </el-col>
          <el-col class="search_thing" :span="6">
            <div class="search_label"><span class="required-span">* </span>紧急程度:</div>
            <div class="search_input">
@@ -465,17 +473,17 @@
            <template slot-scope="scope">
              <el-input size="small" placeholder="要求描述" v-model="scope.row.tell" clearable type="textarea"
                :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row,'tell')"
                v-if="active==1&&isAskOnlyRead"></el-input>
                v-if="active==1"></el-input>
              <span v-else>
                <template >{{ scope.row.tell }}</template>
              </span>
            </template>
          </el-table-column>
          <el-table-column prop="ask" label="要求值" min-width="220px" v-if="isAskOnlyRead">
          <el-table-column prop="ask" label="要求值" min-width="220px" >
            <template slot-scope="scope">
              <el-input size="small" placeholder="要求值" v-model="scope.row.ask" clearable type="textarea"
                :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row,'ask')"
                v-if="active==1&&isAskOnlyRead&&scope.row.inspectionValueType!='5'"></el-input>
                v-if="active==1&&scope.row.inspectionValueType!='5'"></el-input>
              <span v-else>
                <!-- <template v-if="(scope.row.ask.indexOf('D')>-1
                ||scope.row.ask.indexOf('W')>-1
@@ -523,7 +531,7 @@
        <el-button type="primary" @click="selectUser">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog title="选择样品" :visible.sync="selectStandardTree" width="400px">
    <el-dialog title="选择样品" :visible.sync="selectStandardTree" width="500px">
      <div class="body" style="height: 60vh;overflow-y: auto;user-select: none;" v-if="selectStandardTree">
        <el-row>
          <el-col :span="24">
@@ -920,7 +928,6 @@
import equipConfig from './equip-config.vue'
import cableConfig from './cable-config.vue'
import Vue from 'vue'
import {iuCharts} from "../../../util/echarts";
export default {
    components: {
@@ -981,7 +988,9 @@
          production: null,
          productionEn: null,
          companyId: null,
          prepareUser:null
          prepareUser:null,
          departmentLimsId:null,
          departmentLims:null
        },
        sample: {
          sampleCode: null,
@@ -1118,6 +1127,7 @@
        temId: '',
        sonLaboratoryList:[],
        selectiveEcho: [], // 检验下单的时候勾选检验项目,如果使用筛选提交显示检验项目为空 回显列表
        deaprtEnum:[]
      }
    },
    watch: {
@@ -1185,6 +1195,7 @@
      this.selectEnumByCategoryForUnit()
      this.selectStandardMethods()
      this.selectEnumByCategoryForOrderType()
      this.selectDepartmentEnum()
      // this.selectEnumByCategoryForSonLaboratory()
      this.selectEnumByCategoryForSampleForm()
      if (this.active != 1) {
@@ -1578,6 +1589,15 @@
        return str.replace(find, value);
      },
      save() {
        if(this.addObj.orderType=='C'&&this.addObj.departmentLimsId){
          this.addObj.departmentLims = this.deaprtEnum.find(m=>m.id==this.addObj.departmentLimsId).name
        }else if(this.addObj.orderType&&this.addObj.orderType!='C'&&!this.addObj.departmentLimsId){
          this.addObj.departmentLims = '检测中心'
          this.addObj.departmentLimsId = this.deaprtEnum.find(m=>m.name=='检测中心').id
        }else{
          this.$message.error('请选择检验类别')
          return
        }
        if (!this.addObj.companyId) {
          this.$message.error('未选择客户单位')
          return
@@ -1592,6 +1612,8 @@
          this.$message.error('请输入生产单位')
        } else if (!this.addObj.productionEn) {
          this.$message.error('请输入生产单位EN')
        }else if (!this.addObj.departmentLimsId) {
          this.$message.error('选择下单到哪个部门')
        } else if (this.sampleList.length < 1) {
          this.$message.error('请添加一个样品')
        } else if (!this.sampleList.every(m => m.sample)) {
@@ -1601,54 +1623,14 @@
        } else if (!this.sampleList.every(m => m.standardMethodListId)) {
          this.$message.error('请选择检验标准')
        } else {
          const select = this.selectTree.split(' - ')
          const productListSelected = this.productListSelected.some(item => item.inspectionItem === '温度循环')
          let isHaveBushing = ''
          this.sampleList.forEach(item => {
            if (!item.bushing || item.bushing.length === 0) {
              isHaveBushing = false
            }
          })
          //过滤检测项:去除特殊项
          let filterProductList = this.productListSelected.filter(ele=>ele.bsm==0&&/[0-9]/.test(ele.ask)).filter(ele=>{
              if(select[1].indexOf('通信')>=0 && ['光缆','光纤'].includes(select[2])){
                return !['温度循环','光纤接头损耗'].includes(ele.inspectionItem)
              }
              return true
          }).filter(ele=>{
              if(select[1].indexOf('电力')>=0){
                return !['温升试验','热循环'].includes(ele.inspectionItem)
              }
              return true
          })
          //校验检验项的要求值和要求描述,仅委托要求
          if(this.active==1&&this.isAskOnlyRead){
            const isTrue = this.checkRequiredValueAndRemark(filterProductList)
            if(!isTrue){
              this.$message.error('检验项的要求值与要求描述不匹配, 请检查')
              return
            }
          }
          // console.log('isHaveBushing===', this.totalArr)
          let spcialItem = this.totalArr.filter(a => a.state == 1 && a.inspectionItem.includes('松套管'))
          if (productListSelected && select[2] === '光缆' && isHaveBushing === false&&spcialItem.length==0) {
            this.$message.error('光缆温度循环项目必须进行光纤配置')
            this.$refs.sampleTable.setCurrentRow(this.currentMethod, true)
            this.rowClick(this.currentMethod)
            this.sampleIds = [this.currentMethod.id]
            this.openConfig()
            return
          }else if(spcialItem.length>0&& isHaveBushing === false){
            this.$message.error('松套管项目必须进行光纤配置')
            // this.$refs.sampleTable.setCurrentRow(this.currentMethod, true)
            // this.rowClick(this.currentMethod)
            spcialItem.forEach(item=>{
              this.sampleIds.push(item.id)
            })
            this.openConfig()
            return
          }
          // if(this.active==1&&this.isAskOnlyRead){
          //   const isTrue = this.checkRequiredValueAndRemark(filterProductList)
          //   if(!isTrue){
          //     this.$message.error('检验项的要求值与要求描述不匹配, 请检查')
          //     return
          //   }
          // }
          let sampleList = this.HaveJson(this.sampleList)
          let projectNum = this.totalArr.filter(a => a.state == 1).length
          if(projectNum==0){
@@ -1821,7 +1803,7 @@
                        }
                      }
                    }else{
                      this.$message.error('要求值为空,需要去标准库维护!')
                      // this.$message.error('要求值为空,需要去标准库维护!')
                    }
                  }
                  // arr.forEach(f => {
@@ -1993,6 +1975,22 @@
        }
      },
      saveMethod(sampleList){
        let isHaveAsk = this.totalArr.filter(a => (a.ask === null||a.ask=='')&&a.state==1)
        if (isHaveAsk.length > 0) {
          this.$message({
            type: 'error',
            message: '请填写要求值后再提交'
          })
          return false;
        }
        let isHaveTell = this.totalArr.filter(a => (a.tell == null||a.tell=='')&&a.state==1)
        if (isHaveTell.length > 0) {
          this.$message({
            type: 'error',
            message: '请填写要求描述后再提交'
          })
          return false;
        }
        this.saveLoad = true
        this.$axios.post(this.$api.insOrder.addInsOrder, {
          str: JSON.stringify({
@@ -3192,6 +3190,11 @@
        if(this.sonLaboratoryList.length>0){
          this.distributeData.sonLaboratory = this.sonLaboratoryList[0].value
        }
      },
      selectDepartmentEnum(){
        this.$axios.get(this.$api.department.selectDepartmentLimsEnum).then(res=>{
          this.deaprtEnum = res.data
        })
      }
    }
  }
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -258,7 +258,7 @@
        <el-button size="small" type="primary" @click="bushingVisible=true" v-if="bushing.length>0">套管切换</el-button> -->
        <el-button size="small" type="primary" @click="sampleVisible=true;uploadSample()">样品切换</el-button>
        <el-button size="small" type="primary" @click="taskVisible=true">任务切换</el-button>
        <el-button size="small" type="primary" @click="addVerifyDia = true" v-if="state==1"
        <el-button size="small" type="primary" @click="handleSubmit" v-if="state==1"
          :loading="submitLoading">提交</el-button>
        <!-- 复核 -->
        <el-button size="medium" type="primary" @click="upInsReview(1)" :loading="reviewLoading"
@@ -1460,7 +1460,7 @@
            }else{
              str0 = i+','+j
            }
            if(j!='frequency'&&data[i][j]&&typeof data[i][j].result == 'string'){
            if(j!='frequency'&&data[i][j]&&(!data[i][j].result||typeof data[i][j].result == 'string')){
              // 处理数采信息格式
              this.dataAcquisitionInfo[str0] = {
                value:data[i][j].result,
@@ -3336,6 +3336,14 @@
          this.$message.error('未输入不通过原因')
        }
      },
      handleSubmit(){
        if(this.insOrder.departmentLims=='检测中心'&&this.insOrder.orderType=='C'){
          this.verifyUser = this.insOrder.prepareUserId
          this.submit()
        }else{
          this.addVerifyDia = true
        }
      },
      submit() {
        if (this.verifyUser === null || this.verifyUser === '') {
          this.$message.error("请指定复核人员")
src/components/view/b2-standard.vue
@@ -5,7 +5,7 @@
  }
  .left {
    width: 270px;
    width: 330px;
    height: calc(100% - 40px - 10px);
    background-color: white;
    padding: 15px;
@@ -33,7 +33,7 @@
  .right {
    margin-left: 5px;
    width: calc(100% - 305px);
    width: calc(100% - 365px);
    height: calc(100% - 40px);
  }
@@ -208,6 +208,7 @@
    <div class="right">
      <el-row class="title" style="width: 100%;">
        <el-col :span="20" style="font-size: 14px;color: #999;">{{selectTree}}</el-col>
        <el-button size="small" type="primary" style="position: absolute;right: 170px;top: 1px;" @click="handleDown" v-if="inExcelOfTreePower" :loading="outLoading">导出</el-button>
        <el-button size="small" type="primary" style="position: absolute;right: 100px;top: 1px;" @click="uploadDia = true" v-if="inExcelOfTreePower">导入</el-button>
        <el-button size="small" type="primary" @click="handleMore" style="position: absolute;right: 5px;top: 1px;"
          v-if="upStandardProduct">批量编辑</el-button>
@@ -635,6 +636,7 @@
        inExcelOfTreePower: false,
        uploading: false,
        isEquipment: false,
        outLoading:false
      }
    },
    watch: {
@@ -1544,6 +1546,20 @@
            })
          }
        }).catch(() => {})
      },
      handleDown(){
        this.outLoading = true
        this.$axios.get(this.$api.standardTree.exportStandTree,{responseType: 'blob'}).then(res => {
          this.outLoading = false
          this.$message.success('导出成功')
          const blob = new Blob([res],{ type: 'application/force-download' });
          const url = URL.createObjectURL(blob);
          const link = document.createElement('a');
          link.href = url;
          link.download = '检验标准.xlsx';
          link.click();
          document.body.removeChild(link)
        })
      }
    }
  }
src/main.js
@@ -20,10 +20,10 @@
//本地
// Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80";
// const javaApi = 'http://127.0.0.1:8001';
// const javaApi = 'http://192.168.0.104:8001';
const javaApi = 'http://192.168.0.104:8001';
//云
// Vue.prototype.LOCATIONVUE = "http://114.132.189.42:8080";
const javaApi = 'http://114.132.189.42:1234';
// const javaApi = 'http://114.132.189.42:1234';
// //检测中心正式库
// Vue.prototype.LOCATIONVUE = "http://10.1.200.86:8080";