value
2024-05-12 42ea8c6cba21c555e254ac41ce976d7c2f9366f6
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -168,7 +168,8 @@
      <el-col :span="12" style="text-align: right;">
        <el-button size="small" type="primary" @click="sampleVisible=true">样品切换</el-button>
        <el-button size="small" type="primary" @click="taskVisible=true">任务切换</el-button>
        <el-button size="small" type="primary" @click="submit" v-show="state==1" :loading="submitLoading">提交</el-button>
        <el-button size="small" type="primary" @click="addVerifyDia = true" v-show="state==1"
          :loading="submitLoading">提交</el-button>
        <!-- 复核 -->
        <el-button size="medium" type="primary" @click="upInsReview(1)" :loading="reviewLoading"
          v-show="state>1">通过</el-button>
@@ -207,8 +208,8 @@
    <div class="center">
      <div class="search">
        <el-radio-group v-model="currentTable" size="small">
          <el-radio-button :label="item.templateId" v-for="(item,index) in tableLists"
            :key="index" size="small">{{ item.templateName }}</el-radio-button>
          <el-radio-button :label="item.templateId" v-for="(item,index) in tableLists" :key="index"
            size="small">{{ item.templateName }}</el-radio-button>
        </el-radio-group>
      </div>
      <div class="center-box">
@@ -219,27 +220,29 @@
                v-if="n.v.mc==undefined || Object.keys(n.v.mc).length === 4" :colspan="n.v.mc&&n.v.mc.cs?n.v.mc.cs:1"
                :rowspan="n.v.mc&&n.v.mc.rs?n.v.mc.rs:1"
                :style="`background:${n.v.bg};color:${n.v.fc};font-size:${n.v.fs}px;width:${handleWidth(n)}px !important;height:${item.style.rowlen[n.r]}px;font-wight:${n.v.bl?'bold':''};`">
                <div class="content" :class="`content-h-${n.v.ht} content-v-${n.v.vt}`" :style="`width:${handleWidth(n)}px !important;min-height:${item.style.rowlen[n.r]}px;`">
                <div class="content" :class="`content-h-${n.v.ht} content-v-${n.v.vt}`"
                  :style="`width:${handleWidth(n)}px !important;min-height:${item.style.rowlen[n.r]}px;`">
                  <template v-if="n.v.ps!=undefined && n.v.ps.value==='检验值' && state==1">
                    <el-input v-if="getInspectionValueType(n.i) == 1" class="table_input" v-model="n.v.v"
                      :disabled="getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '')"
                      @change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`)">
                      <el-button slot="append" type="primary" icon="el-icon-edit" size="mini" v-if="getInspectionItemType(n.i) == 1" @click="getSystemValue(n)"></el-button>
                      <el-button slot="append" type="primary" icon="el-icon-edit" size="mini"
                        v-if="getInspectionItemType(n.i) == 1" @click="getSystemValue(n)"></el-button>
                    </el-input>
                    <el-input v-else-if="getInspectionValueType(n.i) == 2" class="table_input" type="textarea"
                       v-model="n.v.v"
                      :disabled="getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '')"
                      @change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`)"/>
                      @change="saveInsContext()" />
                    <el-select v-else-if="getInspectionValueType(n.i) == 5" class="table_input"  v-model="n.v.v"
                      :disabled="state>1">
                      <el-option label="是" value="是"></el-option>
                      <el-option label="否" value="否"></el-option>
                      :disabled="state>1" @visible-change="e=>getDic(e,n.i)" @change="saveInsContext()">
                      <el-option v-for="(e, i) in enumList" :key="i" :label="e.label" :value="e.value"></el-option>
                    </el-select>
                    <span :style="`font-family:${n.v.ff} !important;`"
                      v-else-if="getInspectionValueType(n.i) == 4">/</span>
                  </template>
                  <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='结论'">
                    <el-select v-if="getInspectionValueType(n.i) == 2 && state==1" class="table_input" v-model="n.v.v" @change="saveInsContext()">
                    <el-select v-if="(getInspectionValueType(n.i) == 2 || getInspectionValueType(n.i) == 5) && state==1" class="table_input" v-model="n.v.v"
                      @change="saveInsContext()">
                      <el-option label="合格" :value="1"></el-option>
                      <el-option label="不合格" :value="0"></el-option>
                    </el-select>
@@ -250,14 +253,24 @@
                    </template>
                  </template>
                  <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='设备编码' && state==1">
                    <el-select v-model="n.v.v" placeholder="设备" @visible-change="e=>getEquipOptions(e,n.i)"
                       remote @change="(val)=>changeEquip(val, n)">
                    <el-select v-model="n.v.v" placeholder="设备" @visible-change="e=>getEquipOptions(e,n.i)" remote
                      @change="(val)=>changeEquip(val, n)">
                      <el-option v-for="item in equipOptions" :key="item.value" :label="item.value" :value="item.value">
                      </el-option>
                    </el-select>
                  </template>
                  <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='要求值' && state==1">
                    <span :style="`font-family:${n.v.ff} !important;`">{{getTell(n.i)}}</span>
                  </template>
                  <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='最终值' && state==1">
                    <el-input class="table_input" type="textarea"
                      :disabled="getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '')"
                      v-model="n.v.v" @change="saveInsContext()" v-if="getInspectionValueType(n.i) == 2"></el-input>
                    <el-select v-else-if="getInspectionValueType(n.i) == 5" class="table_input" v-model="n.v.v"
                      :disabled="state>1" @visible-change="e=>getDic(e,n.i)" @change="saveInsContext()">
                      <el-option v-for="(e, i) in enumList" :key="i" :label="e.label" :value="e.value"></el-option>
                    </el-select>
                    <span v-else :style="`font-family:${n.v.ff} !important;`">{{n.v.v}}</span>
                  </template>
                  <span v-else :style="`font-family:${n.v.ff} !important;`">{{n.v.v}}</span>
                </div>
