#
whycq
2023-11-22 180d9f9c441b03c95d465b8c694ecf3f1acc6a11
pages/business/plan/addPlan2.vue
@@ -8,31 +8,18 @@
            <uni-forms-item label="跟踪项目" required name="orderId" >
               <view @click="autoLoad('order','')">
                  <uni-combox :candidates="orderIds" placeholder="请选择跟踪项目"
                  v-model="baseFormData.orderId" @input="autoLoad('order',baseFormData.orderId)"></uni-combox>
                  v-model="baseFormData.orderId$" @input="autoLoad('order',baseFormData.orderId$)"></uni-combox>
               </view>
            </uni-forms-item>
            <uni-forms-item label="业务员" required name="userId">
               <view @click="autoLoad('user','')">
                  <uni-combox :candidates="users" placeholder="请选择业务员"
                  v-model="baseFormData.userId" @input="autoLoad('user',baseFormData.userId)"></uni-combox>
            <uni-forms-item label="客户名称" required name="cstmrId">
               <view @click="autoLoad('cstmr','')">
                  <uni-combox :candidates="cstmrs" placeholder="请选择客户名称"
                  v-model="baseFormData.cstmrId$" @input="autoLoad('cstmr',baseFormData.cstmrId$)"></uni-combox>
               </view>
            </uni-forms-item>
            
            <uni-forms-item label="业务员联系方式" required name="userXmlSelPhone">
               <uni-easyinput v-model="baseFormData.userXmlSelPhone" placeholder="请输入业务员联系方式" />
            </uni-forms-item>
            <uni-forms-item label="所需" name="planNeed">
               <uni-data-checkbox v-model="baseFormData.planNeed" multiple :localdata="planNeeds" />
            </uni-forms-item>
            <uni-forms-item label="申请日期" required name="appleTime">
               <uni-datetime-picker type="date" return-type="string" v-model="baseFormData.appleTime" />
               </uni-data-picker>
            </uni-forms-item>
            <uni-forms-item label="客户名称" required name="cstmrId">
               <view @click="autoLoad('cstmr','')">
                  <uni-combox :candidates="cstmrs" placeholder="请选择客户名称"
                  v-model="baseFormData.cstmrId" @input="autoLoad('cstmr',baseFormData.cstmrId)"></uni-combox>
               </view>
            </uni-forms-item>
            <uni-forms-item label="业务类型" required name="planType">
               <uni-easyinput disabled placeholder="请输入业务类型" v-model="baseFormData.planType"></uni-easyinput>
@@ -40,6 +27,12 @@
            <uni-forms-item label="立项"  name="beItem">
               <uni-data-checkbox v-model="baseFormData.beItem" :localdata="beItem$" />
            </uni-forms-item>
            <uni-forms-item label="所需" name="planNeed">
               <uni-data-checkbox v-model="baseFormData.planNeed" multiple :localdata="planNeeds" />
            </uni-forms-item>
            
            
            <uni-forms-item label="货物规格" required name="input_2">
@@ -97,9 +90,6 @@
            </uni-forms-item>
            <br>
            
            <uni-forms-item label="规划员" name="planner$">
               <uni-easyinput v-model="baseFormData.planner$" placeholder="请输入规划员" />
            </uni-forms-item>
            <uni-forms-item label="更改方案" name="change">
               <uni-data-checkbox v-model="baseFormData.change" :localdata="changeValue" />
            </uni-forms-item>
@@ -126,6 +116,7 @@
</template>
<script>
   import user from '@/pages/api/user/user.js'
   import test from '../../../static/js/citys-data.js'
   export default {
      data() {
@@ -147,7 +138,8 @@
               changeReason: '',
               changeTime: '',
               planBonus: '',
               planLeaderBonus: ''
               planLeaderBonus: '',
               userXmlSelPhone: ''
            },
            selList: ['牛腿式','横梁式','新能源','其他'],
            rules: {
@@ -343,8 +335,18 @@
      onShow() {
         // 获取省市区
         this.citysData = test.citysData
         // 获取业务员联系方式
         this.getDetail()
      },
      methods: {
         async getDetail() {
            let res = await user.getDetail()
            if (res.code === 200) {
               this.baseFormData.userXmlSelPhone = res.data.mobile
            } else if (res.code === 403) {
               this.backLogin(res)
            }
         },
         bindPickerChange: function(e) {
            this.cstmrTypeIndex = e.detail.value
            this.baseFormData.cstmrType = this.cstmrTypes[e.detail.value].id
@@ -409,20 +411,20 @@
            var element
            
            for (element of that.cstmrList) {
               if(element.value == that.baseFormData.cstmrId) {
               if(element.value == that.baseFormData.cstmrId$) {
                  that.baseFormData.cstmrId = element.id
               }
            }
            for (element of that.orderList) {
               if(element.name == that.baseFormData.orderId) {
               if(element.name == that.baseFormData.orderId$) {
                  that.baseFormData.orderId = element.id
               }
            }
            for (element of that.userList) {
               if(element.value == that.baseFormData.userId) {
                  that.baseFormData.userId = element.id
               }
            }
            // for (element of that.userList) {
            //    if(element.value == that.baseFormData.userId) {
            //       that.baseFormData.userId = element.id
            //    }
            // }
            for(var i = 1;i <= that.selList.length; i++) {
               if (that.selList[i] == that.baseFormData.select_3) {
                  that.baseFormData.select_3 = 'value' + i