liding
昨天 d025bd201ab0dcc127630f2b68c650d975bdabaf
fix: 1.下单展示模板 2.页面温湿度调整
已修改2个文件
68 ■■■■■ 文件已修改
src/views/business/productOrder/components/addOrder.vue 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/productOrder/components/addView.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/productOrder/components/addOrder.vue
@@ -49,6 +49,16 @@
            <el-col :span="6"><el-form-item label="委托单位"><el-input v-model="addObj.company" disabled size="small"><template slot="append"><el-button :disabled="active>1" icon="el-icon-search" @click="openCompanyList" /></template></el-input></el-form-item></el-col>
            <el-col :span="6"><el-form-item label="检验类别"><el-select v-model="addObj.orderType" :disabled="active>1" size="small"><el-option v-for="item in dict.type.check_type1" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item></el-col>
          </el-row>
          <el-row v-if="addObj.standardTreeId || boundTemplateList.length">
            <el-col :span="24">
              <el-form-item label="原始记录模板">
                <div v-loading="templateBindingLoading" class="template-tag-list">
                  <el-tag v-for="item in boundTemplateList" :key="item.templateId" size="small" effect="plain">{{ item.name }}</el-tag>
                  <span v-if="!templateBindingLoading && boundTemplateList.length === 0" class="empty-template-text">暂未绑定原始记录模板</span>
                </div>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6"><el-form-item label="样品数量"><el-input v-model="addObj.testQuantity" :disabled="active>1" placeholder="如:2桶、500mL" size="small" /></el-form-item></el-col>
            <el-col :span="6"><el-form-item label="样品编号"><el-input v-model="sampleCode" :disabled="active>1" size="small" /></el-form-item></el-col>
@@ -61,7 +71,7 @@
            <el-col :span="6"><el-form-item label="送样日期"><el-date-picker v-model="addObj.sampleDate" type="date" value-format="yyyy-MM-dd" :disabled="active>1" size="small" /></el-form-item></el-col>
            <el-col :span="6"><el-form-item label="联系方式"><el-input v-model="addObj.phone" :disabled="active>1" size="small" /></el-form-item></el-col>
          </el-row>
          <el-row><el-col :span="6"><el-form-item label="环境条件"><el-input v-model="addObj.temperature" :disabled="active>1" placeholder="温度" size="small" /></el-form-item></el-col><el-col :span="6"><el-form-item label="湿度"><el-input v-model="addObj.humidity" :disabled="active>1" size="small" /></el-form-item></el-col><el-col :span="6"><el-form-item label="备注"><el-input v-model="addObj.remark" :disabled="active>1" size="small" /></el-form-item></el-col></el-row>
          <el-row><el-col :span="12"><el-form-item label="备注"><el-input v-model="addObj.remark" :disabled="active>1" size="small" /></el-form-item></el-col></el-row>
        </el-form>
        <el-form v-if="false" ref="addObj" :inline="true" :model="addObj" :rules="addObjRules" label-width="108px" label-position="right">
          <el-row>
@@ -627,7 +637,7 @@
  upInsOrderOfState
} from "@/api/business/add";
import {selectUserCondition} from "@/api/performance/class";
import {selectsStandardMethodByFLSSM} from "@/api/standard/standardLibrary";
import {selectTemplateBindings, selectsStandardMethodByFLSSM} from "@/api/standard/standardLibrary";
import limsTable from "@/components/Table/lims-table.vue";
import {selectCustomPageList} from "@/api/system/customer";
import {mapGetters} from "vuex";
@@ -665,6 +675,8 @@
      tabIndex: '',
      currentId: '',
      sampleCode: '',
      boundTemplateList: [],
      templateBindingLoading: false,
      sampleSelectionList: [],//样品表格选中数据
      editTable:[],
      template: null,
@@ -948,6 +960,8 @@
          };
          this.addObj.type = String(this.addObj.type)
          const samples = this.HaveJson(res.data.sampleProduct)
          this.sampleCode = samples.length ? samples[0].sampleCode || '' : ''
          this.boundTemplateList = this.sortTemplateList(res.data.templateList)
          const loadSamples = this.canSelectProduct
            ? Promise.all(samples.map(sample => this.loadSelectableProducts(sample)))
            : Promise.resolve(samples)
