吴羡
9 小时以前 57067e7107abc6d7b921ca9ba1dc46b4b4107c95
src/views/business/productOrder/components/addOrder.vue
@@ -136,7 +136,7 @@
            </el-col>
            <el-col :span="6">
              <el-form-item label="送样日期" prop="sampleDate">
                <el-date-picker v-model="addObj.sampleDate" type="date" value-format="YYYY-MM-DD" :disabled="active>1"
                <el-date-picker v-model="addObj.sampleDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择本次送样日期" :disabled="active>1"
                                size="small"/>
              </el-form-item>
            </el-col>
@@ -1671,6 +1671,11 @@
      }
    },
    saveMethod(sampleList) {
      if (!this.addObj.sampleDate && !this.isEdit) {
        this.$refs.newJuOrder?.validateField('sampleDate')
        this.$message.warning('请选择本次送样日期')
        return
      }
      if (this.addObj.standardTreeId) {
        this.saveData([]);
        return;
@@ -1705,6 +1710,11 @@
      }
    },
    saveData(sampleList) {
      if (!this.addObj.sampleDate && !this.isEdit) {
        this.$refs.newJuOrder?.validateField('sampleDate')
        this.$message.warning('请选择本次送样日期')
        return
      }
      this.saveLoad = true
      const insOrder = {
        ...this.addObj,
@@ -2185,14 +2195,17 @@
    },
    // 查询模板
    selectInsOrderTemplateById(e) {
      const loadVersion = ++this.orderLoadVersion
      selectInsOrderTemplateById({id: e}).then(res => {
        if (loadVersion !== this.orderLoadVersion || this.template !== e) return
        const detail = res.data || {}
        let obj = JSON.parse(detail.thing)
        //制单人设置为当前登录用户
        let user = this.nickName
        obj.addObj.custom = user.name
        obj.addObj.userId = user.userId
        this.addObj = obj.addObj;
        this.addObj = {...obj.addObj, sampleDate: null};
        this.$nextTick(() => this.$refs.newJuOrder?.clearValidate('sampleDate'))
        this.sampleList = obj.sampleList;
        this.selectTree = obj.selectTree
        // backend already resolved the bound record templates by standard