licp
2024-10-15 90e8eda30ad7283a2d39d973e467baadfb155f0e
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -347,7 +347,7 @@
        </div> -->
      </div>
      <!-- 常规检验原始记录 -->
      <div class="center-box" id="nav" v-loading="tableLoading" v-if="!tableLists.find(m=>m.templateId==currentTable)||(!tableLists.find(m=>m.templateId==currentTable).templateName.includes('电路试验')&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('温湿度试验'))">
      <div class="center-box" id="nav" v-loading="tableLoading" v-if="!tableLists.find(m=>m.templateId==currentTable)||(!tableLists.find(m=>m.templateId==currentTable).templateName.includes('电路试验')&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('温湿度试验')&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('功率容量'))">
        <table border="1" class="tables" cellpadding="10" v-for="(item,index) in tableList" :key="index+currentTable+currentSample.id">
          <tbody>
            <tr v-for="(m,i) in item.arr" :key="i">
@@ -730,9 +730,13 @@
        <CircuitParameters2 v-if="currentTableState==1" :insProduct="currentSample.insProduct" :orderId="id" :sampleId="currentSample.id" :state="state" :num="currentSample.num1" :isLook="isLook" :currentNum="currentNum"></CircuitParameters2>
      </div>
      <!-- 温湿度试验 -->
       <div v-else-if="tableLists.find(m=>m.templateId==currentTable).templateName.includes('温湿度试验')">
      <div v-else-if="tableLists.find(m=>m.templateId==currentTable).templateName.includes('温湿度试验')">
        <Humidity :insProduct="currentSample.insProduct" :orderId="id" :sampleId="currentSample.id" :state="state" :isLook="isLook" :num="currentSample.num1"/>
       </div>
      </div>
      <!-- 功率试验 -->
      <div v-else-if="tableLists.find(m=>m.templateId==currentTable).templateName.includes('功率容量')">
        <PowerCapacity :insProduct="currentSample.insProduct" :orderId="id" :sampleId="currentSample.id" :state="state" :isLook="isLook" :num="currentSample.num1" />
      </div>
      <el-upload :action="action"
      :data="{
        orderId:id
@@ -858,20 +862,42 @@
        <el-button type="primary" :loading="versionLoading" @click="saveVersion">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog title="试验信息" :visible.sync="experimentDia" width="400px">
      <div class="body" style="display: flex;padding: 10px;align-items: center;">
    <el-dialog title="试验信息" :visible.sync="experimentDia" width="50%">
      <div class="body" style="display: flex;padding: 10px;align-items: center;" v-if="experimentDia0">
        <div class="search_label" style="width: 150px;"><span class="required-span">*</span>实验阶段</div>
        <div class="search_input" style="width: 100%;">
          <el-input clearable v-model="experimentInfo.term" size="small" placeholder=""></el-input>
        </div>
      </div>
      <div class="body" style="display: flex;padding: 10px;align-items: center;">
      <div class="body" style="display: flex;padding: 10px;align-items: center;" v-if="experimentDia0">
        <div class="search_label" style="width: 150px;"><span class="required-span">*</span>实验操作</div>
        <div class="search_input" style="width: 100%;">
          <el-input clearable v-model="experimentInfo.note" size="small" placeholder="" type="textarea"
          :rows="2"></el-input>
        </div>
      </div>
      <table border="1" cellpadding="10" class="thermal-table">
        <tr style="font-size: 18px;font-weight: 500;background-color: #F0F1F5;padding: 10px 0;box-sizing: border-box;">
          <td>样品</td>
          <td>样品编号</td>
          <td>型号</td>
          <td>检验项</td>
          <td>检验子项</td>
          <td>工时</td>
        </tr>
        <template v-for="(item,index) in sampleProduct">
          <tr>
            <td :rowspan="item.insProduct.length+1">{{ item.sample }}</td>
            <td :rowspan="item.insProduct.length+1">{{ item.sampleCode }}</td>
            <td :rowspan="item.insProduct.length+1">{{ item.model }}</td>
          </tr>
          <tr v-for="(m,i) in item.insProduct" :key="item.id+i">
            <td>{{ m.inspectionItem }}</td>
            <td>{{ m.inspectionItemSubclass }}</td>
            <td><el-input-number v-model="m.outputWorkTime" :min="0" :max="100" label="工时" size="small"></el-input-number></td>
          </tr>
        </template>
      </table>
      <span slot="footer" class="dialog-footer">
        <el-button @click="experimentDia = false">取 消</el-button>
        <el-button type="primary" @click="submit0">确 定</el-button>
