yangfeng
2023-08-09 acdff03246ce648082192dfb069c3a006a7fbee6
src/views/sales/refundForm/AddRefundFormDialog.vue
@@ -5,6 +5,8 @@
      :visible.sync="editConfig.visible"
      :width="dialogWidth"
      :before-close="handleClose"
      append-to-body
      custom-class="iframe-dialog"
    >
      <el-form
        ref="form"
@@ -22,11 +24,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>
@@ -225,6 +236,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>
@@ -233,6 +250,7 @@
import CommonFormTableView from "@/components/makepager/CommonFormTableView"
import { getAllData } from "@/api/client/client"
import { getAddSalesRefund, getUpdateSalesRefund } from "@/api/sales/refundForm"
import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
export default {
  name: "AddRefundFormDialog",
  props: {
@@ -247,8 +265,12 @@
      }
    }
  },
  components: { CommonFormTableView },
  computed: {},
  components: { CommonFormTableView, SelectClientDialog },
  computed: {
    clientList() {
      return this.$store.state.getClientName.clientList
    }
  },
  data() {
    return {
      dialogWidth: "80%",
@@ -261,25 +283,11 @@
        account: [{ required: true, message: "请选择", trigger: "change" }]
      },
      memberOptions: [],
      selSourceOrderOptions: [{ value: "1", label: "销售退货单" }], // 选择源单
      refundMethodOptions: [
        { value: "1", label: "现金" },
        { value: "2", label: "支票" },
        { value: "3", label: "电汇" },
        { value: "4", label: "邮政汇款" },
        { value: "5", label: "网上银行" },
        { value: "6", label: "其他" }
      ], // 付款方式
      accountOptions: [{ value: "1", label: "人民币账户" }], // 账户
      isInvoiceOptions: [
        { value: "1", label: "未开" },
        { value: "2", label: "已开" }
      ], // 是否开票
      currencyOptions: [
        { value: "1", label: "人民币(¥)" },
        { value: "2", label: "英镑(£)" },
        { value: "3", label: "欧元(€)" }
      ], // 币种
      // selSourceOrderOptions: [{ value: "1", label: "销售退货单" }], // 选择源单
      refundMethodOptions: [], // 付款方式
      accountOptions: [], // 账户
      isInvoiceOptions: [], // 是否开票
      currencyOptions: [], // 币种
      approvalWorkflowOptions: [], // 审批流程
      productTableList: {},
      showSummary: {
@@ -287,10 +295,16 @@
        total: true,
        sumProp: ["other1", "other2", "other3", "other4"],
        mergeNumber: 5
      },
      editSelectClientConfig: {
        editVisible: false,
        title: "",
        infomation: {}
      }
    }
  },
  created() {
    this.$store.dispatch("geClient")
    this.setTableForm()
    this.getCommonData()
  },
@@ -299,6 +313,10 @@
      getAllData()
        .then((res) => {
          this.memberOptions = res.data.member
          this.refundMethodOptions = res.data.refundMethod
          this.accountOptions = res.data.accountId
          this.isInvoiceOptions = res.data.isInvoice
          this.currencyOptions = res.data.currency
        })
        .catch((err) => {
          console.log(err)
@@ -381,6 +399,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() {},
    // 设置允许上传文件格式
@@ -423,58 +468,54 @@
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.add-refund-form {
  .basic-info {
    .basic-info-title {
      background-color: #f4f8fe;
      padding-left: 10px;
      font-size: 15px;
      font-weight: bold;
      color: #666;
      height: 42px;
      line-height: 42px;
    }
    .basic-info-view {
      margin-top: 10px;
      padding-right: 40px;
      .custom-name {
        display: flex;
        .common-select-btn {
          margin-left: 5px;
          font-size: 18px;
::v-deep {
  .iframe-dialog .el-dialog__body {
    .basic-info {
      .basic-info-title {
        background-color: #f4f8fe;
        padding-left: 10px;
        font-size: 15px;
        font-weight: bold;
        color: #666;
        height: 42px;
        line-height: 42px;
      }
      .basic-info-view {
        margin-top: 10px;
        padding-right: 40px;
        .custom-name,
        .common-select {
          display: flex;
          .common-select-sel {
            width: 270px;
          }
          .common-select-btn {
            margin-left: 5px;
            font-size: 16px;
            cursor: pointer;
          }
        }
      }
      .common-select {
      .annex-view {
        display: flex;
        .common-select-sel {
          width: 270px;
        }
        .common-select-btn {
          margin-left: 5px;
          font-size: 16px;
          cursor: pointer;
        color: #6166d3;
        .setFormat {
          margin-left: 10px;
        }
      }
    }
    .annex-view {
    .unflod-collapse {
      display: flex;
      height: 30px;
      justify-content: center;
      align-items: center;
      color: #6166d3;
      .setFormat {
        margin-left: 10px;
      }
    }
  }
  .unflod-collapse {
    display: flex;
    height: 30px;
    justify-content: center;
    align-items: center;
    color: #6166d3;
  }
  .dialog-footer {
    background-color: #f5f5f5;
    height: 55px;
    line-height: 55px;
    .dialog-footer {
      background-color: #f5f5f5;
      height: 55px;
      line-height: 55px;
    }
  }
}
</style>