yangfeng
2023-08-01 ebddc02611b0373c1d5bfa342bd781fb5eb82009
src/views/sales/salesReturn/AddSalesReturnDialog.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>
@@ -166,6 +175,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>
@@ -174,6 +189,7 @@
import CommonFormTableView from "@/components/makepager/CommonFormTableView"
import { getAllData } from "@/api/client/client"
import { getAddSalesReturn, getUpdateSalesReturn } from "@/api/sales/salesReturn"
import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
export default {
  name: "AddSalesReturnDialog",
  props: {
@@ -188,8 +204,12 @@
      }
    }
  },
  components: { CommonFormTableView },
  computed: {},
  components: { CommonFormTableView, SelectClientDialog },
  computed: {
    clientList() {
      return this.$store.state.getClientName.clientList
    }
  },
  data() {
    return {
      dialogWidth: "80%",
@@ -201,17 +221,9 @@
      },
      memberOptions: [],
      selSourceOrderOptions: [], // 选择源单
      repositoryOptions: [
        { value: "1", label: "总仓" },
        { value: "2", label: "赠品仓" },
        { value: "3", label: "其他仓" }
      ], // 退入仓库
      repositoryOptions: [], // 退入仓库
      statusOptions: [], // 状态
      currencyOptions: [
        { value: "1", label: "人民币(¥)" },
        { value: "2", label: "英镑(£)" },
        { value: "3", label: "欧元(€)" }
      ], // 币种
      currencyOptions: [], // 币种
      productTableList: {},
      showSummary: {
        show: true,
@@ -219,10 +231,16 @@
        refundable: true,
        sumProp: ["other1", "other2", "other3", "other4"],
        mergeNumber: 4
      },
      editSelectClientConfig: {
        editVisible: false,
        title: "",
        infomation: {}
      }
    }
  },
  created() {
    this.$store.dispatch("geClient")
    this.setTableForm()
    this.getCommonData()
  },
@@ -231,6 +249,9 @@
      getAllData()
        .then((res) => {
          this.memberOptions = res.data.member
          this.repositoryOptions = res.data.repository
          this.currencyOptions = res.data.currency
          this.statusOptions = res.data.status
        })
        .catch((err) => {
          console.log(err)
@@ -312,6 +333,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.editConfig.infomation.client_id = item.id
    },
    selClientClick() {
      this.editSelectClientConfig.editVisible = true
    },
    selClient(row) {
      console.log(row)
      this.editConfig.infomation.client_name = row.name
      this.editConfig.infomation.client_id = row.id
    },
    // 清除已选择用户
    clearupClient() {
      this.editConfig.infomation.client_name = ""
      this.editConfig.infomation.client_id = 0
    },
    // 添加附件
    addAnnexClick() {},
    // 设置允许上传文件格式
@@ -358,13 +406,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 {