@@ -1416,8 +1430,11 @@
        })
      }else{
        // 常规提交
        const newJuOrder = {...this.addObj,typeSource:-1}
        delete newJuOrder.temperature
        delete newJuOrder.humidity
        const payload = this.addObj.standardTreeId
          ? { insOrder: {...this.addObj,typeSource:-1}, standardTreeId: this.addObj.standardTreeId, sampleCode: this.sampleCode }
          ? { insOrder: newJuOrder, standardTreeId: this.addObj.standardTreeId, sampleCode: this.sampleCode }
          : { insOrder: {...this.addObj,typeSource:-1}, sampleList: sampleList }
        addInsOrder(payload).then(res => {
          this.saveLoad = false
@@ -1555,8 +1572,23 @@
        const productName = this.selectTreeNode.data.label
        this.addObj.sample = productName
        this.addObj.standardTreeId = this.selectTreeNode.data.id
        this.loadTemplateBindings(this.addObj.standardTreeId)
        this.selectStandardTree = false
        this.sampleList = []
      },
      sortTemplateList(list) {
        return (list || []).slice().sort((a, b) => (a.sort || 0) - (b.sort || 0))
      },
      async loadTemplateBindings(standardTreeId) {
        this.boundTemplateList = []
        if (!standardTreeId) return
        this.templateBindingLoading = true
        try {
          const res = await selectTemplateBindings({standardTreeId})
          this.boundTemplateList = this.sortTemplateList(res.data)
        } finally {
          this.templateBindingLoading = false
        }
      },
      // 用指定型号替换树路径末段(末段即标准/型号)
      buildFactoryPath(model) {
@@ -2347,4 +2379,14 @@
  color: orange;
  font-size: 18px;
}
.template-tag-list {
  min-height: 32px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.empty-template-text {
  color: #909399;
}
</style>
src/views/business/productOrder/components/addView.vue
@@ -45,6 +45,15 @@
            <el-col :span="6"><el-form-item label="委托单位"><el-input v-model="addObj.company" disabled size="small" /></el-form-item></el-col>
            <el-col :span="6"><el-form-item label="检验类别"><el-select v-model="addObj.orderType" disabled size="small"><el-option v-for="item in dict.type.check_type1" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item></el-col>
          </el-row>
          <el-row v-if="boundTemplateList.length">
            <el-col :span="24">
              <el-form-item label="原始记录模板">
                <div class="template-tag-list">
                  <el-tag v-for="item in boundTemplateList" :key="item.templateId" size="small" effect="plain">{{ item.name }}</el-tag>
                </div>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6"><el-form-item label="样品数量"><el-input v-model="addObj.testQuantity" disabled size="small" /></el-form-item></el-col>
            <el-col :span="6"><el-form-item label="样品编号"><el-input v-model="sampleCode" disabled size="small" /></el-form-item></el-col>
@@ -58,8 +67,6 @@
            <el-col :span="6"><el-form-item label="联系方式"><el-input v-model="addObj.phone" disabled size="small" /></el-form-item></el-col>
          </el-row>
          <el-row>
            <el-col :span="6"><el-form-item label="环境条件"><el-input v-model="addObj.temperature" disabled placeholder="温度" size="small" /></el-form-item></el-col>
            <el-col :span="6"><el-form-item label="湿度"><el-input v-model="addObj.humidity" disabled size="small" /></el-form-item></el-col>
            <el-col :span="12"><el-form-item label="备注"><el-input v-model="addObj.remark" disabled size="small" style="width: 520px" /></el-form-item></el-col>
          </el-row>
        </el-form>
@@ -644,6 +651,7 @@
      tabIndex: '',
      currentId: '',
      sampleCode: '',
      boundTemplateList: [],
      sampleSelectionList: [],//样品表格选中数据
      editTable:[],
      template: null,
@@ -889,6 +897,7 @@
          this.addObj.type = String(this.addObj.type)
          this.sampleList = this.HaveJson(res.data.sampleProduct);
          this.sampleCode = this.sampleList.length ? this.sampleList[0].sampleCode : ''
          this.boundTemplateList = (res.data.templateList || []).slice().sort((a, b) => (a.sort || 0) - (b.sort || 0))
          this.specialStandardMethod = this.sampleList[0].specialStandardMethod
          this.getProNum()
          this.addObj.sampleNum = this.sampleList.length
@@ -2238,4 +2247,11 @@
  color: orange;
  font-size: 18px;
}
.template-tag-list {
  min-height: 32px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
</style>