| | |
| | | |
| | | let basic = ref({ |
| | | basicType : ['',''], |
| | | input:'' |
| | | input:'', |
| | | nickname:'' |
| | | }) |
| | | let options=ref([ |
| | | { "label": t('orderBasicData.order'), |
| | |
| | | basic.value.basicType[0] = props.rowIndex.basicType |
| | | basic.value.basicType[1] = props.rowIndex.basicCategory |
| | | basic.value.input = props.rowIndex.basicName |
| | | basic.value.nickname = props.rowIndex.nickname |
| | | } |
| | | }) |
| | | |
| | | const emit = defineEmits(['gaveParent']) |
| | | const saveBasicData = () =>{ |
| | | console.log(basic.value.basicType[1]) |
| | | if(basic.value.basicType[1]==="hollowThickness"||basic.value.basicType[1]==="stuffThickness"||basic.value.basicType[1]==="InterlayerThickness"){ |
| | | if(!basic.value.input.includes("mm")){ |
| | | basic.value.input=basic.value.input+"mm" |
| | | } |
| | | } |
| | | console.log(basic.value.input) |
| | | request.post(`/basicData/addBasicData`, basic.value).then(res => { |
| | | if (res.data) { |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | |
| | | }) |
| | | } |
| | | const updateBasicData = () =>{ |
| | | if(basic.value.basicType[1]==="hollowThickness"||basic.value.basicType[1]==="stuffThickness"||basic.value.basicType[1]==="InterlayerThickness"){ |
| | | if(!basic.value.input.includes("mm")){ |
| | | basic.value.input=basic.value.input+"mm" |
| | | } |
| | | } |
| | | let submitArr = props.rowIndex |
| | | submitArr.basicType = basic.value.basicType[0] |
| | | submitArr.basicCategory = basic.value.basicType[1] |
| | | submitArr.basicName = basic.value.input |
| | | submitArr.nickname = basic.value.nickname |
| | | request.post(`/basicData/updateBasicData`, submitArr).then(res => { |
| | | if (res.data) { |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="4">{{ $t('orderBasicData.alias') }}:</el-col> |
| | | <el-col :span="12"> |
| | | <el-input v-model="basic.nickname"/> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="4"></el-col> |
| | | <el-col :span="12"> |
| | | <el-button v-show="!props.rowIndex" @click="saveBasicData" type="primary">{{ $t('basicData.insert') }}</el-button> |