| | |
| | | input:'' |
| | | }) |
| | | let options=ref([ |
| | | { label: "库存组织", |
| | | { label: t('mainIngredientStock.inventoryOrganization'), |
| | | value: "inventoryOrganization", |
| | | }, |
| | | { label: "领出", |
| | | { label: t('mainBasicData.takeOut'), |
| | | value: "takeOut", |
| | | }, |
| | | { label: "材料出库类型", |
| | | { label: t('mainIngredientStock.materialOutboundType'), |
| | | value: "outboundType", |
| | | }, |
| | | { label: "材料返库类型", |
| | | { label: t('mainIngredientStock.materialReturnType'), |
| | | value: "returningType", |
| | | }, |
| | | ]) |
| | |
| | | const emit = defineEmits(['gaveParent']) |
| | | const saveBasicData = () =>{ |
| | | if (basic.value.operateType[0]==='inventoryOrganization'){ |
| | | basic.value.type='库存组织' |
| | | basic.value.type=t('mainIngredientStock.inventoryOrganization') |
| | | } |
| | | else if(basic.value.operateType[0]==='takeOut'){ |
| | | basic.value.type='领出' |
| | | basic.value.type=t('mainBasicData.takeOut') |
| | | } |
| | | else if(basic.value.operateType[0]==='outboundType'){ |
| | | basic.value.type='材料出库类型' |
| | | basic.value.type=t('mainIngredientStock.materialOutboundType') |
| | | } |
| | | else if(basic.value.operateType[0]==='returningType'){ |
| | | basic.value.type='材料返库类型' |
| | | basic.value.type=t('mainIngredientStock.materialReturnType') |
| | | } |
| | | if(basic.value.operateType[0]==='' || basic.value.input===''){ |
| | | return |
| | | } |
| | | request.post(`/BasicWarehouse/addBasicWarehouse`, basic.value).then(res => { |
| | | if (res.data) { |
| | | ElMessage.success('保存成功') |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | emit('gaveParent', true) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error('系统错误') |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | } |
| | |
| | | submitArr.type = basic.value.type |
| | | submitArr.operateTypeName = basic.value.input |
| | | if(basic.value.input===''){ |
| | | ElMessage.warning('请输入数据') |
| | | ElMessage.warning(t('mainIngredient.pleaseEnterData')) |
| | | }else{ |
| | | request.post(`/BasicWarehouse/updateBasicWarehouse`, submitArr).then(res => { |
| | | if (res.data) { |
| | | ElMessage.success('修改成功') |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | emit('gaveParent', true) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error('系统错误') |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | } |
| | |
| | | <template> |
| | | <div> |
| | | <el-row> |
| | | <el-col :span="4">基础类型:</el-col> |
| | | <el-col :span="4">{{$t('orderBasicData.basicType')}}:</el-col> |
| | | <el-col :span="12"> |
| | | <el-cascader |
| | | v-model="basic.operateType" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="4">名称:</el-col> |
| | | <el-col :span="4">{{$t('orderBasicData.name')}}:</el-col> |
| | | <el-col :span="12"> |
| | | <el-input v-model="basic.input"/> |
| | | </el-col> |
| | |
| | | <el-row> |
| | | <el-col :span="4"></el-col> |
| | | <el-col :span="12"> |
| | | <el-button v-show="!props.rowIndex" @click="saveBasicData" type="primary">新增</el-button> |
| | | <el-button v-show="props.rowIndex" @click="updateBasicData" type="primary">修改</el-button> |
| | | <el-button v-show="!props.rowIndex" @click="saveBasicData" type="primary">{{$t('basicData.insert')}}</el-button> |
| | | <el-button v-show="props.rowIndex" @click="updateBasicData" type="primary">{{$t('basicData.update')}}</el-button> |
| | | |
| | | </el-col> |
| | | </el-row> |