Jelajahi Sumber

提交相关代码

Lijy 1 tahun lalu
induk
melakukan
7bbf7538e0

+ 17 - 33
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/operationRecord.vue

@@ -5,45 +5,29 @@
         </div>
         <div class="flex-1 overflow-auto pt-5">
             <el-table :data="operationRecordtable" border style="width: 100%;height: 278px;">
-                <el-table-column prop="operatingTime" label="操作时间" width="140" />
-                <el-table-column prop="operator" label="操作人" width="120" />
-                <el-table-column prop="operationContent" label="操作内容" />
+                <el-table-column prop="creaTime" label="操作时间" width="140" />
+                <el-table-column prop="username" label="操作人" width="120" />
+                <el-table-column prop="name" label="操作内容" />
             </el-table>
         </div>
     </div>
 </template>
 <script lang="ts" setup>
-import { ref, reactive, onMounted, onUnmounted, defineExpose, inject } from 'vue'
+import { ref, reactive, onMounted, onUnmounted, defineExpose, inject, watchEffect } from 'vue'
+
+const operationRecordtable = ref([])
+const information = ref({})
+
+const props = defineProps<{
+    data: any
+}>()
+
+watchEffect(() => {
+    const { data } = props
+    information.value = data
+    operationRecordtable.value = data.actionLogs || []
+})
 
-const operationRecordtable = ref([{
-    operationContent: '转移线索',
-    operator: '张三',
-    operatingTime: '2024-04-01',
-}, {
-    operationContent: '转移线索',
-    operator: '张三',
-    operatingTime: '2024-04-01',
-}, {
-    operationContent: '转移线索',
-    operator: '张三',
-    operatingTime: '2024-04-01',
-}, {
-    operationContent: '转移线索',
-    operator: '张三',
-    operatingTime: '2024-04-01',
-}, {
-    operationContent: '转移线索',
-    operator: '张三',
-    operatingTime: '2024-04-01',
-}, {
-    operationContent: '转移线索',
-    operator: '张三',
-    operatingTime: '2024-04-01',
-}, {
-    operationContent: '转移线索',
-    operator: '张三',
-    operatingTime: '2024-04-01',
-},])
 // 生命周期钩子
 onMounted(() => {
 });

+ 142 - 45
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedBusiness.vue

@@ -3,7 +3,7 @@
         <div class="flex justify-between">
             <div class="title">相关商机</div>
             <div>
-                <el-button type="primary">新建商机</el-button>
+                <el-button type="primary" @click="editNewBusiness()">新建商机</el-button>
             </div>
         </div>
         <div class="flex-1 overflow-auto pt-3">
@@ -25,56 +25,153 @@
                 <el-table-column prop="endTime" label="修改时间" width="130" />
             </el-table>
         </div>
+
+        <el-dialog v-model="allVisible.newBusinessisible" width="1000" :show-close="false" top="10vh">
+            <template #header="{ close, titleId, titleClass }">
+                <div class="flex justify-between items-center border-b pb-3 dialog-header">
+                    <h4 :id="titleId">{{ '新建商机' }}</h4>
+                    <div>
+                        <el-button type="primary" @click="editBusiness(false)" :loading="allLoading.businessSaveLading"
+                            :disabled="allLoading.newBusinessSaveLading">保存</el-button>
+                        <el-button @click="closeVisible('newBusinessisible')">取消</el-button>
+                    </div>
+                </div>
+            </template>
+            <div class="h-[60vh] overflow-y-auto scroll-bar pt-3" v-loading="allLoading.generateFormLading">
+                <GenerateForm ref="businessTemplateRef" :data="businessTemplate" :value="businessTemplateValue"
+                    :key="businessTemplateKey" />
+                <div>相关产品</div>
+                <RelatedProducts ref="relatedProductsRef" :productTableList="productTableList"
+                    :productTableListValue="productTableListValue" />
+            </div>
+        </el-dialog>
     </div>
 </template>
 <script lang="ts" setup>