@@ -895,6 +921,7 @@
  import CircuitParameters1 from './circuit-parameters1.vue'
  import CircuitParameters2 from './circuit-parameters2.vue'
  import Humidity from './humidity.vue'
  import PowerCapacity from './power-capacity.vue'
  import filePreview from '../../tool/file-preview.vue'
  export default {
    props: ['sonLaboratory', 'orderId', 'state','inspectorList','version','orderStateId','isLook','num1','noBack'],
@@ -905,11 +932,13 @@
      CircuitParameters2,
      filePreview,
      Humidity,
      PowerCapacity,
    },
    data() {
      return {
        lookFileVisible:false,//预览文件
        experimentDia:false,
        experimentDia0:false,
        experimentInfo:{
          note:'',
          term:''
@@ -3203,15 +3232,30 @@
        }
      },
      submit0(){
        if(!this.experimentInfo.term){
          this.$message.error('请输入实验阶段')
          return
        if(this.sonLaboratory === '电路试验'){
          if(!this.experimentInfo.term){
            this.$message.error('请输入实验阶段')
            return
          }
          if(!this.experimentInfo.note){
            this.$message.error('请输入实验操作')
            return
          }
        }
        if(!this.experimentInfo.note){
          this.$message.error('请输入实验操作')
        let num =0
        this.sampleProduct.forEach(item=>{
          item.insProduct.forEach(a=>{
            if(!a.outputWorkTime){
              num++
            }
          })
        })
        if(num>0){
          this.$message.error('请输入完成工时')
          return
        }
        this.experimentDia = false
        this.experimentDia0 = false
        if(this.insOrder.orderType=='C'){
          this.verifyUser = this.insOrder.prepareUserId
          this.submit()
@@ -3220,15 +3264,10 @@
        }
      },
      handleSubmit(){
        this.experimentDia = true
        console.log(6666,this.sampleProduct)
        if (this.sonLaboratory === '电路试验') {
          this.experimentDia = true
        } else {
          if(this.insOrder.orderType=='C'){
            this.verifyUser = this.insOrder.prepareUserId
            this.submit()
          }else{
            this.addVerifyDia = true
          }
          this.experimentDia0 = true
        }
      },
      submit() {
@@ -3243,14 +3282,33 @@
          laboratory: this.sonLaboratory,
        }).then(res => {
          if (res.code === 200) {
            let auxiliaryOutputWorkingHoursList = []
            this.sampleProduct.forEach(item=>{
              item.insProduct.forEach(a=>{
                let obj = {
                  inspectionItem:a.inspectionItem,
                  outputWorkTime:a.outputWorkTime,
                  inspectionItemSubclass:a.inspectionItemSubclass,
                  sample:item.id,
                  insProductId:a.id,
                  num:item.num
                }
                auxiliaryOutputWorkingHoursList.push(obj)
              })
            })
            if(!res.data||res.data.length==0){
              this.$axios.post(this.$api.insOrderPlan.submitPlan, {
                orderId: this.orderId,
                laboratory: this.sonLaboratory,
                verifyUser: this.verifyUser,
                entrustCode: this.insOrder.entrustCode,
                auxiliaryOutputWorkingHoursList:auxiliaryOutputWorkingHoursList,
                ...this.experimentInfo
              }).then(res => {
              }, {
      headers: {
        'Content-Type': 'application/json'
      },
      noQs:true}).then(res => {
                if (res.code === 200) {
                  this.$message.success("操作成功")
                  this.$emit('goback')
@@ -3282,8 +3340,13 @@
                  orderId: this.orderId,
                  laboratory: this.sonLaboratory,
                  verifyUser: this.verifyUser,
                  auxiliaryOutputWorkingHoursList:auxiliaryOutputWorkingHoursList,
                  ...this.experimentInfo
                }).then( res => {
                }, {
      headers: {
        'Content-Type': 'application/json'
      },
      noQs:true}).then( res => {
                  if (res.code === 200) {
                    this.submitLoading = false;
                    this.$message.success("操作成功")