yangfeng
2023-10-16 0f43183f986f0ed314647687c73da5a4493d2611
src/views/other/payment/receipt/addReceipt.vue
@@ -13,7 +13,7 @@
        :model="editConfig.infomation"
        :rules="rules"
        label-position="right"
        label-width="308px"
        label-width="168px"
        size="mini"
        style="height: 60vh; overflow-x: hidden"
      >
@@ -35,12 +35,17 @@
                      "
                      value-key="name"
                      @select="handleSelectClient('client', $event)"
                      style="width: 100%"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick('client')">
                      <i class="el-icon-circle-plus-outline" title="选择"></i>
                    </div>
                    <div class="common-select-btn" @click="clearupClient('client')">
                      <i class="el-icon-edit-outline" title="清除"></i>
                    <div
                      v-if="editConfig.infomation.client_name && editConfig.infomation.client_name.length > 0"
                      class="common-select-btn"
                      @click="clearupClient('client')"
                    >
                      <i class="el-icon-remove-outline" title="清除"></i>
                    </div>
                  </div>
                </el-form-item>
@@ -63,21 +68,29 @@
                      "
                      value-key="number"
                      @select="handleSelectClient('serviceContract', $event)"
                      style="width: 100%"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick('serviceContract')">
                      <i class="el-icon-circle-plus-outline" title="选择"></i>
                    </div>
                    <div class="common-select-btn" @click="clearupClient('serviceContract')">
                      <i class="el-icon-edit-outline" title="清除"></i>
                    <div
                      v-if="
                        editConfig.infomation.serviceContract_Number &&
                        editConfig.infomation.serviceContract_Number.length > 0
                      "
                      class="common-select-btn"
                      @click="clearupClient('serviceContract')"
                    >
                      <i class="el-icon-remove-outline" title="清除"></i>
                    </div>
                  </div>
                </el-form-item>
              </el-col>
              <el-col v-else :span="12">
                <el-form-item label="合同订单">
                <el-form-item label="销售明细单" prop="saleDetailNumber">
                  <div class="custom-name">
                    <el-autocomplete
                      v-model="editConfig.infomation.number"
                      v-model="editConfig.infomation.saleDetailNumber"
                      :fetch-suggestions="
                        (queryString, callback) => {
                          querySearchAsync(queryString, callback, 'contract')
@@ -85,12 +98,17 @@
                      "
                      value-key="number"
                      @select="handleSelectClient('contract', $event)"
                      style="width: 100%"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick('contract')">
                      <i class="el-icon-circle-plus-outline" title="选择"></i>
                    </div>
                    <div class="common-select-btn" @click="clearupClient('contract')">
                      <i class="el-icon-edit-outline" title="清除"></i>
                    <div
                      v-if="editConfig.infomation.saleDetailNumber && editConfig.infomation.saleDetailNumber.length > 0"
                      class="common-select-btn"
                      @click="clearupClient('contract')"
                    >
                      <i class="el-icon-remove-outline" title="清除"></i>
                    </div>
                  </div>
                </el-form-item>
@@ -101,7 +119,7 @@
                    v-model="editConfig.infomation.principalId"
                    placeholder="请选择"
                    size="mini"
                    style="width: 63%"
                    style="width: 100%"
                  >
                    <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id">
                    </el-option>
@@ -115,6 +133,7 @@
                    value-format="yyyy-MM-dd"
                    type="date"
                    placeholder="选择日期"
                    style="width: 100%"
                  >
                  </el-date-picker>
                </el-form-item>
@@ -139,7 +158,7 @@
                    v-model="editConfig.infomation.paymentTypeId"
                    placeholder="请选择"
                    size="mini"
                    style="width: 63%"
                    style="width: 100%"
                  >
                    <el-option
                      v-for="item in paymentTypeListOptions"
@@ -157,7 +176,7 @@
                    v-model="editConfig.infomation.bankAccountId"
                    placeholder="请选择"
                    size="mini"
                    style="width: 63%"
                    style="width: 100%"
                  >
                    <el-option v-for="item in bankAccountOptions" :key="item.id" :label="item.name" :value="item.id">
                    </el-option>
@@ -175,7 +194,7 @@
          <div class="basic-info-title">收款信息</div>
          <div class="basic-info-view">
            <el-row>
              <el-col :span="24">
              <el-col :span="12">
                <el-form-item label="本次收款金额" prop="amount">
                  <el-input-number
                    v-model="editConfig.infomation.amount"
@@ -183,7 +202,7 @@
                    :min="0"
                    :precision="2"
                    :controls="false"
                    style="width: 25%; margin-right: 5px"
                    style="width: 100%"
                  ></el-input-number>
                </el-form-item>
              </el-col>
@@ -335,12 +354,13 @@
  },
  data() {
    return {
      dialogWidth: "80%",
      dialogWidth: "50%",
      editConfig: this.editCommonConfig,
      rules: {
        client_name: [{ required: true, message: "请选择客户名称", trigger: "change" }],
        signTime: [{ required: true, message: "请选择收款日期", trigger: "change" }],
        memberId: [{ required: true, message: "请选择销售负责人", trigger: "change" }]
        memberId: [{ required: true, message: "请选择销售负责人", trigger: "change" }],
        saleDetailNumber: [{ required: true, message: "请选择销售明细单", trigger: "change" }]
        // approvalOpinion: [{ required: true, message: "请输入", trigger: "blur" }]
      },
      memberOptions: [],
@@ -500,9 +520,9 @@
      }
    },
    selClient(row, value) {
      if (value === "contact") {
        this.editConfig.infomation.contact_name = row.name
        this.contactId = row.id
      if (value === "client") {
        this.editConfig.infomation.client_name = row.name
        this.clientId = row.id
      } else if (value === "serviceContract") {
        this.editConfig.infomation.serviceContract_Number = row.number
        this.serviceContractId = row.id
@@ -529,52 +549,83 @@
    // 设置允许上传文件格式
    setFormatClick() {},
    setTableForm() {
      if (this.editConfig.title === "新建") {
      if (this.editConfig.title === "新建" || this.editConfig.infomation.products.length === 0) {
        this.tableData = [
          {
            id: 1,
            Amount: 0,
            IsSale: true,
            MaterialMode: "",
            MinInventory: 0,
            Name: "",
            Number: "",
            PurchaseType: "",
            SalePrice: 0,
            Unit: ""
            productId: this.productId,
            id: 0,
            amount: 0,
            desc: "",
            name: "",
            number: "",
            price: 0,
            total: 0
          }
        ]
      } else {
        this.tableData = this.editConfig.infomation.products
        this.tableData.map((item, index) => {
          item.productId = index + 1
        })
      }
      this.productTableList = {
        tableData: this.tableData,
        tableColumn: [
          { label: "#", prop: "id", width: 40 },
          { label: "产品名称", prop: "Name", input: true, isRequird: true },
          { label: "产品编号", prop: "Number" },
          { label: "数量", prop: "Amount", input: true, isRequird: true },
          { label: "销售单价", prop: "Unit", input: true },
          { label: "价税合计", prop: "total", input: true },
          { label: "描述", prop: "other8" }
          { label: "#", prop: "productId", width: 40 },
          { label: "产品名称", prop: "name", productName: true, isRequird: true },
          { label: "产品编号", prop: "number" },
          { label: "数量", prop: "amount", inputNumber: true, isRequird: true },
          { label: "销售单价", prop: "price", inputFloat: true },
          { label: "价税合计", prop: "total", inputFloat: true }
        ]
      }
    },
    // 产品列表输入
    inputContent(val, prop, row) {
      this.productId = row.productId
      this.tableData.map((item) => {
        if (item.productId === row.productId) {
          item[prop] = val
        }
      })
    },
    // 产品新增
    addProductClick() {
      this.productId++
      this.tableData.push({
        id: this.productId,
        Amount: 0,
        IsSale: true,
        MaterialMode: "",
        MinInventory: 0,
        Name: "",
        Number: "",
        PurchaseType: "",
        SalePrice: 0,
        Unit: ""
        productId: this.productId,
        id: 0,
        amount: 0,
        desc: "",
        name: "",
        number: "",
        price: 0,
        total: 0
      })
      this.showSummary.show = true
    },
    //  产品清空
    emptyProductClick() {
      this.productId = 1
      this.tableData = [
        {
          productId: this.productId,
          id: 0,
          amount: 0,
          desc: "",
          name: "",
          number: "",
          price: 0,
          total: 0
        }
      ]
      this.productTableList.tableData = this.tableData
    },
    // 产品重算
    recalculateProductClick() {},
    clearupProduct(data) {
      this.tableData = data
      this.productTableList.tableData = this.tableData
    }
  }
}