¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div v-if="display"> |
| | | <!-- 第äºå±å¯¹è¯æ¡,èªå®ä¹åç
§é
ç½®Formç»ä»¶ --> |
| | | <refer-config-form-dialog |
| | | ref="referConfigFormDialog" |
| | | @echoReferConfig="echoReferConfig"> |
| | | </refer-config-form-dialog> |
| | | <!-- 第äºå±å¯¹è¯æ¡,ç´æ¥éæ©åç
§é
ç½®crudç»ä»¶ --> |
| | | <refer-config-crud-dialog |
| | | ref="referConfigCrudDialog" |
| | | @openReconfigInterFace="openReconfigInterFace" |
| | | @echoReferConfig="echoReferConfig"> |
| | | </refer-config-crud-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import referConfigFormDialog from "./referConfigFormDialog.vue"; |
| | | import referConfigCrudDialog from "./referConfigCrudDialog.vue"; |
| | | import func from "@/util/func"; |
| | | export default { |
| | | name: "referConfigDialog", |
| | | props: ["referConfigOption","display"], |
| | | components: {referConfigFormDialog, referConfigCrudDialog}, |
| | | data() { |
| | | return { |
| | | }; |
| | | }, |
| | | watch:{ |
| | | referConfigOption (){ |
| | | console.log(111) |
| | | if(func.notEmpty(this.referConfigOption.referConfig) || func.notEmpty(this.referConfigOption.referBtmId)){ |
| | | this.openReconfigInterFace(this.referConfigOption); |
| | | }else{ |
| | | this.openTipsChooseOrCust(); |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | echoReferConfig(value) { |
| | | this.emitData = value; |
| | | }, |
| | | // å½åå·²åå¨ç¼è¾è¿çåç
§é
ç½®ï¼æä»¥ç´æ¥æå¼åç
§é
ç½®çé¢ |
| | | openReconfigInterFace(preReferConfigForm){ |
| | | const form = preReferConfigForm; |
| | | let data = { |
| | | referTypeName: form.referBtmName || '', |
| | | referType: form.referBtmId || '', |
| | | } |
| | | if(this.referConfigOption.referConfig){ |
| | | // ç¼è¾ç 段æ¶referConfigå¯è½ä¼å¨ä¸ºãåç
§å¼ç¨çä¸å¡ç±»åãéåå¼ä¹åæ¹å |
| | | let referConfigValue =JSON.parse(form.referConfig); |
| | | if(referConfigValue.referType != form.referBtmId && data.referType){ |
| | | referConfigValue.referType = form.referBtmId || ''; |
| | | referConfigValue.referTypeName = form.referBtmName || form.referBtmId; |
| | | this.referConfigOption.referConfig = JSON.stringify(referConfigValue); |
| | | } |
| | | this.$set(data,"referConfig",this.referConfigOption.referConfig) |
| | | } |
| | | // 馿¬¡ç¹å»æ¥éæªå®ä¹ |
| | | this.$nextTick(()=>{ |
| | | this.$refs.referConfigFormDialog.isShowReferConfigForm = true; |
| | | this.$refs.referConfigFormDialog.initPageData(data); |
| | | }) |
| | | }, |
| | | // æå¼èªå®ä¹åç
§é
ç½®æç´æ¥éæ©åç
§é
ç½®çæç¤ºæ¡ |
| | | openTipsChooseOrCust(){ |
| | | this.$confirm('è¯·éæ©åç
§é
ç½®çå®ä¹æ¹å¼ï¼','åç
§é
ç½®çæ¹å¼', { |
| | | distinguishCancelAndClose: true, |
| | | closeOnClickModal: false, |
| | | confirmButtonText: 'èªå®ä¹åç
§é
ç½®', |
| | | cancelButtonText: 'ç´æ¥éæ©åç
§é
ç½®' |
| | | }) |
| | | .then(() => { |
| | | // æå¼èªå®åç
§é
ç½®å¯¹è¯æ¡ |
| | | this.$refs.referConfigFormDialog.isShowReferConfigForm = true; |
| | | }) |
| | | .catch(action => { |
| | | if (action === "cancel") { |
| | | // æå¼ç´æ¥éæ©åç
§é
ç½®å¯¹è¯æ¡ |
| | | this.$refs.referConfigCrudDialog.isShowReferConfigCrud = true; |
| | | |
| | | } |
| | | }); |
| | | }, |
| | | /* å¼ç¨ç 段åç
§é
ç½®,åç»ä»¶å¡«å®åç
§é
ç½®ä¹åå
容忾æ¶è°ç¨ */ |
| | | echoReferConfig(content){ |
| | | this.$emit('setReferConfigValue', content) // 触åupdate:dataå°åç»ä»¶å¼ä¼ éç»ç¶ç»ä»¶ |
| | | }, |
| | | |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | |
| | | </style> |