@@ -303,13 +316,27 @@
      <div class="body" style="display: flex;padding: 10px;" v-if="reviewDia">
        <div class="search_label" style="width: 150px;"><span class="required-span">* </span>不通过的理由:</div>
        <div class="search_input" style="width: 100%;">
          <el-input size="small" clearable v-model="noReason" type="textarea"
            :autosize="{ minRows: 4}"></el-input>
          <el-input size="small" clearable v-model="noReason" type="textarea" :autosize="{ minRows: 4}"></el-input>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="reviewDia = false">取 消</el-button>
        <el-button type="primary" @click="handleReviewDia" :loading="reviewLoading">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog title="指定复核人员" :visible.sync="addVerifyDia" width="400px">
      <div class="body" style="display: flex;padding: 10px;align-items: center;">
        <div class="search_label" style="width: 150px;"><span class="required-span">*</span>复核人</div>
        <div class="search_input" style="width: 100%;">
          <el-select v-model="verifyUser" placeholder="请选择" size="small" style="width: 100%;" clearable filterable>
            <el-option v-for="(item,i) in personList" :key="i" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="addVerifyDia = false">取 消</el-button>
        <el-button type="primary" @click="submit()">确 定</el-button>
      </span>
    </el-dialog>
  </div>
@@ -382,7 +409,11 @@
        tableWidth: 1000,
        currentTable:null,
        tableLists:[],
        widthList:[]
        widthList: [],
        addVerifyDia: false,
        verifyUser: null,
        personList: [],
        enumList: []
      }
    },
    created() {
@@ -394,6 +425,7 @@
      this.getTypeDicts()
      this.getInsStateDicts()
      this.getComparisonList()
      this.getAuthorizedPerson()
    },
    watch: {
      id(val) {
@@ -508,6 +540,17 @@
          this.comparisonList = data;
        })
      },
      selectEnumByCategoryOfSelect(val) {
        this.enumList = []
        if(val===undefined||val===null){
          return
        }
        this.$axios.post(this.$api.enums.selectEnumByCategory, {
          category: val
        }).then(res => {
          this.enumList = res.data;
        })
      },
      tableRowClassName({
        row,
        rowIndex
@@ -597,8 +640,9 @@
                for (let i in this.currentSample.insProduct) {
                  if (this.currentSample.insProduct[i].templateId === a.templateId && this.currentSample
                    .insProduct[i].inspectionItem +
                     (this.currentSample.insProduct[i].inspectionItemSubclass==null?'':this.currentSample.insProduct[i].inspectionItemSubclass)
                     === str) {
                    (this.currentSample.insProduct[i].inspectionItemSubclass == null ? '' : this.currentSample
                      .insProduct[i].inspectionItemSubclass) ===
                    str) {
                      ids.push({
                        r: b.r,
                        id: this.currentSample.insProduct[i].id,
@@ -629,7 +673,8 @@
                if (a.template[b].v.ps != undefined && a.template[b].v.ps.value === '单位') {
                  a.template[b].v.v = id.product.unit
                }
                if (a.template[b].v.ps != undefined && (a.template[b].v.ps.value === '试验方法' || a.template[b].v.ps.value === '检测方法')) {
                if (a.template[b].v.ps != undefined && (a.template[b].v.ps.value === '试验方法' || a.template[b].v
                    .ps.value === '检测方法')) {
                  a.template[b].v.v = id.product.methodS
                }
              }
@@ -1081,6 +1126,17 @@
          })
        }
      },
      getDic(e, id) {
        if (e) {
          for (var a in this.currentSample.insProduct) {
            if (this.currentSample.insProduct[a].id == id) {
              let str = this.currentSample.insProduct[a].dic
              this.selectEnumByCategoryOfSelect(str)
              return str
            }
          }
        }
      },
      getUserInfo() {
        this.$axios.get(this.$api.user.getUserInfo).then(res => {
          this.userId = res.data.id
@@ -1134,10 +1190,16 @@
        }
      },
      submit() {
        if (this.verifyUser === null || this.verifyUser === '') {
          this.$message.error("请指定复核人员")
          return
        }
        this.addVerifyDia = false
        this.submitLoading = true;
        this.$axios.post(this.$api.insOrderPlan.submitPlan, {
          orderId: this.orderId,
          laboratory: this.sonLaboratory,
          verifyUser: this.verifyUser
        }).then(res => {
          if (res.code === 200) {
            this.$message.success("操作成功")
@@ -1171,7 +1233,19 @@
          }
        }
        this.saveInsContext()
      }
      },
      getAuthorizedPerson() {
        this.$axios.get(this.$api.user.getUserMenu).then(res => {
          let data = []
          res.data.forEach(a => {
            data.push({
              label: a.name,
              value: a.id
            })
          })
          this.personList = data
        })
      },
    }
  }
</script>