diff --git a/sub-government-affairs-service/src/store/modules/coop.js b/sub-government-affairs-service/src/store/modules/coop.js new file mode 100644 index 0000000..b87a2f5 --- /dev/null +++ b/sub-government-affairs-service/src/store/modules/coop.js @@ -0,0 +1,15 @@ +import { defineStore } from 'pinia'; +import { getEnterList } from '@/apis/businessEntity'; + +export const useCoop = defineStore('useCoop', { + state: () => ({ + data: {}, + }), + actions: { + //订单 + getData(params) { + return Promise.resolve((useCoop().$state.data = params)); + }, + }, + getters: {}, +}); diff --git a/sub-government-affairs-service/src/views/productOperateMain/coOp/components/TabBasicInfo.vue b/sub-government-affairs-service/src/views/productOperateMain/coOp/components/TabBasicInfo.vue index a7f06d0..14f0296 100644 --- a/sub-government-affairs-service/src/views/productOperateMain/coOp/components/TabBasicInfo.vue +++ b/sub-government-affairs-service/src/views/productOperateMain/coOp/components/TabBasicInfo.vue @@ -32,6 +32,7 @@ + @@ -72,6 +73,8 @@ import cloneDeep from 'lodash/cloneDeep'; import { CommonUpload } from '@/apis/index'; import { ElMessage } from 'element-plus'; import Attrs from './Attrs.vue'; +import { useCoop } from '../../../../store/modules/coop'; +const localForm = useCoop().$state.data; const props = defineProps({ modelValue: { @@ -79,7 +82,7 @@ const props = defineProps({ required: true, default: () => ({}), }, - readonly: Boolean, + // readonly: Boolean, }); const ossUrl = 'http://gov-cloud.oss-cn-chengdu.aliyuncs.com/'; @@ -89,16 +92,16 @@ const businessLicenceList = ref([]); const emit = defineEmits(['update:modelValue']); // 建立本地副本,避免直接修改 props -const localForm = ref({ ...props.modelValue }); +// const localForm = ref({ ...props.modelValue }); // 深度监听本地副本的变化,实时更新父组件 -watch( - localForm, - (newVal) => { - emit('update:modelValue', { ...newVal }); - }, - { deep: true } -); +// watch( +// localForm, +// (newVal) => { +// emit('update:modelValue', { ...newVal }); +// }, +// { deep: true } +// ); // watch( // () => props.modelValue, // (newVal) => { @@ -151,21 +154,21 @@ const handleExceed = () => { }; // 初始化时如果有图片,设置预览 -if (localForm.value.cooperativePhoto) { +if (localForm.cooperativePhoto) { cooperativePhotoList.value = [ { name: '合作社照片', - url: ossUrl + localForm.value.cooperativePhoto, + url: ossUrl + localForm.cooperativePhoto, status: 'success', }, ]; } -if (localForm.value.businessLicence) { +if (localForm.businessLicence) { businessLicenceList.value = [ { name: '营业执照', - url: ossUrl + localForm.value.businessLicence, + url: ossUrl + localForm.businessLicence, status: 'success', }, ]; diff --git a/sub-government-affairs-service/src/views/productOperateMain/coOp/components/TabBusinessInfo.vue b/sub-government-affairs-service/src/views/productOperateMain/coOp/components/TabBusinessInfo.vue index 2d829c1..c92b8a2 100644 --- a/sub-government-affairs-service/src/views/productOperateMain/coOp/components/TabBusinessInfo.vue +++ b/sub-government-affairs-service/src/views/productOperateMain/coOp/components/TabBusinessInfo.vue @@ -71,6 +71,8 @@ import { reactive, watch } from 'vue'; import { Plus } from '@element-plus/icons-vue'; import cloneDeep from 'lodash/cloneDeep'; +import { useCoop } from '../../../../store/modules/coop'; +const localForm = useCoop().$state.data; const props = defineProps({ modelValue: { @@ -86,23 +88,23 @@ const props = defineProps({ const emit = defineEmits(['update:modelValue']); // 本地副本,存放各表的文件列表 -const localForm = reactive(cloneDeep(props.modelValue)); +// const localForm = reactive(cloneDeep(props.modelValue)); // watch 同步回父组件 -watch( - () => localForm, - (val) => { - emit('update:modelValue', { ...val }); - }, - { deep: true } -); -watch( - () => props.modelValue, - (newVal) => { - Object.assign(localForm, cloneDeep(newVal)); - }, - { deep: true } -); +// watch( +// () => localForm, +// (val) => { +// emit('update:modelValue', { ...val }); +// }, +// { deep: true } +// ); +// watch( +// () => props.modelValue, +// (newVal) => { +// Object.assign(localForm, cloneDeep(newVal)); +// }, +// { deep: true } +// ); // 下载模板(可替换为真实下载地址) function downloadTemplate(type) { diff --git a/sub-government-affairs-service/src/views/productOperateMain/coOp/components/TabCreditEvaluation.vue b/sub-government-affairs-service/src/views/productOperateMain/coOp/components/TabCreditEvaluation.vue index 572772d..f84a48f 100644 --- a/sub-government-affairs-service/src/views/productOperateMain/coOp/components/TabCreditEvaluation.vue +++ b/sub-government-affairs-service/src/views/productOperateMain/coOp/components/TabCreditEvaluation.vue @@ -28,6 +28,8 @@