| | |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | let userInfo = useUserInfo() |
| | | let props = defineProps({ |
| | | productFlag:null |
| | | }) |
| | | |
| | | let emit = defineEmits([ |
| | | 'getProductRow' |
| | | ]) |
| | | |
| | | const disposeList = $ref([ |
| | | t('product.coloredGlaze'), |
| | | t('product.frostedSand'), |
| | |
| | | item.separation = JSON.parse(item.separation) |
| | | }) |
| | | productTotal.value = res.data.title |
| | | productGlassTypeStore.GlassType =[res.data.title.typeId.substring(0,2),res.data.title.typeId] |
| | | if(res.data.title.typeId.length===2){ |
| | | productGlassTypeStore.GlassType =[res.data.title.typeId.substring(0,2)] |
| | | }else{ |
| | | productGlassTypeStore.GlassType =[res.data.title.typeId.substring(0,2),res.data.title.typeId] |
| | | } |
| | | |
| | | //BasicData.value = res.data |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | |
| | | ElMessage.warning(t('product.msg.glassType')) |
| | | return |
| | | } |
| | | productTotal.value.typeId = productGlassTypeStore.GlassType[1] |
| | | if(productGlassTypeStore.GlassType[1]!==undefined){ |
| | | productTotal.value.typeId = productGlassTypeStore.GlassType[1] |
| | | }else{ |
| | | productTotal.value.typeId = productGlassTypeStore.GlassType[0] |
| | | } |
| | | |
| | | |
| | | let productName = "" |
| | | productDetailList.value.forEach(item =>{ |
| | |
| | | productTotal.value.id = null |
| | | productTotal.value.state = 0 |
| | | } |
| | | if(productTotal.value.id != null |
| | | && |
| | | productTotal.value.creator !== userInfo.user.userName |
| | | & company.notChangeProduct |
| | | ){ |
| | | ElMessage.warning(t('product.msg.msg1')+productTotal.value.creator+t('product.msg.msg2')) |
| | | return; |
| | | } |
| | | |
| | | let product = { |
| | | title: productTotal.value, |
| | |
| | | } |
| | | |
| | | const saveProducts=(product)=>{ |
| | | request.post(`/product/saveProduct`,product).then((res) =>{ |
| | | if(props.productFlag===false){ |
| | | product.title.state = 1 |
| | | } |
| | | request.post(`/product/saveProduct/${userInfo.user.userName}`,product).then((res) =>{ |
| | | if(res.code==200){ |
| | | ElMessage.success(t('product.msg.saveSuccess')) |
| | | router.push("/main/product/selectProduct") |
| | | if(props.productFlag===false){ |
| | | emit('changePage') |
| | | }else{ |
| | | router.push("/main/product/selectProduct") |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //审核产品状态 |
| | | const updateProductState = (state) => { |
| | | request.post(`/product/updateProductStateById/${productTotal.value.id}/${state}`).then((res) =>{ |
| | | if(productTotal.value.id!==null && productTotal.value.creator!==userInfo.user.userName && company.notChangeProduct){ |
| | | ElMessage.warning(t('product.msg.msg1')+productTotal.value.creator+t('product.msg.msg2')) |
| | | return; |
| | | } |
| | | request.post(`/product/updateProductStateById/${productTotal.value.id}/${state}/${userInfo.user.userName}`).then((res) =>{ |
| | | if(res.code==200){ |
| | | ElMessage.success(t('product.msg.operateSuccess')) |
| | | //router.go(0) |
| | |
| | | const glassSure = () => { |
| | | let childName = '' |
| | | Object.keys(stuff.value).forEach((item,index)=>{ |
| | | childName+=stuff.value[item] |
| | | if(stuff.value[item]!==undefined){ |
| | | childName+=stuff.value[item] |
| | | } |
| | | |
| | | }) |
| | | let rege = /^\s*$/ |
| | | if(rege.test(childName) || processChecked.value.length===0){ |
| | |
| | | let childName = '' |
| | | try { |
| | | Object.keys(hollowBasic.value).forEach((item, index) => { |
| | | if (hollowBasic.value[item] === '' && item !== 'GlueDepth') { |
| | | if ((hollowBasic.value[item] === ''||hollowBasic.value[item]===undefined) && item !== 'GlueDepth') { |
| | | throw new Error(t('product.msg.HollowReview')) |
| | | } |
| | | childName += hollowBasic.value[item] |
| | | if(hollowBasic.value[item]!==undefined){ |
| | | childName += hollowBasic.value[item] || '' |
| | | } |
| | | |
| | | }) |
| | | }catch (e){ |
| | | ElMessage.warning(e.message) |
| | |
| | | let childName = '' |
| | | try { |
| | | Object.keys(InterlayerBasic.value).forEach((item, index) => { |
| | | if (InterlayerBasic.value[item] === '') { |
| | | if ((InterlayerBasic.value[item] === ''||InterlayerBasic.value[item]===undefined) && item !== 'color') { |
| | | throw new Error(t('product.msg.InterlayerReview')) |
| | | } |
| | | childName += InterlayerBasic.value[item] |
| | | if(InterlayerBasic.value[item]!==undefined){ |
| | | childName += InterlayerBasic.value[item] |
| | | } |
| | | |
| | | }) |
| | | }catch (e){ |
| | | ElMessage.warning(e.message) |
| | |
| | | break |
| | | } |
| | | case 'hollow' :{ |
| | | productName+='*'+item.detail+"*" |
| | | productName+=company.hollow + item.detail + company.hollow |
| | | break |
| | | } |
| | | } |
| | |
| | | </el-col> |
| | | <el-col :span="13"> |
| | | <div class="grid-content ep-bg-purple" > |
| | | <el-input :value="stuff.thickness+stuff.color+stuff.craft+stuff.position+stuff.lowE" size="small" disabled /> |
| | | <el-input :value="Object.values({...stuff, |
| | | thickness: stuff.thickness, |
| | | color: stuff.color, |
| | | craft: stuff.craft, |
| | | position: stuff.position, |
| | | lowE: stuff.lowE |
| | | }).filter(val => val !== null && val !== '').join('')" size="small" disabled /> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <div class="grid-content ep-bg-purple" > |
| | | <el-input :value="productName" size="large" disabled /> |
| | | <el-input :value="productName" size="large" readonly /> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | margin-left: 0.5rem;" |
| | | size="large" |
| | | type="primary" |
| | | round>{{"复制"}}</el-button> |
| | | round>{{$t('basicData.copy')}}</el-button> |
| | | <el-button |
| | | :disabled="productTotal.state===1" |
| | | @click="saveProduct(null)" |