yangfeng
2023-07-28 4fc4068252f1a07e0f42c20ad058a32c87f85a28
src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -22,11 +22,20 @@
          <div class="basic-info-view">
            <el-row>
              <el-col :span="12">
                <el-form-item label="客户名称" prop="clientId">
                <el-form-item label="客户名称" prop="client_name">
                  <div class="custom-name">
                    <el-input v-model="editConfig.infomation.clientId"></el-input>
                    <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="选择"></i></div>
                    <div class="common-select-btn"><i class="el-icon-edit" title="编辑"></i></div>
                    <el-autocomplete
                      v-model="editConfig.infomation.client_name"
                      :fetch-suggestions="querySearchAsync"
                      value-key="name"
                      @select="handleSelectClient"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick">
                      <i class="el-icon-circle-plus-outline" title="选择"></i>
                    </div>
                    <div class="common-select-btn" @click="clearupClient">
                      <i class="el-icon-edit-outline" title="清除"></i>
                    </div>
                  </div>
                </el-form-item>
              </el-col>
@@ -82,7 +91,7 @@
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="12">
              <!-- <el-col :span="12">
                <el-form-item label="微信订单状态" prop="wechatOrderStatus">
                  <div class="common-select">
                    <el-select
@@ -104,7 +113,7 @@
                    </div>
                  </div>
                </el-form-item>
              </el-col>
              </el-col> -->
            </el-row>
          </div>
          <!-- 收货信息 -->
@@ -128,6 +137,21 @@
                    :autosize="{ minRows: 2 }"
                    v-model="editConfig.infomation.address"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="物流公司" prop="logisticCompany">
                  <el-input v-model="editConfig.infomation.logisticCompany"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="物流单号" prop="logisticNumber">
                  <el-input v-model="editConfig.infomation.logisticNumber"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="物流费用" prop="logisticCost">
                  <el-input v-model="editConfig.infomation.logisticCost"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
@@ -257,6 +281,12 @@
        <el-button type="primary" size="small" @click="saveClick('form')">保存</el-button>
        <el-button size="small" @click="editConfig.visible = false">取消</el-button>
      </div>
      <!-- 选择客户 -->
      <SelectClientDialog
        v-if="editSelectClientConfig.editVisible"
        :edit-common-config="editSelectClientConfig"
        @selClient="selClient"
      />
    </el-dialog>
  </div>
</template>
@@ -265,6 +295,7 @@
import CommonFormTableView from "@/components/makepager/CommonFormTableView"
import { getAllData } from "@/api/client/client"
import { getAddSalesDetails, getUpdateSalesDetails } from "@/api/sales/salesDetails"
import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
export default {
  name: "AddSalesDetailsDialog",
  props: {
@@ -279,19 +310,24 @@
      }
    }
  },
  components: { CommonFormTableView },
  computed: {},
  components: { CommonFormTableView, SelectClientDialog },
  computed: {
    clientList() {
      return this.$store.state.getClientName.clientList
    }
  },
  data() {
    return {
      dialogWidth: "80%",
      editConfig: this.editCommonConfig,
      rules: {
        clientId: [{ required: true, message: "请输入", trigger: "blur" }],
        client_name: [{ required: true, message: "请输入", trigger: "blur" }],
        number: [{ required: true, message: "请输入", trigger: "blur" }],
        signTime: [{ required: true, message: "请选择", trigger: "change" }],
        memberId: [{ required: true, message: "请选择负责人", trigger: "change" }]
        // approvalOpinion: [{ required: true, message: "请输入", trigger: "blur" }]
      },
      clientId: this.editCommonConfig.infomation.clientId,
      memberOptions: [],
      selSourceOrderOptions: [],
      wechatOrderStatusOptions: [], // 微信订单状态
@@ -307,10 +343,16 @@
        total: true,
        sumProp: ["other1", "other7"],
        mergeNumber: 2
      },
      editSelectClientConfig: {
        editVisible: false,
        title: "",
        infomation: {}
      }
    }
  },
  created() {
    this.$store.dispatch("geClient")
    this.setTableForm()
    this.getCommonData()
  },
@@ -377,7 +419,7 @@
        salesDetails: {
          address: data.address || "",
          addressee: data.addressee || "",
          clientId: parseInt(data.clientId) || 0,
          clientId: parseInt(this.clientId),
          conditions: data.conditions || "",
          deliveryDate: data.deliveryDate || "",
          memberId: data.memberId || 0,
@@ -398,7 +440,10 @@
          saleChanceId: data.saleChanceId || 0,
          saleType: data.saleType || 0,
          signTime: data.signTime || "",
          wechatOrderStatus: data.wechatOrderStatus || 0
          wechatOrderStatus: data.wechatOrderStatus || 0,
          logisticCompany: data.logisticCompany || "",
          logisticCost: parseInt(data.logisticCost) || 0,
          logisticNumber: data.logisticNumber || ""
        }
      }
      return params
@@ -406,6 +451,33 @@
    handleClose() {
      this.editConfig.visible = false
    },
    // 选择客户相关方法
    querySearchAsync(queryString, cb) {
      var restaurants = this.clientList
      var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants
      cb(results)
    },
    createStateFilter(queryString) {
      return (state) => {
        return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0
      }
    },
    handleSelectClient(item) {
      this.clientId = item.id
    },
    selClientClick() {
      this.editSelectClientConfig.editVisible = true
    },
    selClient(row) {
      console.log(row)
      this.editConfig.infomation.client_name = row.name
      this.clientId = row.id
    },
    // 清除已选择用户
    clearupClient() {
      this.editConfig.infomation.client_name = ""
      this.editConfig.infomation.client_id = 0
    },
    // 添加附件
    addAnnexClick() {},
@@ -447,13 +519,7 @@
    .basic-info-view {
      margin-top: 10px;
      padding-right: 40px;
      .custom-name {
        display: flex;
        .common-select-btn {
          margin-left: 5px;
          font-size: 18px;
        }
      }
      .custom-name,
      .common-select {
        display: flex;
        .common-select-sel {