|
@@ -6,7 +6,7 @@
|
|
|
<div class="text-bold">基础信息</div>
|
|
|
</template>
|
|
|
<template #extra>
|
|
|
- <el-button hc-btn type="success" @click="handleSave">保存</el-button>
|
|
|
+ <el-button hc-btn type="success" :loading="handleSaveLoad" @click="handleSave">保存</el-button>
|
|
|
<el-button hc-btn type="warning" @click="handleRefresh">重新获取数据</el-button>
|
|
|
</template>
|
|
|
|
|
@@ -134,50 +134,18 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="20">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="样品品种">
|
|
|
- <el-select
|
|
|
- v-model="value"
|
|
|
- placeholder="请选择"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in checkOptions"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="代号">
|
|
|
- <el-select
|
|
|
- v-model="value"
|
|
|
- placeholder="请选择"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in checkOptions"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="强度等级">
|
|
|
+ <el-col v-for="(item, index) in ypList" :key="item.id" :span="8">
|
|
|
+ <el-form-item :label="item.name">
|
|
|
<el-select
|
|
|
- v-model="value"
|
|
|
+ v-model="ypList[index].value"
|
|
|
placeholder="请选择"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in checkOptions"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ v-for="item1 in item.info"
|
|
|
+ :key="item1.id"
|
|
|
+ :label="item1.name"
|
|
|
+ :value="item1.id"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -193,7 +161,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <hc-table :column="tableColumn" :datas="tableData">
|
|
|
+ <hc-table :column="tableColumn" :datas="basicInfoData.trailDeviceUseInfoDTOS">
|
|
|
<template #action="{ row, index }">
|
|
|
<el-link size="small" type="warning">删除</el-link>
|
|
|
</template>
|
|
@@ -274,7 +242,7 @@ const props = defineProps({
|
|
|
|
|
|
},
|
|
|
})
|
|
|
-
|
|
|
+const emit = defineEmits(['change'])
|
|
|
|
|
|
const useAppState = useAppStore()
|
|
|
const userInfo = ref(useAppState.getUserInfo)
|
|
@@ -286,7 +254,7 @@ const dataId = ref(props.dataId)
|
|
|
const projectId = ref(props.projectId)
|
|
|
const contractId = ref(props.contractId)
|
|
|
const ids = ref(props.ids)
|
|
|
-const handleSave = () => {}
|
|
|
+
|
|
|
const handleRefresh = () => {}
|
|
|
const isShow = defineModel('modelValue', {
|
|
|
default: false,
|
|
@@ -302,7 +270,7 @@ const getYpList = async (id)=>{
|
|
|
//处理数据
|
|
|
ypLoad.value = false
|
|
|
if (!error && code === 200) {
|
|
|
- ypList.value = getObjValue(data)
|
|
|
+ ypList.value = getArrValue(data)
|
|
|
console.log(ypList.value, 'ypList')
|
|
|
|
|
|
|
|
@@ -367,17 +335,19 @@ console.log(nodeId.value, dataId.value, projectId.value)
|
|
|
if (!error && code === 200) {
|
|
|
console.log(data, '基础信息数据')
|
|
|
basicInfoData.value = getObjValue(data)
|
|
|
- const { trialSampleInfoList } = basicInfoData.value
|
|
|
+ const { trialSampleInfoList, trailDeviceUseInfoDTOS } = basicInfoData.value
|
|
|
if (!trialSampleInfoList) {
|
|
|
- console.log('111111111')
|
|
|
basicInfoData.value.trialSampleInfoList = {
|
|
|
materialName:'',
|
|
|
specificationNumber:'',
|
|
|
sampleDescription:'',
|
|
|
samplingDate:'',
|
|
|
}
|
|
|
- console.log(' basicInfoData.value.trialSampleInfoList', basicInfoData.value.trialSampleInfoList)
|
|
|
-
|
|
|
+
|
|
|
+ }
|
|
|
+ if (!trailDeviceUseInfoDTOS) {
|
|
|
+ basicInfoData.value.trailDeviceUseInfoDTOS = []
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -390,25 +360,23 @@ const value = ref('')
|
|
|
|
|
|
const checkOptions = ref([])
|
|
|
const tableColumn = [
|
|
|
- { key: 'name', name: '设备名称' },
|
|
|
- { key: 'text', name: '设备型号' },
|
|
|
- { key: 'color', name: '设备编号' },
|
|
|
- { key: 'color', name: '测量范围' },
|
|
|
- { key: 'color', name: '精准度' },
|
|
|
- { key: 'color', name: '使用日期' },
|
|
|
- { key: 'color', name: '使用开始时间(h:min)' },
|
|
|
- { key: 'color', name: '使用结束时间(h:min)' },
|
|
|
- { key: 'color', name: '使用时间(min)' },
|
|
|
- { key: 'color', name: '运转前检查情况' },
|
|
|
- { key: 'color', name: '运转后检查情况' },
|
|
|
- { key: 'color', name: '操作人' },
|
|
|
- { key: 'color', name: '备注' },
|
|
|
+ { key: 'deviceName', name: '设备名称' },
|
|
|
+ { key: 'deviceModel', name: '设备型号' },
|
|
|
+ { key: 'deviceNumber', name: '设备编号' },
|
|
|
+ { key: 'measuringRange', name: '测量范围' },
|
|
|
+ { key: 'afterRunCheck', name: '精准度' },
|
|
|
+ { key: 'useDate', name: '使用日期' },
|
|
|
+ { key: 'startDate', name: '使用开始时间(h:min)' },
|
|
|
+ { key: 'endDate', name: '使用结束时间(h:min)' },
|
|
|
+ { key: 'useDuration', name: '使用时间(min)' },
|
|
|
+ { key: 'beforeRunCheck', name: '运转前检查情况' },
|
|
|
+ { key: 'afterRunCheck', name: '运转后检查情况' },
|
|
|
+ { key: 'managerName', name: '操作人' },
|
|
|
+ { key: 'remarks', name: '备注' },
|
|
|
{ key: 'action', name: '操作' },
|
|
|
]
|
|
|
const tableData = ref([
|
|
|
- { name: '名称1', text: '文本1', color: 'red' },
|
|
|
- { name: '名称2', text: '文本2', color: 'blue' },
|
|
|
- { name: '名称3', text: '文本3', color: '无' },
|
|
|
+
|
|
|
|
|
|
])
|
|
|
//关联取样
|
|
@@ -478,6 +446,8 @@ const linksSampleModalSave = () => {
|
|
|
console.log(tableSampleCheckedKeys.value, 'tableSampleCheckedKeys.value')
|
|
|
if (tableSampleCheckedKeys.value.length > 0) {
|
|
|
basicInfoData.value.trialSampleInfoList = tableSampleCheckedKeys.value[0]
|
|
|
+ basicInfoData.value.sampleIds = tableSampleCheckedKeys.value[0].id
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -507,6 +477,7 @@ const isLinksAssociation = ref(false)
|
|
|
const commissionChange = (id, data) => {
|
|
|
|
|
|
basicInfoData.value.entrustNo = data.specificationNumber
|
|
|
+ basicInfoData.value.entrustId = id
|
|
|
|
|
|
|
|
|
}
|
|
@@ -541,9 +512,41 @@ const linksAcquisitionClose = () => {
|
|
|
linksAcquisitionLoading.value = false
|
|
|
}
|
|
|
|
|
|
-const linkAcquisitionChange = (ids) => {
|
|
|
+const linkAcquisitionChange = (ids, rows) => {
|
|
|
console.log(ids)
|
|
|
+ console.log(rows, 'rows')
|
|
|
+ // tableData.value.push
|
|
|
+ if (rows.length > 0) {
|
|
|
+ rows.forEach((item)=>{
|
|
|
+ basicInfoData.value.trailDeviceUseInfoDTOS.push(item)
|
|
|
+ })
|
|
|
+ }
|
|
|
linkAcquisitionLoadDataId.value = ids
|
|
|
+ basicInfoData.value.deviceUseIds = ids
|
|
|
+}
|
|
|
+
|
|
|
+//保存
|
|
|
+const handleSaveLoad = ref(false)
|
|
|
+const handleSave = async () => {
|
|
|
+ const standardInfoIds = ypList.value
|
|
|
+ .filter(item => item.value != null && item.value !== '')
|
|
|
+ .map(item => item.value)
|
|
|
+ .join(',')
|
|
|
+
|
|
|
+ basicInfoData.value.standardInfoIds = standardInfoIds
|
|
|
+ // emit('change', basicInfoData.value)
|
|
|
+ handleSaveLoad.value = true
|
|
|
+ const { error, code, data, msg } = await dataApi.saveExcelBussData({
|
|
|
+ ...basicInfoData.value,
|
|
|
+ isBatchSave: 1,
|
|
|
+ })
|
|
|
+ handleSaveLoad.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message.success(msg)
|
|
|
+ isShow.value = false
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|