gaoluyang
3 天以前 401b0049703ab77faa8c49e6eb3cf6ee25261d9b
src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -24,9 +24,7 @@
          </el-col>
          <el-col :span="12">
            <el-form-item label="规格型号:" prop="model">
                     <el-select v-model="form.modelId" placeholder="请选择" clearable @change="getProductModel">
                        <el-option v-for="item in modelOptions" :key="item.id" :label="item.model" :value="item.id" />
                     </el-select>
                     <el-input v-model="form.model" placeholder="请输入" clearable/>
            </el-form-item>
          </el-col>
        </el-row>
@@ -100,7 +98,9 @@
</template>
<script setup>
import {ref} from "vue";
import {ref, computed} from "vue";
import dayjs from "dayjs";
import useUserStore from "@/store/modules/user.js";
import {getOptions} from "@/api/procurementManagement/procurementLedger.js";
import {modelList, productTreeList} from "@/api/basicData/product.js";
import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js";
@@ -109,6 +109,9 @@
import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
const userStore = useUserStore()
const currentUserName = computed(() => userStore.nickName || userStore.name || "")
const getToday = () => dayjs().format("YYYY-MM-DD")
const dialogFormVisible = ref(false);
const operationType = ref('')
@@ -166,12 +169,7 @@
]);
const tableData = ref([]);
const tableLoading = ref(false);
const userList = ref([
   {nickName: '候盛杰'},
   {nickName: '焦辉'},
   {nickName: '张培'},
   {nickName: '冯灵之'},
]);
const userList = ref([]);
const currentProductId = ref(0);
const modelOptions = ref([]);
@@ -183,7 +181,7 @@
    supplierList.value = res.data;
  });
   let userLists = await userListNoPage();
   // userList.value = userLists.data;
   userList.value = userLists.data;
   form.value = {}
  getProductOptions();
  if (operationType.value === 'edit') {
@@ -201,6 +199,13 @@
      }
      getQualityInspectParamList(row.id)
  }
   // 默认检验员为当前登录人,检测日期默认为当天(空时填充)
   if (currentUserName.value && !form.value.checkName) {
      form.value.checkName = currentUserName.value;
   }
   if (!form.value.checkTime) {
      form.value.checkTime = getToday();
   }
}
const getProductOptions = () => {
  productTreeList({productName: '质量'}).then((res) => {