-import { ref, reactive, onMounted, onUnmounted, defineExpose, inject } from 'vue'
+import { get, post } from '@/utils/request';
+import { ref, reactive, onMounted, onUnmounted, defineExpose, inject, watchEffect } from 'vue'
+import { GenerateForm } from '@zmjs/form-design';
+import RelatedProducts from '@/components/relatedProducts/relatedProducts.vue'
+import { GETTABLELIST } from '@/pages/product/api';
+import { GETGENERATEFOEM, UPDATEINSET } from '@/pages/business/api';
+import { setTemplateDataDisable } from '@/utils/tools';
+import { formatDateTime } from '@/utils/times';
+
+const emits = defineEmits(['refreshData']);
+const globalPopup = inject<GlobalPopup>('globalPopup')
+const props = defineProps<{
+    data: any
+}>()
+
+const information = ref<any>({})
+const relatedTaskstable = ref([])
+const relatedProductsRef = ref<typeof RelatedProducts>()
+const businessTemplateRef = ref<typeof GenerateForm>() // 自定义表单dom
+const businessTemplateValue = ref({})
+const businessTemplateKey = ref(1)
+const productTableList = ref([])
+const productTableListValue = ref([])
+const businessTemplate = ref({
+    config: {},
+    list: []
+}) // 自定义表单数据
+const allVisible = reactive({
+    newBusinessisible: false
+})
+const allLoading = reactive({
+    generateFormLading: false,
+    newBusinessSaveLading: false,
+    businessSaveLading: false
+})
+
+function editBusiness(visibles: boolean) {
+    businessTemplateRef.value?.getData().then((res: any) => {
+        let productTableListData = relatedProductsRef?.value?.returnData() || []
+        productTableListData.forEach((item: any) => {
+            delete item.id
+        })
+        let newForm = {
+            ...res,
+            expectedTransactionDate: res.expectedTransactionDate ? formatDateTime(new Date(res.expectedTransactionDate)) : '',
+            businessItemProductList: productTableListData ? JSON.stringify(productTableListData) : []
+        }
+        allLoading.businessSaveLading = true
+        post(UPDATEINSET, { ...businessTemplateValue.value, ...newForm }).then((_res) => {
+            allVisible.newBusinessisible = visibles
+            globalPopup?.showSuccess('保存成功')
+            emits('refreshData')
+        }).finally(() => {
+            allLoading.businessSaveLading = false
+        })
+    }).catch((_err: any) => {
+        console.log(_err)
+        globalPopup?.showError('请填写完整')
+    })
+}
+
+function editNewBusiness() {
+    showVisible('newBusinessisible')
+    allLoading.generateFormLading = true
+    businessTemplateValue.value = { customerId: information.value.id }
+    productTableListValue.value = []
+    setTimeout(() => {
+        businessTemplateRef.value && businessTemplateRef.value.reset()
+        businessTemplateKey.value++
+        allLoading.generateFormLading = false
+    }, 500)
+}
+
+async function getSystemField() {
+    const datas = await get(GETGENERATEFOEM)
+    let newConfig = JSON.parse(datas.data[0].config)
+    newConfig.list = setTemplateDataDisable(newConfig.list, ['customerId'])
+    businessTemplate.value = newConfig
+}
+
+function showVisible(type: keyof typeof allVisible) {
+    allVisible[type] = true
+}
+
+function closeVisible(type: keyof typeof allVisible) {
+    allVisible[type] = false
+}
+
+function getProductTableList() {
+    post(GETTABLELIST, { pageIndex: -1, pageSize: -1 }).then((res) => {
+        if (res.code == 'ok') {
+            const { record, total } = res.data
+            productTableList.value = record.map((item: any) => {
+                const { id, productName, productCode, unit, unitName, typeName, type, price, inventory } = item
+                return {
+                    id,
+                    productId: id,
+                    productName,
+                    productCode,
+                    unit,
+                    unitName,
+                    price,
+                    type,
+                    typeName,
+                    inventory,
+                    quantity: '',
+                    discount: '',
+                    totalPrice: ''
+                }
+            })
+        }
+    })
+}
+
+watchEffect(() => {
+    const { data } = props
+    information.value = data
+    relatedTaskstable.value = []
+})
 
-const relatedTaskstable = ref([{
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}])
 // 生命周期钩子
 onMounted(() => {
+    getProductTableList()
+    getSystemField()
 });
 </script>
 <style scoped lang="scss">

+ 104 - 46
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedContacts.vue

@@ -3,11 +3,11 @@
         <div class="flex justify-between">
             <div class="title">相关联系人</div>
             <div>
-                <el-button type="primary">新建联系人</el-button>
+                <el-button type="primary" @click="editContacts(information)">新建联系人</el-button>
             </div>
         </div>
         <div class="flex-1 overflow-auto pt-3">
