Explorar o código

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

Guo1B0 hai 11 meses
pai
achega
e94b6c2adf

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

@@ -71,7 +71,7 @@ const pageLoading = ref(false)
 
 function getDetail() {
     pageLoading.value = true
-    post(URL_GETDETAIL, {}).then((res) => {
+    post(URL_GETDETAIL, { id: rowId.value }).then((res) => {
         console.log(res)
     }).finally(() => {
         pageLoading.value = false

+ 15 - 5
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/order/index.vue

@@ -158,9 +158,15 @@ const productTableListValue = ref([])
 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) : '',
@@ -187,12 +193,12 @@ function editOrder(item: any) {
   if (item) {
     editProduct(item)
     const templateKey = getTemplateKey(orderTemplate.value.list)
-    let formVal: templateKey = {}
+    let formVal: templateKey = { id: item.id }
     for (let i = 0; i < orderTemplate.value.list.length; i++) {
       const key = templateKey[i]
       formVal[key] = item[key]
     }
-    orderTemplateValue.value = JSON.parse(JSON.stringify(item))
+    orderTemplateValue.value = formVal
     allText.orderEditText = '编辑订单'
   }
   if (!item) {
@@ -201,7 +207,6 @@ function editOrder(item: any) {
     allText.orderEditText = '新增订单'
   }
   setTimeout(() => {
-    orderTemplateRef.value && orderTemplateRef.value.reset()
     orderTemplateKey.value++
     allLoading.orderTemplateLoadinng = false
   }, 500)
@@ -292,8 +297,13 @@ function setFilterItems() {
 function editProduct(row: any) {
   post(URL_PRODUTWITHORDER, { id: row.id }).then(({ data }) => {
     const list = data.map((item: any) => {
-      const { id, productName, productCode, unit, unitName, typeName, type, price, inventory, quantity, discount, totalPrice } = item
-      return { id, productId: id, productName, productCode, unit, unitName, typeName, type, price, inventory, quantity, discount, totalPrice }
+      const { id, productName, productCode, unit, unitName, typeName, type, price, inventory, orderProductDetail } = item
+      return { id, productId: id, productName, productCode, unit, unitName, typeName, type, price, inventory, 
+        quantity: +orderProductDetail?.num, 
+        discount: +orderProductDetail?.discount, 
+        sellingPrice: +orderProductDetail?.sealPrice,
+        totalPrice: +orderProductDetail?.totalPrice
+      }
     })
     console.log('开始执行', list)
     productTableListValue.value = list