yangfeng
2023-08-15 bd42b949807795c581e9193d92834a6187fc10d2
src/views/sales/refundForm/AddRefundFormDialog.vue
@@ -74,15 +74,20 @@
              </el-col>
              <el-col :span="12">
                <el-form-item label="退款日期" prop="refundDate">
                  <el-date-picker v-model="editConfig.infomation.refundDate" type="date" placeholder="选择日期">
                  <el-date-picker
                    v-model="editConfig.infomation.refundDate"
                    value-format="yyyy-MM-dd"
                    type="date"
                    placeholder="选择日期"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="付款方式" prop="refundMethod">
                <el-form-item label="付款方式" prop="paymentTypeId">
                  <div class="common-select">
                    <el-select
                      v-model="editConfig.infomation.refundMethod"
                      v-model="editConfig.infomation.paymentTypeId"
                      placeholder="请选择"
                      class="common-select-sel"
                      size="mini"
@@ -90,7 +95,7 @@
                      <el-option v-for="item in refundMethodOptions" :key="item.id" :label="item.name" :value="item.id">
                      </el-option>
                    </el-select>
                    <div class="common-select-btn"><i class="el-icon-setting"></i></div>
                    <!-- <div class="common-select-btn"><i class="el-icon-setting"></i></div> -->
                  </div>
                </el-form-item>
              </el-col>
@@ -106,7 +111,7 @@
                      <el-option v-for="item in accountOptions" :key="item.id" :label="item.name" :value="item.id">
                      </el-option>
                    </el-select>
                    <div class="common-select-btn"><i class="el-icon-setting"></i></div>
                    <!-- <div class="common-select-btn"><i class="el-icon-setting"></i></div> -->
                  </div>
                </el-form-item>
              </el-col>
@@ -119,10 +124,9 @@
                      class="common-select-sel"
                      size="mini"
                    >
                      <el-option v-for="item in isInvoiceOptions" :key="item.id" :label="item.name" :value="item.id">
                      </el-option>
                      <el-option v-for="item in isInvoiceOptions" :key="item" :label="item" :value="item"> </el-option>
                    </el-select>
                    <div class="common-select-btn"><i class="el-icon-setting"></i></div>
                    <!-- <div class="common-select-btn"><i class="el-icon-setting"></i></div> -->
                  </div>
                </el-form-item>
              </el-col>
@@ -144,7 +148,7 @@
            </el-row>
          </div>
          <!-- 附件信息 -->
          <div class="basic-info-title">附件信息</div>
          <!-- <div class="basic-info-title">附件信息</div>
          <div class="basic-info-view">
            <el-row>
              <el-col :span="12">
@@ -169,7 +173,7 @@
                </el-form-item>
              </el-col>
            </el-row>
          </div>
          </div> -->
          <!-- 产品管理 -->
          <div class="basic-info-title" style="display: flex">
            产品管理
@@ -286,7 +290,7 @@
      // selSourceOrderOptions: [{ value: "1", label: "销售退货单" }], // 选择源单
      refundMethodOptions: [], // 付款方式
      accountOptions: [], // 账户
      isInvoiceOptions: [], // 是否开票
      isInvoiceOptions: ["是", "否"], // 是否开票
      currencyOptions: [], // 币种
      approvalWorkflowOptions: [], // 审批流程
      productTableList: {},
@@ -300,7 +304,8 @@
        editVisible: false,
        title: "",
        infomation: {}
      }
      },
      clientId: this.editCommonConfig.infomation.client_id
    }
  },
  created() {
@@ -315,7 +320,7 @@
          this.memberOptions = res.data.member
          this.refundMethodOptions = res.data.refundMethod
          this.accountOptions = res.data.accountId
          this.isInvoiceOptions = res.data.isInvoice
          // this.isInvoiceOptions = res.data.isInvoice
          this.currencyOptions = res.data.currency
        })
        .catch((err) => {
@@ -330,37 +335,23 @@
          const params = this.saveParams()
          console.log(params)
          if (this.editConfig.title === "新建") {
            getAddSalesRefund(params)
              .then((res) => {
                console.log(res)
                this.editConfig.visible = false
                if (res.code === 200) {
                  this.$message({
                    message: "添加成功",
                    type: "success"
                  })
                  this.$parent.getData()
                }
              })
              .catch((err) => {
                console.log(err)
              })
            getAddSalesRefund(params).then((res) => {
              console.log(res)
              this.editConfig.visible = false
              if (res.code === 200) {
                this.$message.success("添加成功")
                this.$parent.getData()
              }
            })
          } else {
            getUpdateSalesRefund(params)
              .then((res) => {
                console.log(res)
                this.editConfig.visible = false
                if (res.code === 200) {
                  this.$message({
                    message: "编辑成功",
                    type: "success"
                  })
                  this.$parent.getData()
                }
              })
              .catch((err) => {
                console.log(err)
              })
            getUpdateSalesRefund(params).then((res) => {
              console.log(res)
              this.editConfig.visible = false
              if (res.code === 200) {
                this.$message.success("编辑成功")
                this.$parent.getData()
              }
            })
          }
        } else {
          console.log("error submit")
@@ -374,21 +365,11 @@
        id: this.editConfig.title === "新建" ? 0 : data.id,
        salesRefund: {
          accountId: data.accountId || 0,
          clientId: parseInt(data.clientId) || 0,
          isInvoice: data.isInvoice || 0,
          clientId: this.clientId || 0,
          isInvoice: data.isInvoice || "",
          memberId: data.memberId || 0,
          number: data.number || "",
          products: [
            {
              amount: 0,
              desc: "",
              id: 0,
              name: "",
              number: "",
              price: 0,
              total: 0
            }
          ],
          products: data.products || [],
          reason: data.reason || "",
          refundDate: data.refundDate || "",
          refundMethod: data.refundMethod || ""
@@ -411,7 +392,7 @@
      }
    },
    handleSelectClient(item) {
      this.editConfig.infomation.client_id = item.id
      this.clientId = item.id
    },
    selClientClick() {
      this.editSelectClientConfig.editVisible = true
@@ -419,12 +400,12 @@
    selClient(row) {
      console.log(row)
      this.editConfig.infomation.client_name = row.name
      this.editConfig.infomation.client_id = row.id
      this.clientId = row.id
    },
    // 清除已选择用户
    clearupClient() {
      this.editConfig.infomation.client_name = ""
      this.editConfig.infomation.client_id = 0
      this.clientId = 0
    },
    // 添加附件
    addAnnexClick() {},