-            <el-table :data="relatedTaskstable" border style="width: 100%;height: 300px;">
+            <el-table :data="relatedCustomertable" border style="width: 100%;height: 300px;">
                 <el-table-column label="序号" width="80">
                     <template #default="scope">
                         {{ scope.$index + 1 }}
@@ -29,56 +29,114 @@
                 <el-table-column prop="endTime" label="创建时间" width="130" />
             </el-table>
         </div>
+
+        <!-- 弹窗 -->
+        <el-dialog v-model="allVisible.editContactsVisible" width="1000" :show-close="false" top="10vh">
+            <template #header="{ close, titleId, titleClass }">
+                <div class="flex justify-between items-center border-b pb-3 dialog-header">
+                    <h4 :id="titleId">{{ '新建联系人' }}</h4>
+                    <div>
+                        <el-button type="primary" :loading="allLoading.editContactsSaveLoading"
+                            @click="editContactsSave(false)">新建</el-button>
+                        <el-button @click="closeVisible('editContactsVisible')">取消</el-button>
+                    </div>
+                </div>
+            </template>
+            <div class="h-[60vh] overflow-y-auto scroll-bar pt-3">
+                <div class="ml-4 mr-4">
+                    <GenerateForm ref="contactsTemplateRef" :data="contactsTemplate" :value="contactsTemplateValue"
+                        :key="contactsTemplateRefKey" v-loading="allLoading.contactsTemplateRefLoading" />
+                </div>
+            </div>
+        </el-dialog>
     </div>
 </template>
 <script lang="ts" setup>
-import { ref, reactive, onMounted, onUnmounted, defineExpose, inject } from 'vue'
+import { GETGENERATEFOEM, URL_ADD } from '@/pages/contacts/api';
+import { get, post } from '@/utils/request';
+import { setTemplateDataDisable } from '@/utils/tools';
+import { GenerateForm } from '@zmjs/form-design';
+import { ref, reactive, onMounted, onUnmounted, defineExpose, inject, watchEffect } from 'vue'
+
+const emits = defineEmits(['refreshData']);
+const globalPopup = inject<GlobalPopup>('globalPopup')
+const props = defineProps<{
+    data: any
+}>()
+
+const information = ref({})
+const relatedCustomertable = ref([])
+const contactsTemplateValue = ref({})
+const contactsTemplateRefKey = ref(1)
+const contactsTemplateRef = ref<typeof GenerateForm>()
+const contactsTemplate = ref({
+    list: [],
+    config: {}
+})
+
+function editContactsSave(flag: boolean) {
+    contactsTemplateRef.value?.getData().then((res: any) => {
+        allLoading.editContactsSaveLoading = true
+        post(URL_ADD, { ...contactsTemplateValue.value, ...res }).then((_res) => {
+            allVisible.editContactsVisible = flag
+            globalPopup?.showSuccess('操作成功')
+            if (flag) {
+                contactsTemplateRef.value?.reset()
+            }
+            emits('refreshData')
+        }).finally(() => {
+            allLoading.editContactsSaveLoading = false
+        })
+    }).catch((_err: any) => {
+        console.log(_err)
+        globalPopup?.showError('请填写完整')
+    })
+}
+
+function editContacts(data: any) {
+    showVisible('editContactsVisible')
+    const { id, telPhone } = data
+    contactsTemplateValue.value = { customId: id, phone: telPhone }
+    allLoading.contactsTemplateRefLoading = true
+    setTimeout(() => {
+        contactsTemplateRefKey.value++
+        allLoading.contactsTemplateRefLoading = false
+    }, 1000);
+}
+
+const allLoading = reactive({
+    contactsTemplateRefLoading: false,
+    editContactsSaveLoading: false
+})
+
+const allVisible = reactive({
+    editContactsVisible: false,
+})
+
+watchEffect(() => {
+    const { data } = props
+    information.value = data
+    relatedCustomertable.value = []
+})
+
+async function getSystemField() {
+    const datas = await get(GETGENERATEFOEM)
+    let newConfig = JSON.parse(datas.data[0].config)
+    newConfig.list = setTemplateDataDisable(newConfig.list, ['customId'])
+    contactsTemplate.value = newConfig
+}
+
+function showVisible(type: keyof typeof allVisible) {
+    allVisible[type] = true
+}
+
+function closeVisible(type: keyof typeof allVisible) {
+    allVisible[type] = false
+}
 
