yangfeng
2023-10-13 2e54592b7adf069f6ddfc9348c6daf9612f34f79
src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
@@ -8,7 +8,8 @@
      append-to-body
      custom-class="iframe-dialog"
    >
      <el-form v-if="refreshFlag"
      <el-form
        v-if="refreshFlag"
        ref="form"
        :model="editConfig.infomation"
        :rules="rules"
@@ -23,31 +24,27 @@
          <div class="basic-info-title">机会基本信息</div>
          <div class="basic-info-view">
            <el-row>
<!--              <el-col :span="12">-->
<!--                <el-form-item label="销售机会编号" prop="number">-->
<!--                  <el-input v-model="editConfig.infomation.number"></el-input>-->
<!--                </el-form-item>-->
<!--              </el-col>-->
             <el-col :span="12">
               <el-form-item label="销售机会编号" prop="number">
                 <WordInput
                     v-if="codenumer && (explain != '' || isIdDisabled)&&method == 0"
                     :codenumer="codenumer"
                     :sum="sum"
                     :disabled="editConfig.infomation.id || isIdDisabled"
                     :inputValue="inputValue"
                     @codeList="codeList"
                 />
                 <span v-else-if="method == 0" style="color: #f56c6c"
                 >请优先配置编码规范
                    <el-button type="text"  @click="numberClick">
                        配置规范
                      </el-button
                      ></span
                 >
                 <span v-else>{{editConfig.title==='新建'? '自动生成': editConfig.infomation.number}}</span>
               </el-form-item>
             </el-col>
              <!--              <el-col :span="12">-->
              <!--                <el-form-item label="销售机会编号" prop="number">-->
              <!--                  <el-input v-model="editConfig.infomation.number"></el-input>-->
              <!--                </el-form-item>-->
              <!--              </el-col>-->
              <el-col :span="12">
                <el-form-item label="销售机会编号" prop="number">
                  <WordInput
                    v-if="codenumer && (explain != '' || isIdDisabled) && method == 0"
                    :codenumer="codenumer"
                    :sum="sum"
                    :disabled="editConfig.title !== '新建' || isIdDisabled"
                    :inputValue="inputValue"
                    @codeList="codeList"
                  />
                  <span v-else-if="method == 0" style="color: #f56c6c"
                    >请优先配置编码规范 <el-button type="text" @click="numberClick"> 配置规范 </el-button></span
                  >
                  <span v-else>{{ editConfig.title === "新建" ? "自动生成" : editConfig.infomation.number }}</span>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="客户名称" prop="client_name" ref="clientName">
                  <div class="custom-name">
@@ -572,11 +569,11 @@
import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
import SelectContactDialog from "@/views/other/commonDialog/SelectContactDialog"
import { getCityList } from "@/api/common/address"
import WordInput from "@/components/wordInput.vue";
import codeMixin from "@/views/client/followupRecords/mixin/codeMixin";
import WordInput from "@/components/wordInput.vue"
import codeMixin from "@/views/client/followupRecords/mixin/codeMixin"
export default {
  name: "AddSalesOpportunityDialog",
  mixins:[codeMixin],
  mixins: [codeMixin],
  props: {
    editCommonConfig: {
      type: Object,
@@ -589,7 +586,7 @@
      }
    }
  },
  components: {WordInput, SelectClientDialog, SelectContactDialog },
  components: { WordInput, SelectClientDialog, SelectContactDialog },
  computed: {
    searchCommonHeight() {
      return this.$refs.searchCommonView.offsetHeight
@@ -603,7 +600,7 @@
  },
  data() {
    return {
      refreshFlag:true,
      refreshFlag: true,
      dialogWidth: "50%",
      editConfig: this.editCommonConfig,
      rules: {
@@ -615,7 +612,7 @@
        currency: [{ required: true, message: "请选择币种", trigger: "change" }],
        expected_time: [{ required: true, message: "请选择预计成交日期", trigger: "change" }],
        projected_amount: [{ required: true, message: "请输入预计合同金额", trigger: "blur" }],
        client_name: [{ required: true, message: "请选择客户", trigger: "change" }],
        client_name: [{ required: true, message: "请选择客户", trigger: "change" }]
      },
      businessSourceOptions: [],
      memberOptions: [],
@@ -642,7 +639,7 @@
      restaurants: [],
      clientId: this.editCommonConfig.infomation.client_id,
      contactId: this.editCommonConfig.infomation.contact_id,
      objCode: { name: "", page: 0, pageSize: 0, type: "销售机会编码",codeStandID:'' },
      objCode: { name: "", page: 0, pageSize: 0, type: "销售机会编码", codeStandID: "" }
    }
  },
  created() {
@@ -652,25 +649,25 @@
      this.getCityList(this.editConfig.infomation.province_id, "edit")
    }
    this.getCommonData()
    this.formInfo();
    this.formInfo()
  },
  watch:{
    'editConfig.visible'(val){
      if(val){
  watch: {
    "editConfig.visible"(val) {
      if (val) {
        this.formInfo()
      }
    },
    'editConfig.infomation.codeStandID'(){
    "editConfig.infomation.codeStandID"() {
      this.formInfo()
    }
  },
  methods: {
    formInfo(){
      this.objCode.codeStandID = ''
      if(this.editConfig.infomation.codeStandID){
        this.objCode.codeStandID = this.editConfig.infomation.codeStandID;
    formInfo() {
      this.objCode.codeStandID = ""
      if (this.editConfig.infomation.codeStandID) {
        this.objCode.codeStandID = this.editConfig.infomation.codeStandID
      }
      this.getRCodeStandardList();
      this.getRCodeStandardList()
    },
    getCommonData() {
      this.editConfig.infomation.country_id = 1
@@ -774,8 +771,8 @@
        remark: data.remark || "",
        detail_address: data.detail_address || "",
        codeStandID:data.ID,
        codeRule:this.codeRule,
        codeStandID: data.ID,
        codeRule: this.codeRule
      }
      return params
    },
@@ -823,10 +820,10 @@
     * 强制刷新form组件
     * 外部更改表单值不会触发表单校验,导致即使有值夜被表单校验阻塞住
     */
    refresh(){
      this.refreshFlag=false
      requestAnimationFrame(()=>{
        this.refreshFlag=true
    refresh() {
      this.refreshFlag = false
      requestAnimationFrame(() => {
        this.refreshFlag = true
      })
    },
    // 清除已选择用户
@@ -894,8 +891,8 @@
            flex: 1;
          }
        }
        .custom-name{
          .el-autocomplete{
        .custom-name {
          .el-autocomplete {
            flex: 1;
          }
        }