瀏覽代碼

提交相关代码

Lijy 11 月之前
父節點
當前提交
0985303a11

+ 16 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/component/information.vue

@@ -132,6 +132,7 @@ const transferValue = ref('')
 const transferOptions = ref<personnelInterface[]>([])
 const generateFormValue = ref({})
 const generateForm = ref<typeof GenerateForm>() // 自定义表单dom
+const productTableListValue = ref<any[]>([])
 const contactsId = ref('')
 const contactsList = ref<optionType[]>([])
 const allVisible = reactive({
@@ -196,17 +197,16 @@ function transferBusiness() {
 
 function claimBusiness() {
     confirmAction(`确定认领【${information.value.name}】商机吗?`).then(() => {
-        console.log('执行认领')
+        transferBusiness()
     })
 }
 
 function editBusiness() {
-    console.log('点击了保存')
-    return
     generateForm.value?.getData().then((res: any) => {
         let formVal = {
             ...res,
             expectedTransactionDate: res.expectedTransactionDate ? formatDateTime(new Date(res.expectedTransactionDate)) : '',
+            businessItemProductList: JSON.stringify(productTableListValue.value)
         }
         allLoading.businessSaveLading = true
         post(UPDATEINSET, { ...formVal }).then((_res) => {
@@ -222,10 +222,23 @@ function editBusiness() {
     })
 }
 
+function editProductShow() {
+    const productList = information.value.businessItemProducts || []
+    const list = productList.map((item: any) => {
+        const { id, productName, productId, productCode, unit, unitName, typeName, type, price, inventory, orderProductDetail, num, discount, sealPrice, totalPrice, quantity } = item
+        return {
+            id, productId: productId, productName, productCode, unit, unitName, typeName, type, price, inventory,
+            num, discount, sealPrice, totalPrice, quantity
+        }
+    })
+    productTableListValue.value = list
+}
+
 function showVisible(type: keyof typeof allVisible) {
     if (type == 'editBusinessVisible') {
         const { name, customerId, contactsId, amountOfMoney, expectedTransactionDate, stageId, inchargerId, remark } = information.value
         generateFormValue.value = { name, customerId, contactsId, amountOfMoney, expectedTransactionDate, stageId, inchargerId, remark }
+        editProductShow()
     }
     allVisible[type] = true
 }

+ 1 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/component/products.vue

@@ -83,9 +83,8 @@ function editProduct() {
     })
     const { id, name, customerId, contactsId, amountOfMoney, expectedTransactionDate, stageId, inchargerId, remark } = information.value
     const formData = { id, name, customerId, contactsId, amountOfMoney, expectedTransactionDate, stageId, inchargerId, remark }
-    console.log(productTableListData, '<===== 将要提交的数据', formData)
     allLoading.editProductLoading = true
-    post(UPDATEINSET, { ...formData }).then((_res) => {
+    post(UPDATEINSET, { ...formData, businessItemProductList: JSON.stringify(productTableListData) }).then((_res) => {
         allVisible.editProductVisible = false
         globalPopup?.showSuccess('操作成功')
         emits('refreshData')

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/detail/index.vue

@@ -68,7 +68,7 @@
 
       <div class="w-full h-auto flex justify-between mt-2">
         <div class="bg-white shadow-md rounded-md w-full">
-          <Products :information="businessInfo" />
+          <Products :information="businessInfo" @refreshData="getDetail" />
         </div>
       </div>
     </div>

+ 3 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/api.ts

@@ -13,4 +13,6 @@ export const URL_ROWBACK = `${PREFIX}/rollback`
 export const URL_THOROUGHLYDETELE = `${PREFIX}/reallyDelete`
 export const URL_CLAIM = `${PREFIX}/claim`
 export const URL_FETALL = `${PREFIX}/getAll`
-export const URL_GETDETAIL = `${PREFIX}/getInfo`
+export const URL_GETDETAIL = `${PREFIX}/getInfo`
+export const URL_IMPORTEXELS = `${PREFIX}/importData`
+export const URL_EXPORTEXELS = `${PREFIX}/exportData`

文件差異過大導致無法顯示
+ 184 - 17
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/information.vue


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

@@ -16,7 +16,7 @@
     <div class="flex-1 flex flex-col overflow-y-auto overflow-x-hidden scroll-bar" v-loading="allLoading.customerDetailLoading">
       <div class="w-full h-auto flex justify-between">
         <div class="bg-white shadow-md rounded-md" style="width: 46%;">
-          <Information />
+          <Information :data="information" @refreshData="getDetail" />
         </div>
         <div class="bg-white ml-2 shadow-md rounded-md flex-1">
           <Attachment />
@@ -70,6 +70,7 @@ import RelatedBusiness from '../component/relatedBusiness.vue';
 import RelatedContacts from "../component/relatedContacts.vue";
 import RelatedOrders from "../component/relatedOrders.vue"
 import { number } from "echarts";
+import { formatDate } from "@/utils/times";
 
 const route = useRoute()
 const globalPopup = inject<GlobalPopup>('globalPopup')
@@ -84,6 +85,7 @@ const allLoading = reactive({
 function getDetail() {
   allLoading.customerDetailLoading = true
   post(URL_GETDETAIL, { id: values.value }).then((res) => {
+    res.data.newCreateTime = formatDate(new Date(res.data.createTime)),
     information.value = res.data
   }).finally(() => {
     allLoading.customerDetailLoading = false

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

@@ -174,7 +174,7 @@
 
 <script lang="ts" setup>
 import { ref, reactive, onMounted, inject } from "vue";
-import { MOD, GETSYSFILED, GETPERSONNEL, URL_TABLELIST, URL_TEMPLALE, URL_EDITSAVE, URL_DETELER, URL_CLAIM, IMPORTMOD, GETALLCLUE } from './api.ts'
+import { MOD, GETSYSFILED, GETPERSONNEL, URL_TABLELIST, URL_TEMPLALE, URL_EDITSAVE, URL_DETELER, URL_CLAIM, IMPORTMOD, GETALLCLUE, URL_IMPORTEXELS, URL_EXPORTEXELS } from './api.ts'
 import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, getLastDayOfMonth, formatDate, getTemplateKey, createTaskFromType, confirmAction, downloadFile, downloadTemplate } from '@/utils/tools'
 import { post, get, uploadFile } from "@/utils/request";
 import { useRouter, useRoute } from "vue-router";
@@ -280,7 +280,7 @@ async function importBusiness(param: UploadRequestOptions) {
   allLoading.importLoading = true
   const formData = new FormData();
   formData.append('multipartFile', param.file)
-  const res = await uploadFile('接口名称', formData).finally(() => {
+  const res = await uploadFile(URL_IMPORTEXELS, formData).finally(() => {
     allLoading.importLoading = false
   })
   if (res.code == 'ok') {
@@ -294,7 +294,7 @@ async function importBusiness(param: UploadRequestOptions) {
 function exportCustomerTableList() {
   allLoading.exoprtLoading = true
   let valueForm = getFromValue(customerCriteriaForm)
-  post('接口名称', { ...valueForm }).then((res) => {
+  post(URL_EXPORTEXELS, { ...valueForm }).then((res) => {
     downloadFile(res.data, allText.exportText)
   }).finally(() => {
     allLoading.exoprtLoading = false