-const relatedTaskstable = ref([{
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}])
 // 生命周期钩子
 onMounted(() => {
+    getSystemField()
 });
 </script>
 <style scoped lang="scss">

+ 152 - 46
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedOrders.vue

@@ -3,11 +3,11 @@
         <div class="flex justify-between">
             <div class="title">相关销售订单</div>
             <div>
-                <el-button type="primary">新建销售订单</el-button>
+                <el-button type="primary" @click="editOrder()">新建销售订单</el-button>
             </div>
         </div>
         <div class="flex-1 overflow-auto pt-3">
-            <el-table :data="relatedTaskstable" border style="width: 100%;height: 300px;">
+            <el-table :data="relatedOrders" border style="width: 100%;height: 300px;">
                 <el-table-column prop="priority" label="订单编号" width="130" />
                 <el-table-column prop="taskName" label="订单名称">
                     <template #default="scope">
@@ -27,56 +27,162 @@
                 <el-table-column prop="endTime" label="创建时间" width="130" />
             </el-table>
         </div>
+
+        <!-- 弹窗 -->
+        <el-dialog v-model="allVisible.editOrderVisible" width="1000" :show-close="false" top="10vh">
+            <template #header="{ close, titleId, titleClass }">
+                <div class="flex justify-between items-center border-b pb-3 dialog-header">
+                    <h4 :id="titleId">{{ '新建销售订单' }}</h4>
+                    <div>
+                        <el-button type="primary" :loading="allLoading.editSaveLading"
+                            @click="saveOrder(false)">保存</el-button>
+                        <el-button @click="closeVisible('editOrderVisible')">取消</el-button>
+                    </div>
+                </div>
+            </template>
+            <div class="h-[60vh] overflow-y-auto scroll-bar pt-3" v-loading="allLoading.orderTemplateLoadinng">
+                <GenerateForm ref="orderTemplateRef" :data="orderTemplate" :key="orderTemplateKey"
+                    :value="orderTemplateValue" />
+                <div>相关产品</div>
+                <RelatedProducts ref="relatedProductsRef" :productTableList="productTableList"
+                    :productTableListValue="productTableListValue" />
+            </div>
+        </el-dialog>
     </div>
 </template>
 <script lang="ts" setup>
