Browse Source

任务单新增时表单选择优化;合同审批新增时初始化默认值

damon227 8 months ago
parent
commit
be37e123e8

+ 8 - 0
src/api/user.js

@@ -29,3 +29,11 @@ export function selectUsers (params) {
     }
   })
 }
+
+// 获取用户详情
+export function getCurrentUserInfo () {
+  return request({
+    url: request.adornUrl(`/user-service/user/info/`),
+    method: 'get'
+  })
+}

+ 11 - 1
src/views/modules/cus/contract-add-or-update.vue

@@ -269,7 +269,17 @@ export default {
         this.$emit('onChose')
       },
       async init (id, disable) {
-        this.dataForm = {}
+        this.dataForm = {
+          part11: 1,
+          part12: 1,
+          part21: 1,
+          part22: 1,
+          part23: 1,
+          part24: 1,
+          part25: 1,
+          part31: 3,
+          part32: 1
+        }
         this.display = disable
         this.fileList = []
         this.stepList = []

+ 17 - 4
src/views/modules/order/order-add-or-update.vue

@@ -357,7 +357,7 @@
   import WorderAddOrUpdate from '../worder/add-or-update-dialog'
   import PreviewComponent from '@/views/modules/common/preview-component'
   import {taskTypeOption} from '@/utils/enums'
-
+  import {getCurrentUserInfo} from '@/api/user'
 export default {
     name: 'order-add-or-update',
     components: {PreviewComponent, WorderAddOrUpdate, CusComponent, UploadComponent, UserComponent, AddOrUpdate},
@@ -406,14 +406,23 @@ export default {
         this.stepList = []
         this.logList = []
         this.dataForm = {
-          rateVal: 0
+          rateVal: 0,
+          salesmanId: ''
         }
         this.productDetails = []
         this.workInfoDetails = []
         this.visible = true
         this.id = id || 0
         this.display = display
-        if (!id) return
+
+        if (!id) {
+          await getCurrentUserInfo().then(({data}) => {
+            if (data && data.code === '200') {
+              this.dataForm.salesmanId = data.data.userId
+            }
+          })
+          return
+        }
         await getOrderDetail(this.id).then(({data}) => {
           if (data && data.code === '200') {
             this.dataForm = data.data
@@ -601,7 +610,9 @@ export default {
                 contractOption.push({
                   label: item.contractNumber,
                   value: item.contractNumber,
-                  data: item.cusCBookProducts
+                  data: item.cusCBookProducts,
+                  customerId: item.customerId,
+                  customerName: item.customerName
                 })
               })
             }
@@ -617,6 +628,8 @@ export default {
           t.unit = t.unitName
           this.addItem(t)
         })
+        this.dataForm.customerId = item.customerId
+        this.dataForm.customerName = item.customerName
       }
     }
   }