| | |
| | | |
| | | }) |
| | | |
| | | const saveProduct = () => { |
| | | const saveProduct = (type) => { |
| | | if(productDetailList.value.length===0){ |
| | | ElMessage.warning(t('product.msg.productLength')) |
| | | return |
| | |
| | | }) |
| | | productTotal.value.productName=productName |
| | | productTotal.value.productAbbreviation=productTotal.value.productAbbreviation.trim() |
| | | if(type==='copy'){ |
| | | productTotal.value.id = null |
| | | productTotal.value.state = 0 |
| | | } |
| | | |
| | | let product = { |
| | | title: productTotal.value, |
| | | detail:productDetailList.value |
| | |
| | | }) |
| | | return productName |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | </div> |
| | | <el-button |
| | | v-if="productTotal.state===1" |
| | | @click="saveProduct('copy')" |
| | | style="float: left; |
| | | margin-left: 0.5rem;" |
| | | size="large" |
| | | type="primary" |
| | | round>{{"复制"}}</el-button> |
| | | <el-button |
| | | :disabled="productTotal.state===1" |
| | | @click="saveProduct" |
| | | @click="saveProduct(null)" |
| | | style="float: right; |
| | | margin-right: 0.5rem;" |
| | | size="large" |