-import { ref, reactive, onMounted, onUnmounted, defineExpose, inject } from 'vue'
+import { ref, reactive, onMounted, onUnmounted, defineExpose, inject, watchEffect } from 'vue'
+import { setTemplateDataDisable } from '@/utils/tools';
+import { GenerateForm } from '@zmjs/form-design';
+import { get, post } from '@/utils/request';
+
+import RelatedProducts from '@/components/relatedProducts/relatedProducts.vue'
+import { GETGENERATEFOEM, GETTABLELIST, URL_OEDERUPDATE } from '@/pages/order/api';
+import { formatDate } from '@/utils/times';
+
+const emits = defineEmits(['refreshData']);
+const globalPopup = inject<GlobalPopup>('globalPopup')
+const props = defineProps<{
+    data: any
+}>()
+
+const information = ref<any>({})
+const relatedOrders = ref([])
+const productTableList = ref([])
+const productTableListValue = ref([])
+const orderTemplateValue = ref({})
+const orderTemplateKey = ref(1)
+const orderTemplateRef = ref<typeof GenerateForm>()
+const relatedProductsRef = ref<typeof RelatedProducts>()
+const orderTemplate = ref({
+    list: [],
+    config: {}
+})
+const allVisible = reactive({
+    editOrderVisible: false,
+})
+const allLoading = reactive({
+    editSaveLading: false,
+    orderTemplateLoadinng: false,
+})
+
+
+
+function saveOrder(flag: boolean) {
+    orderTemplateRef.value?.getData().then((res: any) => {
+        let productTableListData = relatedProductsRef?.value?.returnData()
+        for (var i in productTableListData) {
+            productTableListData[i].sealPrice = productTableListData[i].sellingPrice,
+                productTableListData[i].discount = productTableListData[i].discount,
+                productTableListData[i].num = productTableListData[i].quantity
+        }
+        const produt = productTableListData ? JSON.stringify(productTableListData) : []
+        allLoading.editSaveLading = true
+        post(URL_OEDERUPDATE, {
+            ...orderTemplateValue.value,
+            ...res,
+            orderEndDate: res.orderEndDate ? formatDate(res.orderEndDate) : '',
+            orderStartDate: res.orderStartDate ? formatDate(res.orderStartDate) : '',
+            orderProductDetailString: produt
+        }).then((_res) => {
+            allVisible.editOrderVisible = flag
+            globalPopup?.showSuccess('操作成功')
+            if (flag) {
+                orderTemplateRef.value?.reset()
+            }
+            emits('refreshData')
+        }).finally(() => {
+            allLoading.editSaveLading = false
+        })
+    }).catch((_err: any) => {
+        globalPopup?.showError('请填写完整')
+    })
+}
+
+function editOrder() {
+    showVisible('editOrderVisible')
+    allLoading.orderTemplateLoadinng = true
+    
+    orderTemplateValue.value = { customId: information.value.id }
+    productTableListValue.value = []
+    setTimeout(() => {
+        orderTemplateRef.value && orderTemplateRef.value.reset()
+        orderTemplateKey.value++
+        allLoading.orderTemplateLoadinng = false
+    }, 1000)
+}
+
+async function getSystemField() {
+    const datas = await get(GETGENERATEFOEM)
+    let newConfig = JSON.parse(datas.data[0].config)
+    newConfig.list = setTemplateDataDisable(newConfig.list, ['customId'])
+    orderTemplate.value = newConfig
+}
+
+function showVisible(type: keyof typeof allVisible) {
+    allVisible[type] = true
+}
+
+function closeVisible(type: keyof typeof allVisible) {
+    allVisible[type] = false
+}
+
+function getProductTableList() {
+    post(GETTABLELIST, { pageIndex: -1, pageSize: -1 }).then((res) => {
+        if (res.code == 'ok') {
+            const { record, total } = res.data
+            productTableList.value = record.map((item: any) => {
+                const { id, productName, productCode, unit, unitName, typeName, type, price, inventory } = item
+                return {
+                    id,
+                    productId: id,
+                    productName,
+                    productCode,
+                    unit,
+                    unitName,
+                    price,
+                    type,
+                    typeName,
+                    inventory,
+                    quantity: '',
+                    discount: '',
+                    totalPrice: ''
+                }
+            })
+        }
+    })
+}
+
+watchEffect(() => {
+    const { data } = props
+    information.value = data
+    relatedOrders.value = []
+})
 
-const relatedTaskstable = ref([{
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}])
 // 生命周期钩子
 onMounted(() => {
+    getProductTableList()
+    getSystemField()
 });
 </script>
 <style scoped lang="scss">

+ 4 - 4
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/detail/index.vue

@@ -31,25 +31,25 @@
             @refreshData="getDetail" />
         </div>
         <div class="bg-white ml-2 shadow-md rounded-md flex-1">
-          <OperationRecord />
+          <OperationRecord :data="information" />
         </div>
       </div>
 
       <div class="w-full h-auto flex justify-between mt-2">
         <div class="bg-white shadow-md rounded-md w-full">
-          <RelatedContacts />
+          <RelatedContacts :data="information" @refreshData="getDetail" />
         </div>
       </div>
 
       <div class="w-full h-auto flex justify-between mt-2">
         <div class="bg-white shadow-md rounded-md w-full">
-          <RelatedBusiness />
+          <RelatedBusiness :data="information" @refreshData="getDetail" />
         </div>
       </div>
 
       <div class="w-full h-auto flex justify-between mt-2">
         <div class="bg-white shadow-md rounded-md w-full">
-          <RelatedOrders />
+          <RelatedOrders :data="information" @refreshData="getDetail" />
         </div>
       </div>
     </div>

+ 26 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/utils/tools.ts

@@ -237,3 +237,29 @@ export function getTemplateKey(list: Array<any>) {
   });
   return models;
 }
+
+/**
+ * 设置模板数据禁用
+ * @param list 模板数据
+ * @param fieldList 需要禁用的字段
+ * @returns 
+ */
+export function setTemplateDataDisable(list: Array<any>, fieldList: Array<any>) {
+  let result = list;
+  result.forEach((item: any) => {
+    if (item.type === 'grid') {
+      item.columns.forEach((column: any) => {
+        column.list.forEach((subItem: any) => {
+          if (fieldList.includes(subItem.model)) {
+            subItem.options.disabled = true
+          }
+        });
+      });
+    } else {
+      if (fieldList.includes(item.model)) {
+        item.options.disabled = true;
+      }
+    }
+  })
+  return result;
+}