yangfeng
2023-10-13 2e9bfefd8d092112b5f964de6f816e171ab3f1db
src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -24,10 +24,26 @@
          <div class="basic-info-view">
            <el-row>
              <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">
                  <div class="custom-name">
                    <el-autocomplete
                      style="width:100%;"
                      style="width: 100%"
                      v-model="editConfig.infomation.client_name"
                      :fetch-suggestions="
                        (queryString, callback) => {
@@ -36,12 +52,17 @@
                      "
                      value-key="name"
                      @select="handleSelectClient('client', $event)"
                      :disabled="isNameChanceEdit"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick('client')">
                    <div v-if="!isNameChanceEdit" class="common-select-btn" @click="selClientClick('client')">
                      <i class="el-icon-circle-plus-outline" title="选择"></i>
                    </div>
                    <div
                      v-if="editConfig.infomation.client_name && editConfig.infomation.client_name.length > 0"
                      v-if="
                        editConfig.infomation.client_name &&
                        editConfig.infomation.client_name.length > 0 &&
                        !isNameChanceEdit
                      "
                      class="common-select-btn"
                      @click="clearupClient('client')"
                    >
@@ -50,31 +71,12 @@
                  </div>
                </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="saleChanceId">
                  <div class="custom-name">
                    <el-autocomplete
                      style="width:100%"
                      style="width: 100%"
                      v-model="editConfig.infomation.sale_chance_name"
                      :fetch-suggestions="
                        (queryString, callback) => {
@@ -83,12 +85,17 @@
                      "
                      value-key="name"
                      @select="handleSelectClient('chance', $event)"
                      :disabled="isNameChanceEdit"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick('chance')">
                    <div v-if="!isNameChanceEdit" class="common-select-btn" @click="selClientClick('chance')">
                      <i class="el-icon-circle-plus-outline"></i>
                    </div>
                    <div
                      v-if="editConfig.infomation.sale_chance_name && editConfig.infomation.sale_chance_name.length > 0"
                      v-if="
                        editConfig.infomation.sale_chance_name &&
                        editConfig.infomation.sale_chance_name.length > 0 &&
                        !isNameChanceEdit
                      "
                      class="common-select-btn"
                      @click="clearupClient('chance')"
                    >
@@ -117,7 +124,7 @@
                    value-format="yyyy-MM-dd"
                    type="date"
                    placeholder="选择日期"
                    style="width:100%"
                    style="width: 100%"
                  >
                  </el-date-picker>
                </el-form-item>
@@ -125,7 +132,6 @@
              <el-col :span="12">
                <el-form-item label="销售负责人" prop="memberId">
                  <el-select
                    v-model="editConfig.infomation.memberId"
                    placeholder="请选择"
                    size="mini"
@@ -143,7 +149,7 @@
                    value-format="yyyy-MM-dd"
                    type="date"
                    placeholder="选择日期"
                    style="width:100%"
                    style="width: 100%"
                  >
                  </el-date-picker>
                </el-form-item>
@@ -190,7 +196,7 @@
              <el-col :span="12">
                <el-form-item label="收货地址" prop="address">
                  <el-input
                    style="width:100%"
                    style="width: 100%"
                    type="textarea"
                    :autosize="{ minRows: 2 }"
                    v-model="editConfig.infomation.address"
@@ -228,7 +234,7 @@
              <el-col :span="24">
                <el-form-item label="条款与条件" prop="conditions" label-width="15%">
                  <el-input
                    style="width:100%;"
                    style="width: 100%"
                    type="textarea"
                    :autosize="{ minRows: 4 }"
                    v-model="editConfig.infomation.conditions"
@@ -378,10 +384,10 @@
import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
import SelectChanceDialog from "@/views/other/commonDialog/SelectChanceDialog"
import AddCollectionPlan from "@/views/other/payment/collectionPlan/AddCollectionPlan"
import codeMixin from "@/views/client/followupRecords/mixin/codeMixin";
import codeMixin from "@/views/client/followupRecords/mixin/codeMixin"
export default {
  name: "AddSalesDetailsDialog",
  mixins:[codeMixin],
  mixins: [codeMixin],
  props: {
    editCommonConfig: {
      type: Object,
@@ -445,7 +451,8 @@
        title: "新建",
        infomation: {}
      },
      amountTotal: 0
      amountTotal: 0,
      isNameChanceEdit: false
    }
  },
  created() {
@@ -453,27 +460,33 @@
    this.$store.dispatch("geChance")
    this.setTableForm()
    this.getCommonData()
    this.formInfo();
    this.formInfo()
    if (this.editConfig.title === "新建" && this.editConfig.infomation.client_name.length > 0) {
      this.isNameChanceEdit = true
    }
    // else {
    // }
  },
  watch:{
    'editClientManageConfig.visible'(val){
      if(val){
  watch: {
    "editClientManageConfig.visible"(val) {
      if (val) {
        this.formInfo()
      }
    },
    'editClientManageConfig.infomation.codeStandID'(){
    "editClientManageConfig.infomation.codeStandID"() {
      this.formInfo()
    }
  },
  methods: {
    formInfo(){
      this.objCode.type='销售明细编码'
      this.objCode.codeStandID = ''
      if(this.editConfig.infomation.codeStandID){
        this.objCode.codeStandID = this.editConfig.infomation.codeStandID;
    formInfo() {
      this.objCode.type = "销售明细编码"
      this.objCode.codeStandID = ""
      if (this.editConfig.infomation.codeStandID) {
        this.objCode.codeStandID = this.editConfig.infomation.codeStandID
      }
      this.getRCodeStandardList();
    },
      this.getRCodeStandardList()
    },
    getCommonData() {
      getAllData()
        .then((res) => {
@@ -561,7 +574,7 @@
        logisticCompany: data.logisticCompany || "",
        logisticCost: data.logisticCost || 0,
        logisticNumber: data.logisticNumber || "",
        codeRule:this.codeRule,
        codeRule: this.codeRule
      }
      let params = {}
      if (this.editConfig.title === "新建") {
@@ -662,7 +675,7 @@
          { label: "产品名称", prop: "name", productName: true, isRequird: true },
          { label: "产品编号", prop: "number" },
          { label: "数量", prop: "amount", inputNumber: true, isRequird: true },
          { label: "销售单价", prop: "price",inputFloat: true  },
          { label: "销售单价", prop: "price", inputFloat: true },
          { label: "价税合计", prop: "total", inputFloat: true }
        ]
      }
@@ -722,8 +735,8 @@
<style lang="scss" scoped>
::v-deep {
  .iframe-dialog .el-dialog__body {
    .el-form{
      .el-form-item{
    .el-form {
      .el-form-item {
        width: 100%;
      }
    }